Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3e654bb3 authored by hhakim's avatar hhakim
Browse files

Move MatSparse<FPP, GPU2> from .cpp.in to hpp file because it's not a template specialization.

parent 31ff52ec
No related branches found
No related tags found
No related merge requests found
...@@ -292,19 +292,6 @@ namespace Faust ...@@ -292,19 +292,6 @@ namespace Faust
delete [] colids2; delete [] colids2;
} }
template<typename FPP>
MatGeneric<FPP,GPU2>* MatSparse<FPP,GPU2>::Clone(const bool isOptimize /*default value=false*/) const
{
if (isOptimize)
{
Faust::MatDense<FPP,GPU2> M((*this));
return optimize(M,(*this));
} else
{
return new Faust::MatSparse<FPP,GPU2>((*this));
}
}
template<> template<>
MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>* MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>::clone(const int32_t dev_id/*=-1*/, const void* stream/*=nullptr*/) const MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>* MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>::clone(const int32_t dev_id/*=-1*/, const void* stream/*=nullptr*/) const
{ {
......
template<typename FPP> namespace Faust {
template<typename FPP2> template<typename FPP>
Faust::MatSparse<Real<FPP2>, GPU2> Faust::MatSparse<FPP,GPU2>::to_real() const MatGeneric<FPP,GPU2>* MatSparse<FPP,GPU2>::Clone(const bool isOptimize /*default value=false*/) const
{ {
//TODO: should be done directly in GPU memory in gpu_mod (optimization) if (isOptimize)
MatSparse<FPP, Cpu> cpu_smat; {
auto ffp2_cpu_smat = cpu_smat.template to_real<Real<FPP2>>(); Faust::MatDense<FPP,GPU2> M((*this));
MatSparse<Real<FPP2>, GPU2> ffp2_gpu_smat(ffp2_cpu_smat); return optimize(M,(*this));
return ffp2_gpu_smat; } else
{
return new Faust::MatSparse<FPP,GPU2>((*this));
}
}
template<typename FPP>
template<typename FPP2>
Faust::MatSparse<Real<FPP2>, GPU2> Faust::MatSparse<FPP,GPU2>::to_real() const
{
//TODO: should be done directly in GPU memory in gpu_mod (optimization)
MatSparse<FPP, Cpu> cpu_smat;
auto ffp2_cpu_smat = cpu_smat.template to_real<Real<FPP2>>();
MatSparse<Real<FPP2>, GPU2> ffp2_gpu_smat(ffp2_cpu_smat);
return ffp2_gpu_smat;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment