Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 193e9020 authored by hhakim's avatar hhakim
Browse files

Fix #162 (missing getNBytes() functions in GPU2 backend.)

parent 8728ba12
No related branches found
No related tags found
No related merge requests found
...@@ -688,4 +688,10 @@ namespace Faust ...@@ -688,4 +688,10 @@ namespace Faust
} }
} }
template<>
size_t MatDense<FSFG,GPU2>::getNBytes() const
{
return this->getNbCol()*this->getNbRow()*sizeof(FSFG);
}
}; };
...@@ -118,6 +118,7 @@ namespace Faust ...@@ -118,6 +118,7 @@ namespace Faust
void Display() const; void Display() const;
std::string to_string(const bool transpose=false, const bool displaying_small_mat_elts=false) const; std::string to_string(const bool transpose=false, const bool displaying_small_mat_elts=false) const;
MatType getType() const; MatType getType() const;
size_t getNBytes() const;
int32_t getNbRow() const; int32_t getNbRow() const;
int32_t getNbCol() const; int32_t getNbCol() const;
faust_unsigned_int getNonZeros() const; faust_unsigned_int getNonZeros() const;
......
...@@ -22,6 +22,7 @@ namespace Faust ...@@ -22,6 +22,7 @@ namespace Faust
bool is_identity; bool is_identity;
bool is_zeros; bool is_zeros;
public: public:
virtual size_t getNBytes() const=0;
virtual MatType getType() const=0; virtual MatType getType() const=0;
virtual int32_t getNbRow() const=0; virtual int32_t getNbRow() const=0;
virtual int32_t getNbCol() const=0; virtual int32_t getNbCol() const=0;
......
...@@ -449,4 +449,9 @@ namespace Faust ...@@ -449,4 +449,9 @@ namespace Faust
vec.gpu_mat = gpu_dmat; vec.gpu_mat = gpu_dmat;
} }
template<>
size_t Faust::MatSparse<FSFG,GPU2>::getNBytes() const
{
return this->getNonZeros()*(sizeof(FSFG)+sizeof(int))+(this->getNbRow()+1)*sizeof(int);
}
}; };
...@@ -83,6 +83,7 @@ namespace Faust ...@@ -83,6 +83,7 @@ namespace Faust
void move(const int32_t dev_id=-1, const void* stream=nullptr); void move(const int32_t dev_id=-1, const void* stream=nullptr);
int32_t getNbRow() const; int32_t getNbRow() const;
int32_t getNbCol() const; int32_t getNbCol() const;
size_t getNBytes() const;
faust_unsigned_int getNonZeros() const; faust_unsigned_int getNonZeros() const;
int32_t getDevice() const; int32_t getDevice() const;
void Display() const; void Display() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment