Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 69d6c949 authored by hhakim's avatar hhakim
Browse files

Implement MatSparse<GPU2>::real, updating to gpu_mod@748e3c93.

parent 6698f877
No related branches found
No related tags found
No related merge requests found
Subproject commit b98b78f39270ef4eb03b48c5c9fbab563648a072
Subproject commit 748e3c939089f7b4d0d81cdd618758698762297c
......@@ -503,4 +503,15 @@ namespace Faust
{
return this->getNonZeros()*(sizeof(FSFG)+sizeof(int))+(this->getNbRow()+1)*sizeof(int);
}
template<>
void Faust::MatSparse<@FAUST_SCALAR_FOR_GM@,GPU2>::real(Faust::MatSparse<Real<@FAUST_SCALAR_FOR_GM@>, GPU2>& real_mat) const
{
auto spm_funcs = GPUModHandler::get_singleton()->spm_funcs(@FAUST_SCALAR_FOR_GM@(0));
auto real_gpu_mat = spm_funcs->real(gpu_mat);
if(real_mat.gpu_mat != nullptr)
spm_funcs->free(real_mat.gpu_mat);
real_mat.gpu_mat = real_gpu_mat;
}
};
......@@ -18,6 +18,7 @@ namespace Faust
friend Transform<FPP,GPU2>; // need to access to get_gpu_mat_ptr
friend MatDense<FPP,GPU2>;
friend MatSparse<std::complex<double>,GPU2>; // TODO limit to real function
public:
/** \brief Inits from CPU buffers.
*
......@@ -82,6 +83,7 @@ namespace Faust
void set(int32_t nnz, int32_t nrows, int32_t ncols, FPP* values, size_t* rowptr, size_t* colids);
MatSparse<FPP, GPU2>* clone(const int32_t dev_id=-1, const void* stream=nullptr) const;
MatGeneric<FPP,GPU2>* Clone(const bool isOptimize=false) const;
void real(MatSparse<Real<FPP>, GPU2>& real_mat) const;
void move(const int32_t dev_id=-1, const void* stream=nullptr);
int32_t getNbRow() const;
int32_t getNbCol() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment