Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7c21e3b2 authored by hhakim's avatar hhakim
Browse files

Add support of GPU float type to matfaust.fact.palm4msa.

parent b3ee387b
Branches
Tags
No related merge requests found
......@@ -91,8 +91,12 @@ function [F,lambda] = palm4msa(M, p, varargin)
elseif(backend == 2020)
% no need to keep the ParamsPalm4MSA extracted/generated cell for init_facts
% mex_params = rmfield(mex_params, 'init_facts')
dev = 'cpu';
if(gpu)
dev = 'gpu';
end
if(isreal(M))
init_faust = matfaust.Faust(p.init_facts, 'dtype', dtype);
init_faust = matfaust.Faust(p.init_facts, 'dtype', dtype, 'dev', dev);
if(gpu)
if(is_float)
[lambda, core_obj] = mexPALM4MSA2020_gpu2RealFloat(mex_params, get_handle(init_faust));
......@@ -107,7 +111,7 @@ function [F,lambda] = palm4msa(M, p, varargin)
end
end
else
init_faust = complex(matfaust.Faust(p.init_facts));
init_faust = complex(matfaust.Faust(p.init_facts, 'dev', dev));
if(gpu)
[lambda, core_obj] = mexPALM4MSA2020_gpu2Cplx(mex_params, get_handle(init_faust));
else
......
......@@ -139,9 +139,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
}
else if(cons->is_constraint_parameter_real<SCALAR,GPU2>())
{
auto c = dynamic_cast<const Faust::ConstraintFPP<SCALAR,Cpu>*>(cons);
// c->Display();
noconst_cons.push_back(new Faust::ConstraintFPP<SCALAR, GPU2>(c->get_constraint_type(), c->get_parameter(), c->get_rows(), c->get_cols()));
auto c = dynamic_cast<const Faust::ConstraintFPP<SCALAR,Cpu, FPP2>*>(cons);
noconst_cons.push_back(new Faust::ConstraintFPP<SCALAR, GPU2, FPP2>(c->get_constraint_type(), c->get_parameter(), c->get_rows(), c->get_cols()));
// noconst_cons[0]->Display();
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment