Skip to content

Commit

Permalink
Refactor babelstream and use catch2 benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetyusufoglu committed Jun 28, 2024
1 parent bc083db commit 6ffd219
Show file tree
Hide file tree
Showing 7 changed files with 466 additions and 941 deletions.
32 changes: 27 additions & 5 deletions benchmarks/babelstream/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,31 @@ if(NOT TARGET alpaka::alpaka)
endif()
endif()

alpaka_add_executable(${PROJECT_NAME} src/main.cpp src/Stream.h src/AlpakaStream.cpp src/AlpakaStream.h)
target_compile_definitions(${PROJECT_NAME} PUBLIC ALPAKA)
target_link_libraries(${PROJECT_NAME} PUBLIC alpaka::alpaka)
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER benchmarks)

# add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME})
set(_TARGET_NAME "babelstream")
append_recursive_files_add_to_src_group("src/" "src/" "cpp" _FILES_SOURCE)

alpaka_add_executable(
${_TARGET_NAME}
${_FILES_SOURCE})

target_include_directories(
${_TARGET_NAME}
PRIVATE "src")

target_link_libraries(
${_TARGET_NAME}
PRIVATE common)

# alpaka_add_executable(${PROJECT_NAME} src/main.cpp src/Stream.h src/AlpakaStream.cpp src/AlpakaStream.h)
# target_compile_definitions(${PROJECT_NAME} PUBLIC ALPAKA)
# target_link_libraries(${PROJECT_NAME} PUBLIC alpaka::alpaka)
# set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER benchmarks)

if(alpaka_CI)
# To prevent timeout, the number of samples needs to be limited. In the catch2 benchmarking; the code is run samples x iterations times.
add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME} ${_alpaka_TEST_OPTIONS} --benchmark-samples 2)
else()
# For a normal benchmark test, number of samples should be equal to the default value.
add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME})
endif()
231 changes: 0 additions & 231 deletions benchmarks/babelstream/src/AlpakaStream.cpp

This file was deleted.

63 changes: 0 additions & 63 deletions benchmarks/babelstream/src/AlpakaStream.h

This file was deleted.

9 changes: 3 additions & 6 deletions benchmarks/babelstream/src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
This is a port of [BabelStream](https://github.com/UoB-HPC/BabelStream) to alpaka.
This work is based on the [cupla port of BabelStream](https://github.com/jyoung3131/BabelStream) from Jeff Young.
The benchmark driver (`main.cpp` and `Stream.h`) is taken from BabelStream.
No other backends are available, only alpaka.
Thus, there is no need to select a backend, just run the executable.
Please refer to the BabelStream documentation of more information on how to run the benchmark.
This work was initially based on the [cupla port of BabelStream](https://github.com/jyoung3131/BabelStream) from Jeff Young. Then refactored.
The benchmark BabelStream is developed by Tom Deakin, Simon McIntosh-Smith, University of Bristol HPC; based on John D. McCalpin's original STREAM benchmark for CPUs
Some implementations and the documents are accessible through https://github.com/UoB-HPC
48 changes: 0 additions & 48 deletions benchmarks/babelstream/src/Stream.h

This file was deleted.

Loading

0 comments on commit 6ffd219

Please sign in to comment.