Skip to content

Commit

Permalink
Fixed benchmark compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
albertandaluz committed Mar 8, 2025
1 parent 9c265ea commit e3a4e86
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@ function (discover_benchmark DIR)
)

foreach(cuda_source ${CUDA_SOURCES})
get_filename_component(cuda_target ${cuda_source} NAME_WE)
add_executable(${cuda_target} ${cuda_source} ${LAUNCH_SOURCES})
target_link_libraries(${cuda_target} PRIVATE CUDA::nppc CUDA::nppial CUDA::nppidei CUDA::nppig headers ${PROJECT_NAME}::${PROJECT_NAME})
get_filename_component(cuda_target ${cuda_source} NAME_WE)
add_executable(${cuda_target} ${cuda_source} ${LAUNCH_SOURCES})
add_test(NAME ${cuda_target} COMMAND ${cuda_target})
target_link_libraries(${cuda_target} PRIVATE CUDA::nppc CUDA::nppial CUDA::nppidei CUDA::nppig headers ${PROJECT_NAME}::${PROJECT_NAME})
set_property(TARGET ${cuda_target} PROPERTY FOLDER benchmarks/${DIR_NAME})
set_target_properties(${cuda_target} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO)
target_include_directories(${cuda_target} PRIVATE "${CMAKE_SOURCE_DIR}")
set_target_cuda_arch_flags(${cuda_target})
add_cuda_to_target(${cuda_target} "")

if(${ENABLE_DEBUG})
add_cuda_debug_support_to_target(${cuda_target})
endif()

if(${ENABLE_NVTX})
add_nvtx_support_to_target(${cuda_target})
endif()

if(${ENABLE_BENCHMARK})
target_compile_definitions(${cuda_target} PRIVATE ENABLE_BENCHMARK)
endif()


endforeach()
endfunction()
Expand Down

0 comments on commit e3a4e86

Please sign in to comment.