Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1b935afb authored by hhakim's avatar hhakim
Browse files

Add MatDense<FPP, GPU2>::setRand.

parent c5c6e5a9
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,7 @@ namespace Faust
void resize(const faust_unsigned_int nbRow){resize(nbRow,nbRow);}
void setOnes();
void setZeros();
void setRand();
void setEyes();
void setData(const FPP* data, int32_t nrows, int32_t ncols);
void transpose();
......
......@@ -17,4 +17,14 @@ namespace Faust
{
return *this;
}
template<typename FPP>
void MatDense<FPP,GPU2>::setRand()
{
//TODO: without CPU code? (cuRAND?)
MatDense<FPP, Cpu> cpu_m(this->getNbRow(), this->getNbCol());
cpu_m.setRand();
*this = MatDense<FPP, GPU2>(cpu_m);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment