Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make babelstream runnable and test for different Accs #2299

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ endif()
option(alpaka_INSTALL_TEST_HEADER "Install headers of the namespace alpaka::test. Attention, headers are not designed for production code, see documentation." OFF)

include(CMakeDependentOption)

cmake_dependent_option(alpaka_CHECK_HEADERS "Check all alpaka headers as part of the tests whether they can be compiled standalone." OFF BUILD_TESTING OFF)
cmake_dependent_option(alpaka_USE_INTERNAL_CATCH2 "Use internally shipped Catch2" ON BUILD_TESTING OFF)
cmake_dependent_option(alpaka_USE_INTERNAL_CATCH2 "Use internally shipped Catch2" ON "BUILD_TESTING OR alpaka_BUILD_BENCHMARKS" OFF)

################################################################################
# Internal variables.
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ project("alpakaBenchmarks" LANGUAGES CXX)
# Add subdirectories.
################################################################################

if(NOT BUILD_TESTING)
# Testing is not enabled therefore CATCH2 which is part of common must be pulled.
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../test/common "${CMAKE_BINARY_DIR}/test/common")
endif()

add_subdirectory("babelstream/")
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)

set_target_properties(${_TARGET_NAME} PROPERTIES FOLDER benchmarks/babelstream)

#Run as a ctest
if(alpaka_CI)
# Only run for release builds since this is a benchmark
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME})
endif()
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()
230 changes: 0 additions & 230 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.

Loading
Loading