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
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
ae0b908e
Commit
ae0b908e
authored
4 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Update pure gpu splin, spcol, sp proxs tests (prog. arguments and output).
parent
51b659dc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
misc/test/src/C++/test_prox_sp_gpu.cpp.in
+39
-6
39 additions, 6 deletions
misc/test/src/C++/test_prox_sp_gpu.cpp.in
misc/test/src/C++/test_prox_splin_spcol_gpu.cpp.in
+14
-8
14 additions, 8 deletions
misc/test/src/C++/test_prox_splin_spcol_gpu.cpp.in
with
53 additions
and
14 deletions
misc/test/src/C++/test_prox_sp_gpu.cpp.in
+
39
−
6
View file @
ae0b908e
...
...
@@ -2,6 +2,8 @@
#include "faust_MatDense_gpu.h"
#include "faust_prox_gpu.h"
#include <iostream>
//#include "faust_init_from_matio_params.h"
//#include "faust_init_from_matio_core.h"
/** \brief unitary test for MatDense conjugate
*/
...
...
@@ -29,10 +31,20 @@ int main(int argc, char* argv[])
faust_unsigned_int dim1 = 204;
faust_unsigned_int dim2 = 204;
// auto MatrixFilename = "D.mat";
// Faust::MatDense<FPP,Cpu> D;
// init_faust_mat_from_matio(D,MatrixFilename,"D");
auto num_its =
3000
0;
auto num_its =
6
0;
auto k = dim1/10;
auto k = 1632;
char* str_k = getenv("K");
if(str_k)
{
k = std::atoi(str_k);
}
if(argc > 1)
{
...
...
@@ -47,10 +59,19 @@ int main(int argc, char* argv[])
}
}
std::cout << "M nrows: " << dim1 << std::endl;
std::cout << "M ncols: " << dim2 << std::endl;
cout << "k:" << k << endl;
std::cout << "benchmark num_its: " << num_its << std::endl;
MatDense<FPP,Cpu>* M;
MatDense<FPP,GPU2> M1, M2;
M = MatDense<FPP,Cpu>::randMat(dim1,dim2);
*M *= FPP(100);
// M = &D;
// M->Display();
// *M *= FPP(100);
M1 = *M;
M2 = *M;
...
...
@@ -61,17 +82,28 @@ int main(int argc, char* argv[])
for(int i=0; i < num_its; i++)
{
pure_gpu_prox_start = std::chrono::steady_clock::now();
prox_sp(M1, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ true);
prox_sp(M1, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ true);
pure_gpu_prox_end = std::chrono::steady_clock::now();
pure_gpu_prox_dur += pure_gpu_prox_end-pure_gpu_prox_start;
gpu_cpu_rt_prox_start = std::chrono::steady_clock::now();
prox_sp(M2, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ false);
prox_sp(M2, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ false);
gpu_cpu_rt_prox_end = std::chrono::steady_clock::now();
gpu_cpu_rt_prox_dur += gpu_cpu_rt_prox_end-gpu_cpu_rt_prox_start;
assert(M1.getNonZeros() == M2.getNonZeros());
M1 -= M2;
auto err = M1.norm();
// cout << "err:" << err << endl;
#ifdef DEBUG
if(i == 0)
{
cout << "M1 norm:" << M1.norm() << endl;
M1.Display();
cout << "M2 norm:" << M2.norm() << endl;
M2.Display();
cout << "err:" << err << endl;
}
#endif
assert(err < 1e-6);
M1 = *M;
M2 = *M;
...
...
@@ -79,6 +111,7 @@ int main(int argc, char* argv[])
cout << "pure gpu prox time:" << pure_gpu_prox_dur.count() << endl;
cout << "gpu2cpu round-trip prox time:" << gpu_cpu_rt_prox_dur.count() << endl;
cout << "pure gpu speedup: " << gpu_cpu_rt_prox_dur.count()/pure_gpu_prox_dur.count() << endl;
return 0;
}
This diff is collapsed.
Click to expand it.
misc/test/src/C++/test_prox_splin_spcol_gpu.cpp.in
+
14
−
8
View file @
ae0b908e
...
...
@@ -17,13 +17,13 @@ int main(int argc, char* argv[])
{
Faust::enable_gpu_mod();
faust_unsigned_int dim1 = 204;
faust_unsigned_int dim2 =
204
;
faust_unsigned_int dim2 =
8193
;
auto num_its =
3000
0;
auto num_its =
27
0;
int32_t k =
dim1/
10;
int32_t k = 10;
int row_or_col =
0
; //
row
by deft
int row_or_col =
1
; //
col
by deft
if(argc > 1)
{
...
...
@@ -46,6 +46,11 @@ int main(int argc, char* argv[])
}
}
std::cout << "M nrows: " << dim1 << std::endl;
std::cout << "M ncols: " << dim2 << std::endl;
std::cout << (row_or_col==1?"prox_spcol":"prox_splin") << " k: " << k << std::endl;
std::cout << "benchmark num_its: " << num_its << std::endl;
MatDense<FPP,Cpu>* M;
MatDense<FPP,GPU2> M1, M2;
M = MatDense<FPP,Cpu>::randMat(dim1,dim2);
...
...
@@ -61,17 +66,17 @@ int main(int argc, char* argv[])
{
pure_gpu_prox_start = std::chrono::steady_clock::now();
if(row_or_col)
prox_spcol(M1, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ true);
prox_spcol(M1, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ true);
else
prox_splin(M1, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ true);
prox_splin(M1, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ true);
pure_gpu_prox_end = std::chrono::steady_clock::now();
pure_gpu_prox_dur += pure_gpu_prox_end-pure_gpu_prox_start;
gpu_cpu_rt_prox_start = std::chrono::steady_clock::now();
if(row_or_col)
prox_spcol(M2, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ false);
prox_spcol(M2, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ false);
else
prox_splin(M2, k, /* normalized */
fals
e, /* pos*/ false, /* pure_gpu */ false);
prox_splin(M2, k, /* normalized */
tru
e, /* pos*/ false, /* pure_gpu */ false);
gpu_cpu_rt_prox_end = std::chrono::steady_clock::now();
gpu_cpu_rt_prox_dur += gpu_cpu_rt_prox_end-gpu_cpu_rt_prox_start;
M1 -= M2;
...
...
@@ -84,6 +89,7 @@ int main(int argc, char* argv[])
cout << "pure gpu prox time:" << pure_gpu_prox_dur.count() << endl;
cout << "gpu2cpu round-trip prox time:" << gpu_cpu_rt_prox_dur.count() << endl;
cout << "pure gpu speedup: " << gpu_cpu_rt_prox_dur.count()/pure_gpu_prox_dur.count() << endl;
return 0;
}
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