Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9568ff61 authored by hhakim's avatar hhakim
Browse files

Update Transform<FPP, GPU2>::to_cpu for MatBSR<FPP, GPU2> and update to gpu_mod@1ec80777.

parent 72bc1779
No related branches found
No related tags found
No related merge requests found
Subproject commit 58c653f4adbebc386ae2ff3b5b21e582b6fb647c Subproject commit 1ec807770f677154c026b8d1679f86f089ca937f
...@@ -608,23 +608,28 @@ void Faust::Transform<@FAUST_SCALAR_FOR_GM@,GPU2>::get_fact(const faust_unsigned ...@@ -608,23 +608,28 @@ void Faust::Transform<@FAUST_SCALAR_FOR_GM@,GPU2>::get_fact(const faust_unsigned
MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>* gpu_mdense = nullptr; MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>* gpu_mdense = nullptr;
MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>* gpu_msparse = nullptr; MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>* gpu_msparse = nullptr;
MatDense<@FAUST_SCALAR_FOR_GM@, Cpu>* cpu_mdense = nullptr; MatBSR<@FAUST_SCALAR_FOR_GM@, GPU2>* gpu_mbsr = nullptr;
MatSparse<@FAUST_SCALAR_FOR_GM@, Cpu>* cpu_msparse = nullptr;
for(auto gpu_mat: data) for(auto gpu_mat: data)
{ {
if(gpu_mdense = dynamic_cast<MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>*>(gpu_mat)) if(gpu_mdense = dynamic_cast<MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>*>(gpu_mat))
{ {
cpu_mdense = new MatDense<@FAUST_SCALAR_FOR_GM@,Cpu>(gpu_mdense->getNbRow(), gpu_mdense->getNbCol()); auto cpu_mdense = new MatDense<@FAUST_SCALAR_FOR_GM@,Cpu>(gpu_mdense->getNbRow(), gpu_mdense->getNbCol());
gpu_mdense->tocpu(*cpu_mdense); gpu_mdense->tocpu(*cpu_mdense);
cpu_transf.push_back(cpu_mdense, false, false); cpu_transf.push_back(cpu_mdense, false, false);
} }
else if(gpu_msparse = dynamic_cast<MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>*>(gpu_mat)) else if(gpu_msparse = dynamic_cast<MatSparse<@FAUST_SCALAR_FOR_GM@, GPU2>*>(gpu_mat))
{ {
cpu_msparse = new MatSparse<@FAUST_SCALAR_FOR_GM@,Cpu>(); auto cpu_msparse = new MatSparse<@FAUST_SCALAR_FOR_GM@,Cpu>();
cpu_msparse->resize(gpu_msparse->getNonZeros(), gpu_msparse->getNbRow(), gpu_msparse->getNbCol()); cpu_msparse->resize(gpu_msparse->getNonZeros(), gpu_msparse->getNbRow(), gpu_msparse->getNbCol());
gpu_msparse->tocpu(*cpu_msparse); gpu_msparse->tocpu(*cpu_msparse);
cpu_transf.push_back(cpu_msparse, false, false, false); cpu_transf.push_back(cpu_msparse, false, false, false);
} }
else if(gpu_mbsr = dynamic_cast<MatBSR<@FAUST_SCALAR_FOR_GM@, GPU2>*>(gpu_mat))
{
auto cpu_mbsr = new MatBSR<@FAUST_SCALAR_FOR_GM@,Cpu>();
gpu_mbsr->tocpu(*cpu_mbsr);
cpu_transf.push_back(cpu_mbsr, false, false, false);
}
else else
throw std::runtime_error("Invalid matrix pointer"); throw std::runtime_error("Invalid matrix pointer");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment