Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 154404b3 authored by hhakim's avatar hhakim
Browse files

Add GPU2 MatPerm new ctors.

parent d2ab8f18
Branches
Tags
No related merge requests found
...@@ -26,7 +26,7 @@ namespace Faust ...@@ -26,7 +26,7 @@ namespace Faust
{ {
} }
MatPerm(const MatPerm<FPP, GPU2>& bmat) MatPerm(const MatPerm<FPP, GPU2>& bmat) : MatPerm()
{ {
*this = bmat; *this = bmat;
} }
...@@ -42,6 +42,22 @@ namespace Faust ...@@ -42,6 +42,22 @@ namespace Faust
return *this; return *this;
} }
MatPerm(const MatSparse<FPP, GPU2> &factor) : MatPerm()
{
MatSparse<FPP, Cpu> Scpu;
factor.tocpu(Scpu);
MatPerm<FPP, GPU2> this_(Scpu);
*this = this_;
//TODO: do it without passing through CPU mem. and move the def in hpp
}
MatPerm(const MatPerm<FPP, Cpu>& bmat) : MatPerm(bmat.toMatSparse())
{
//TODO/ without conversion to MatSparse
}
MatDense<FPP, GPU2> multiply(const FPP* x); MatDense<FPP, GPU2> multiply(const FPP* x);
MatDense<FPP, GPU2> multiply(const FPP* A, int A_ncols); MatDense<FPP, GPU2> multiply(const FPP* A, int A_ncols);
MatDense<FPP, GPU2> multiply(MatDense<FPP,GPU2> &A); MatDense<FPP, GPU2> multiply(MatDense<FPP,GPU2> &A);
...@@ -77,6 +93,15 @@ namespace Faust ...@@ -77,6 +93,15 @@ namespace Faust
void multiply(MatDense<FPP, GPU2> &other, const char op_this); void multiply(MatDense<FPP, GPU2> &other, const char op_this);
void multiply(MatSparse<FPP, GPU2> &other, const char op_this); void multiply(MatSparse<FPP, GPU2> &other, const char op_this);
MatSparse<FPP, GPU2> toMatSparse() const; MatSparse<FPP, GPU2> toMatSparse() const;
static bool isPerm(const MatSparse<FPP, GPU2> &S, bool verify_ones=true)
{
//TODO: do it without copy in CPU mem and move def in hpp
MatSparse<FPP, Cpu> Scpu;
S.tocpu(Scpu);
return MatPerm<FPP, Cpu>::isPerm(Scpu, verify_ones);
}
~MatPerm(); ~MatPerm();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment