Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
faust group
faust
Commits
3f1dcf52
Commit
3f1dcf52
authored
2 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add GPU2 MatButterfly getNbRow/Col/getType and unit tests.
parent
e7821d10
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
misc/test/src/C++/test_matbutterfly_gpu.cpp.in
+18
-0
18 additions, 0 deletions
misc/test/src/C++/test_matbutterfly_gpu.cpp.in
src/faust_linear_operator/GPU2/faust_MatButterfly_gpu.h
+21
-21
21 additions, 21 deletions
src/faust_linear_operator/GPU2/faust_MatButterfly_gpu.h
with
39 additions
and
21 deletions
misc/test/src/C++/test_matbutterfly_gpu.cpp.in
+
18
−
0
View file @
3f1dcf52
...
...
@@ -38,6 +38,22 @@ void test_get_nbytes(MatButterfly<FPP, GPU2> &gpu_bm, MatButterfly<FPP, Cpu> &cp
cout << "OK" << endl;
}
void test_get_nbrowcol(MatButterfly<FPP, GPU2> &gpu_bm, MatButterfly<FPP, Cpu> &cpu_bm)
{
cout << "Test MatButterfly<FPP, GPU2>::getNbRow/Col()" << endl;
assert(gpu_bm.getNbRow() == cpu_bm.getNbRow());
assert(gpu_bm.getNbCol() == cpu_bm.getNbCol());
cout << "OK" << endl;
}
void test_get_type(MatButterfly<FPP, GPU2> &gpu_bm, MatButterfly<FPP, Cpu> &cpu_bm)
{
cout << "Test MatButterfly<FPP, GPU2>::getType()" << endl;
assert(gpu_bm.getType() == cpu_bm.getType());
assert(gpu_bm.getType() == Butterfly);
cout << "OK" << endl;
}
int main(int argc, char** argv)
{
Faust::enable_gpu_mod();
...
...
@@ -55,6 +71,8 @@ int main(int argc, char** argv)
MatButterfly<FPP, GPU2> gpu_bm(spButterflyMat, /* level */ 0);
test_mul_matdense(gpu_bm, cpu_bm);
test_get_nbytes(gpu_bm, cpu_bm);
test_get_nbrowcol(gpu_bm, cpu_bm);
test_get_type(gpu_bm, cpu_bm);
return 0;
}
This diff is collapsed.
Click to expand it.
src/faust_linear_operator/GPU2/faust_MatButterfly_gpu.h
+
21
−
21
View file @
3f1dcf52
...
...
@@ -23,27 +23,27 @@ namespace Faust
MatButterfly
(
const
MatSparse
<
FPP
,
Cpu
>
&
factor
,
int
level
);
void
setZeros
();
size_t
getNBytes
()
const
;
/*
MatType getType() const
;
int32_t getNbRow() const
;
int32_t getNbCol() const
;
MatGeneric<FPP,GPU2>* clone(const int32_t dev_id=-1, const void* stream=nullptr) const;
MatGeneric<FPP,GPU2>* Clone(const bool isOptimize=false) const;
void* get_gpu_mat_ptr() const;
faust_unsigned_int getNonZeros() const;
void transpose();
void conjugate();
void adjoint();
//! \brief Returns a sub-group of rows of this matrix as the same type of matrix
MatGeneric<FPP,GPU2>* get_rows(faust_unsigned_int row_id_start, faust_unsigned_int num_rows) const;
//! \brief Returns a sub-group of rows of this matrix as the same type of matrix
MatGeneric<FPP,GPU2>* get_rows(faust_unsigned_int* row_ids, faust_unsigned_int num_rows) const;
//! \brief Returns a sub-group of columns of this matrix as the same type of matrix
Faust::MatGeneric<FPP,GPU2>* get_cols(faust_unsigned_int col_id_start, faust_unsigned_int num_cols) const;
//! \brief Returns a sub-group of columns of this matrix as the same type of matrix
Faust::MatGeneric<FPP,GPU2>* get_cols(faust_unsigned_int* col_ids, faust_unsigned_int num_cols) const;
void Display() const;
Real<FPP> norm() const;*/
MatType
getType
()
const
{
return
Butterfly
;}
//TODO: move def in hpp
int32_t
getNbRow
()
const
{
return
d1
.
size
();}
//TODO: move def in hpp
int32_t
getNbCol
()
const
{
return
d1
.
size
();}
//TODO: move def in hpp
/*
MatGeneric<FPP,GPU2>* clone(const int32_t dev_id=-1, const void* stream=nullptr) const;
MatGeneric<FPP,GPU2>* Clone(const bool isOptimize=false) const;
void* get_gpu_mat_ptr() const;
faust_unsigned_int getNonZeros() const;
void transpose();
void conjugate();
void adjoint();
//! \brief Returns a sub-group of rows of this matrix as the same type of matrix
MatGeneric<FPP,GPU2>* get_rows(faust_unsigned_int row_id_start, faust_unsigned_int num_rows) const;
//! \brief Returns a sub-group of rows of this matrix as the same type of matrix
MatGeneric<FPP,GPU2>* get_rows(faust_unsigned_int* row_ids, faust_unsigned_int num_rows) const;
//! \brief Returns a sub-group of columns of this matrix as the same type of matrix
Faust::MatGeneric<FPP,GPU2>* get_cols(faust_unsigned_int col_id_start, faust_unsigned_int num_cols) const;
//! \brief Returns a sub-group of columns of this matrix as the same type of matrix
Faust::MatGeneric<FPP,GPU2>* get_cols(faust_unsigned_int* col_ids, faust_unsigned_int num_cols) const;
void Display() const;
Real<FPP> norm() const;*/
void
multiply
(
MatDense
<
FPP
,
GPU2
>
&
other
,
const
char
op_this
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment