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
7a296338
Commit
7a296338
authored
3 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add GPU test for cpp dynprog_multiply.
parent
032d9dec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
misc/test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
misc/test/CMakeLists.txt
misc/test/src/C++/test_dynprog_mul_gpu.cpp.in
+38
-0
38 additions, 0 deletions
misc/test/src/C++/test_dynprog_mul_gpu.cpp.in
with
39 additions
and
1 deletion
misc/test/CMakeLists.txt
+
1
−
1
View file @
7a296338
...
...
@@ -200,7 +200,7 @@ if(MATIO_LIB_FILE AND MATIO_INC_DIR AND BUILD_READ_MAT_FILE AND NOT NOCPPTESTS)
endif
()
if
(
USE_GPU_MOD
)
list
(
APPEND tests faust_gpu_mod hierarchical2020_gpu test_matdense_gpu_mod test_matsparse_gpu_mod test_matbsr_gpu_mod test_transform_gpu_mod test_vect_gpu_mod test_transform_helper_gpu_mod hierarchical2020_gpu2 hierarchical2020Hadamard_gpu2 MEG_factorization test_prox_sp_gpu test_prox_splin_spcol_gpu
)
list
(
APPEND tests faust_gpu_mod hierarchical2020_gpu test_matdense_gpu_mod test_matsparse_gpu_mod test_matbsr_gpu_mod test_transform_gpu_mod test_vect_gpu_mod test_transform_helper_gpu_mod hierarchical2020_gpu2 hierarchical2020Hadamard_gpu2 MEG_factorization test_prox_sp_gpu test_prox_splin_spcol_gpu
test_dynprog_mul_gpu
)
endif
()
foreach
(
TEST_FPP float double complex<float> complex<double>
)
...
...
This diff is collapsed.
Click to expand it.
misc/test/src/C++/test_dynprog_mul_gpu.cpp.in
0 → 100644
+
38
−
0
View file @
7a296338
#include "faust_TransformHelper.h"
#include "faust_TransformHelper_gpu.h"
#include "faust_prod_opt_gen.h"
#include <cstdlib>
#include <ctime>
typedef @TEST_FPP@ FPP;
using namespace Faust;
int main()
{
unsigned int min_num_factors = 2;
unsigned int max_num_factors = 10;
unsigned int min_dim_size = 10;
unsigned int max_dim_size = 1024;
float density = .5f;
bool per_row = true;
auto F = TransformHelper<FPP, GPU2>::randFaust(MIXED, min_num_factors, max_num_factors, min_dim_size, max_dim_size, density, per_row);
//TODO: fix always two factors
F->display();
// convert the Faust to a vector of matrices
std::vector<MatGeneric<FPP, GPU2>*> data;
for(auto f: *F)
{
f->Display();
data.push_back(f);
}
auto res_mat = dynprog_multiply(data);
auto ref_mat = F->get_product();
auto test_mat = ref_mat;
test_mat -= res_mat;
auto re = test_mat.norm() / ref_mat.norm();
std::cout << "rel. err of test_mat vs ref_mat: " << re << std::endl;
assert(re < 1e-4);
return EXIT_SUCCESS;
}
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