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
0031f809
There was an error fetching the commit references. Please try again later.
Commit
0031f809
authored
9 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Basic CUDA benchmark was added.
parent
41091991
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/benchmarks/CMakeLists.txt
+10
-1
10 additions, 1 deletion
tests/benchmarks/CMakeLists.txt
tests/benchmarks/tnl-cuda-benchmarks.cu
+52
-0
52 additions, 0 deletions
tests/benchmarks/tnl-cuda-benchmarks.cu
tests/benchmarks/tnl-cuda-benchmarks.h
+0
-0
0 additions, 0 deletions
tests/benchmarks/tnl-cuda-benchmarks.h
with
62 additions
and
1 deletion
tests/benchmarks/CMakeLists.txt
+
10
−
1
View file @
0031f809
ADD_SUBDIRECTORY
(
share
)
ADD_SUBDIRECTORY
(
share
)
IF
(
BUILD_CUDA
)
IF
(
BUILD_CUDA
)
CUDA_ADD_EXECUTABLE
(
tnl-cuda-benchmarks
${
debugExt
}
tnl-cuda-benchmarks.cu
OPTIONS
${
CUDA_ADD_EXECUTABLE_OPTIONS
}
)
SET_TARGET_PROPERTIES
(
tnl-cuda-benchmarks
${
debugExt
}
PROPERTIES CUDA_COMPILE_FLAGS
"
${
CXX_OPTIMIZE_FLAGS
}
"
)
TARGET_LINK_LIBRARIES
(
tnl-cuda-benchmarks
${
debugExt
}
tnl
${
debugExt
}
-
${
tnlVersion
}
${
CUSPARSE_LIBRARY
}
)
CUDA_ADD_EXECUTABLE
(
tnl-benchmark-spmv
${
debugExt
}
tnl-benchmark-spmv.cu
CUDA_ADD_EXECUTABLE
(
tnl-benchmark-spmv
${
debugExt
}
tnl-benchmark-spmv.cu
OPTIONS
${
CUDA_ADD_EXECUTABLE_OPTIONS
}
)
OPTIONS
${
CUDA_ADD_EXECUTABLE_OPTIONS
}
)
SET_TARGET_PROPERTIES
(
tnl-benchmark-spmv
${
debugExt
}
PROPERTIES CUDA_COMPILE_FLAGS
"
${
CXX_OPTIMIZE_FLAGS
}
"
)
SET_TARGET_PROPERTIES
(
tnl-benchmark-spmv
${
debugExt
}
PROPERTIES CUDA_COMPILE_FLAGS
"
${
CXX_OPTIMIZE_FLAGS
}
"
)
...
@@ -18,7 +22,12 @@ ELSE()
...
@@ -18,7 +22,12 @@ ELSE()
ENDIF
()
ENDIF
()
TARGET_LINK_LIBRARIES
(
tnl-benchmark-linear-solvers
${
debugExt
}
tnl
${
debugExt
}
-
${
tnlVersion
}
)
TARGET_LINK_LIBRARIES
(
tnl-benchmark-linear-solvers
${
debugExt
}
tnl
${
debugExt
}
-
${
tnlVersion
}
)
if
(
BUILD_CUDA
)
INSTALL
(
TARGETS tnl-cuda-benchmarks
${
debugExt
}
RUNTIME DESTINATION bin
)
endif
()
INSTALL
(
TARGETS tnl-benchmark-spmv
${
debugExt
}
INSTALL
(
TARGETS tnl-benchmark-spmv
${
debugExt
}
tnl-benchmark-linear-solvers
${
debugExt
}
tnl-benchmark-linear-solvers
${
debugExt
}
RUNTIME DESTINATION bin
)
RUNTIME DESTINATION bin
)
...
...
This diff is collapsed.
Click to expand it.
tests/benchmarks/tnl-benchmarks.c
pp
→
tests/benchmarks/tnl-
cuda-
benchmarks.c
u
+
52
−
0
View file @
0031f809
/***************************************************************************
/***************************************************************************
tnl-benchmarks.c
pp
- description
tnl-
cuda-
benchmarks.c
u
- description
-------------------
-------------------
begin :
Nov
2
5
, 201
0
begin :
May
2
8
, 201
5
copyright : (C) 201
0
by Tomas Oberhuber
copyright : (C) 201
5
by Tomas Oberhuber
email : tomas.oberhuber@fjfi.cvut.cz
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
***************************************************************************/
...
@@ -15,43 +15,38 @@
...
@@ -15,43 +15,38 @@
* *
* *
***************************************************************************/
***************************************************************************/
#include
<core/vectors/tnlVector.h>
#include
<core/vectors/tnlVectorHost.h>
#include
<core/tnlTimerRT.h>
#include
<core/vectors/tnlVectorCUDA.h>
#include
<tnl-benchmarks.h>
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
int
argc
,
char
*
argv
[]
)
{
{
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
cout
<<
"Benchmarking memory bandwidth when transfering int ..."
<<
endl
;
const
int
size
=
1
<<
22
;
double
host_to_host_band_width
;
double
host_to_device_band_width
;
double
device_to_host_band_width
;
double
device_to_device_band_width
;
transferBenchmark
<
int
>
(
size
,
tnlTimerRT
timer
;
host_to_host_band_width
,
const
double
oneGB
=
1024.0
*
1024.0
*
1024.0
;
host_to_device_band_width
,
device_to_host_band_width
,
device_to_device_band_width
);
cout
<<
"Benchmarking memory bandwidth when transfering int ..."
<<
endl
;
cout
<<
"Benchmarking reduction of int ..."
<<
endl
;
const
int
size
=
1
<<
22
;
for
(
int
i
=
0
;
i
<=
6
;
i
++
)
reductionBenchmark
<
int
>
(
size
,
i
);
tnlVector
<
int
,
tnlHost
>
hostVector
;
tnlVector
<
int
,
tnlCuda
>
deviceVector
;
hostVector
.
setSize
(
size
);
deviceVector
.
setSize
(
size
);
cout
<<
"Benchmarking reduction of float ..."
<<
endl
;
hostVector
.
setValue
(
1.0
);
for
(
int
i
=
0
;
i
<=
6
;
i
++
)
deviceVector
.
setValue
(
0.0
);
reductionBenchmark
<
float
>
(
size
,
i
);
timer
.
reset
();
timer
.
start
();
deviceVector
=
hostVector
;
timer
.
stop
();
double
bandwidth
=
(
double
)
(
size
)
*
sizeof
(
int
)
/
timer
.
getTime
()
/
oneGB
;
cout
<<
"Benchmarking reduction of double ..."
<<
endl
;
cout
<<
bandwidth
<<
" GB/sec."
<<
endl
;
for
(
int
i
=
0
;
i
<=
6
;
i
++
)
reductionBenchmark
<
double
>
(
size
/
2
,
i
);
#endif
#endif
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
This diff is collapsed.
Click to expand it.
tests/benchmarks/tnl-benchmarks.h
→
tests/benchmarks/tnl-
cuda-
benchmarks.h
+
0
−
0
View file @
0031f809
File moved
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