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
fb1474d3
There was an error fetching the commit references. Please try again later.
Commit
fb1474d3
authored
9 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Added benchmarks for lpNorm to tnl-cuda-benchmarks
parent
d2514e28
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/tnl-cuda-benchmarks.h
+30
-0
30 additions, 0 deletions
tests/benchmarks/tnl-cuda-benchmarks.h
with
30 additions
and
0 deletions
tests/benchmarks/tnl-cuda-benchmarks.h
+
30
−
0
View file @
fb1474d3
...
@@ -101,6 +101,7 @@ int main( int argc, char* argv[] )
...
@@ -101,6 +101,7 @@ int main( int argc, char* argv[] )
*/
*/
Real
resultHost
,
resultDevice
,
timeHost
,
timeDevice
;
Real
resultHost
,
resultDevice
,
timeHost
,
timeDevice
;
cout
<<
"Benchmarking scalar product on CPU: "
;
cout
<<
"Benchmarking scalar product on CPU: "
;
timer
.
reset
();
timer
.
reset
();
timer
.
start
();
timer
.
start
();
...
@@ -147,6 +148,35 @@ int main( int argc, char* argv[] )
...
@@ -147,6 +148,35 @@ int main( int argc, char* argv[] )
#endif
#endif
#endif
#endif
cout
<<
"Benchmarking lpNorm on CPU: "
;
timer
.
reset
();
timer
.
start
();
for
(
int
i
=
0
;
i
<
loops
;
i
++
)
resultHost
=
hostVector
.
lpNorm
(
2
.
0
);
timer
.
stop
();
timeHost
=
timer
.
getTime
();
bandwidth
=
2
*
datasetSize
/
timer
.
getTime
();
cout
<<
"bandwidth: "
<<
bandwidth
<<
" GB/sec, time: "
<<
timer
.
getTime
()
<<
" sec."
<<
endl
;
cout
<<
"Benchmarking lpNorm on GPU: "
;
timer
.
reset
();
timer
.
start
();
for
(
int
i
=
0
;
i
<
loops
;
i
++
)
resultDevice
=
deviceVector
.
lpNorm
(
2
.
0
);
timer
.
stop
();
timeDevice
=
timer
.
getTime
();
bandwidth
=
2
*
datasetSize
/
timer
.
getTime
();
cout
<<
"bandwidth: "
<<
bandwidth
<<
" GB/sec, time: "
<<
timer
.
getTime
()
<<
" sec."
<<
endl
;
cout
<<
"CPU/GPU speedup: "
<<
timeHost
/
timeDevice
<<
endl
;
if
(
resultHost
!=
resultDevice
)
{
cerr
<<
"Error. "
<<
resultHost
<<
" != "
<<
resultDevice
<<
endl
;
//return EXIT_FAILURE;
}
cout
<<
"Benchmarking prefix-sum on CPU: "
;
cout
<<
"Benchmarking prefix-sum on CPU: "
;
timer
.
reset
();
timer
.
reset
();
timer
.
start
();
timer
.
start
();
...
...
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