Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
d871fdf5
There was an error fetching the commit references. Please try again later.
Commit
d871fdf5
authored
9 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Simplified benchmark.time() calls in case of cuBLAS
parent
ae90399d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/benchmarks/vector-operations.h
+14
-21
14 additions, 21 deletions
tests/benchmarks/vector-operations.h
with
14 additions
and
21 deletions
tests/benchmarks/vector-operations.h
+
14
−
21
View file @
d871fdf5
...
@@ -86,11 +86,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -86,11 +86,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"scalar multiplication"
,
2
*
datasetSize
);
benchmark
.
setOperation
(
"scalar multiplication"
,
2
*
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
multiplyHost
,
"CPU"
,
multiplyHost
,
"GPU"
,
multiplyCuda
"GPU"
,
multiplyCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
multiplyCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
multiplyCublas
);
#endif
#endif
);
auto
addVectorHost
=
[
&
]()
{
auto
addVectorHost
=
[
&
]()
{
...
@@ -111,11 +110,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -111,11 +110,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"vector addition"
,
3
*
datasetSize
);
benchmark
.
setOperation
(
"vector addition"
,
3
*
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
addVectorHost
,
"CPU"
,
addVectorHost
,
"GPU"
,
addVectorCuda
"GPU"
,
addVectorCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
addVectorCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
addVectorCublas
);
#endif
#endif
);
auto
maxHost
=
[
&
]()
{
auto
maxHost
=
[
&
]()
{
...
@@ -160,11 +158,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -160,11 +158,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"absMax"
,
datasetSize
);
benchmark
.
setOperation
(
"absMax"
,
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
absMaxHost
,
"CPU"
,
absMaxHost
,
"GPU"
,
absMaxCuda
"GPU"
,
absMaxCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
absMaxCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
absMaxCublas
);
#endif
#endif
);
auto
absMinHost
=
[
&
]()
{
auto
absMinHost
=
[
&
]()
{
...
@@ -185,11 +182,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -185,11 +182,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"absMin"
,
datasetSize
);
benchmark
.
setOperation
(
"absMin"
,
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
absMinHost
,
"CPU"
,
absMinHost
,
"GPU"
,
absMinCuda
"GPU"
,
absMinCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
absMinCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
absMinCublas
);
#endif
#endif
);
auto
sumHost
=
[
&
]()
{
auto
sumHost
=
[
&
]()
{
...
@@ -220,11 +216,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -220,11 +216,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"l1 norm"
,
datasetSize
);
benchmark
.
setOperation
(
"l1 norm"
,
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
l1normHost
,
"CPU"
,
l1normHost
,
"GPU"
,
l1normCuda
"GPU"
,
l1normCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
l1normCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
l1normCublas
);
#endif
#endif
);
auto
l2normHost
=
[
&
]()
{
auto
l2normHost
=
[
&
]()
{
...
@@ -243,11 +238,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -243,11 +238,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"l2 norm"
,
datasetSize
);
benchmark
.
setOperation
(
"l2 norm"
,
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
l2normHost
,
"CPU"
,
l2normHost
,
"GPU"
,
l2normCuda
"GPU"
,
l2normCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
l2normCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
l2normCublas
);
#endif
#endif
);
auto
l3normHost
=
[
&
]()
{
auto
l3normHost
=
[
&
]()
{
...
@@ -279,11 +273,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
...
@@ -279,11 +273,10 @@ benchmarkVectorOperations( Benchmark & benchmark,
benchmark
.
setOperation
(
"scalar product"
,
2
*
datasetSize
);
benchmark
.
setOperation
(
"scalar product"
,
2
*
datasetSize
);
benchmark
.
time
(
reset1
,
benchmark
.
time
(
reset1
,
"CPU"
,
scalarProductHost
,
"CPU"
,
scalarProductHost
,
"GPU"
,
scalarProductCuda
"GPU"
,
scalarProductCuda
);
#ifdef HAVE_CUBLAS
#ifdef HAVE_CUBLAS
,
"cuBLAS"
,
scalarProductCublas
benchmark
.
time
(
reset1
,
"cuBLAS"
,
scalarProductCublas
);
#endif
#endif
);
/*
/*
cout << "Benchmarking prefix-sum:" << endl;
cout << "Benchmarking prefix-sum:" << endl;
...
...
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