Skip to content

Commit

Permalink
Create benchmarks directory and move babelstream into it
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehmet Yusufoglu committed Feb 27, 2024
1 parent 9116b75 commit 6ecabf2
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -35,6 +35,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Options and Variants

option(alpaka_BUILD_EXAMPLES "Build the examples" OFF)
option(alpaka_BUILD_BENCHMARKS "Build the benchmarks" OFF)

# Enable the test infrastructure only if alpaka is the top-level project
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand Down Expand Up @@ -80,7 +81,7 @@ set(_alpaka_INCLUDE_DIRECTORY "${_alpaka_ROOT_DIR}/include")
set(_alpaka_SUFFIXED_INCLUDE_DIR "${_alpaka_INCLUDE_DIRECTORY}/alpaka")

# the sequential accelerator is required for the tests and examples
if(alpaka_BUILD_EXAMPLES OR BUILD_TESTING)
if(alpaka_BUILD_EXAMPLES OR alpaka_BUILD_BENCHMARKS OR BUILD_TESTING)
if (NOT (alpaka_ACC_GPU_CUDA_ONLY_MODE OR alpaka_ACC_GPU_HIP_ONLY_MODE))
if (NOT DEFINED alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE)
option(alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE "enable alpaka serial accelerator" ON)
Expand Down Expand Up @@ -148,6 +149,10 @@ if(alpaka_BUILD_EXAMPLES)
add_subdirectory("example/")
endif()

if(alpaka_BUILD_BENCHMARKS)
add_subdirectory("benchmarks/")
endif()

# Only build the tests if alpaka is the top-level project and BUILD_TESTING is ON
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory("test/")
Expand Down
18 changes: 18 additions & 0 deletions benchmarks/CMakeLists.txt
@@ -0,0 +1,18 @@
#
# Copyright 2023 Benjamin Worpitz, Jan Stephan, Mehmet Yusufoglu
# SPDX-License-Identifier: ISC
#

################################################################################
# Required CMake version.
################################################################################

cmake_minimum_required(VERSION 3.22)

project("alpakaBenchmarks" LANGUAGES CXX)

################################################################################
# Add subdirectories.
################################################################################

add_subdirectory("babelstream/")
Expand Up @@ -11,8 +11,8 @@ project(babelstream LANGUAGES CXX)
if(NOT TARGET alpaka::alpaka)
option(alpaka_USE_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)
if(alpaka_USE_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
# Don't build the benchmarks recursively
set(alpaka_BUILD_BENCHMARKS OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
Expand All @@ -22,4 +22,6 @@ 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 example)
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER benchmarks)

# add_test(NAME ${_TARGET_NAME} COMMAND ${_TARGET_NAME})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion example/CMakeLists.txt
Expand Up @@ -32,4 +32,3 @@ add_subdirectory("randomCells2D/")
add_subdirectory("reduce/")
add_subdirectory("tagSpecialization/")
add_subdirectory("vectorAdd/")
add_subdirectory("babelstream/")
2 changes: 1 addition & 1 deletion script/run_generate.sh
Expand Up @@ -78,7 +78,7 @@ mkdir -p build/
cd build/

"${ALPAKA_CI_CMAKE_EXECUTABLE}" --log-level=VERBOSE -G "${ALPAKA_CI_CMAKE_GENERATOR}" ${ALPAKA_CI_CMAKE_GENERATOR_PLATFORM}\
-Dalpaka_BUILD_EXAMPLES=ON -DBUILD_TESTING=ON "$(env2cmake alpaka_ENABLE_WERROR)" \
-Dalpaka_BUILD_EXAMPLES=ON -DBUILD_TESTING=ON -Dalpaka_BUILD_BENCHMARKS=ON "$(env2cmake alpaka_ENABLE_WERROR)" \
"$(env2cmake BOOST_ROOT)" -DBOOST_LIBRARYDIR="${ALPAKA_CI_BOOST_LIB_DIR}/lib" -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_MULTITHREADED=ON -DBoost_USE_STATIC_RUNTIME=OFF -DBoost_ARCHITECTURE="-x64" \
"$(env2cmake CMAKE_BUILD_TYPE)" "$(env2cmake CMAKE_CXX_FLAGS)" "$(env2cmake CMAKE_C_COMPILER)" "$(env2cmake CMAKE_CXX_COMPILER)" "$(env2cmake CMAKE_EXE_LINKER_FLAGS)" "$(env2cmake CMAKE_CXX_EXTENSIONS)"\
"$(env2cmake alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE)" "$(env2cmake alpaka_ACC_CPU_B_SEQ_T_THREADS_ENABLE)" \
Expand Down

0 comments on commit 6ecabf2

Please sign in to comment.