Commit 5a26051f authored by Robert Maynard's avatar Robert Maynard

benchmarking cmake code simplified

parent 2c026508
......@@ -16,25 +16,17 @@ function(add_benchmark)
${ARGN}
)
set(exe_name ${VTKm_AB_NAME})
if (TARGET vtkm::cuda)
get_filename_component(fname ${VTKm_AB_FILE} NAME_WE)
get_filename_component(fullpath ${VTKm_AB_FILE} ABSOLUTE)
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu
CONTENT "#include \"${fullpath}\"")
add_executable(${exe_name} ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu)
set_property(TARGET ${exe_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
else()
add_executable(${exe_name} ${VTKm_AB_FILE})
endif()
add_executable(${exe_name} ${VTKm_AB_FILE})
target_link_libraries(${exe_name} PRIVATE ${VTKm_AB_LIBS})
set_target_properties(${exe_name} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
)
if (TARGET vtkm::cuda)
set_source_files_properties(${VTKm_AB_FILE} PROPERTIES LANGUAGE "CUDA")
set_property(TARGET ${exe_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
endif()
endfunction()
set(benchmarks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment