Benchmarks build with the correct backend when cuda is enabled
This commit is contained in:
parent
004bfe7b12
commit
ac7ba751f8
@ -17,19 +17,6 @@
|
|||||||
## Laboratory (LANL), the U.S. Government retains certain rights in
|
## Laboratory (LANL), the U.S. Government retains certain rights in
|
||||||
## this software.
|
## this software.
|
||||||
##============================================================================
|
##============================================================================
|
||||||
|
|
||||||
set(benchmarks
|
|
||||||
BenchmarkArrayTransfer
|
|
||||||
BenchmarkCopySpeeds
|
|
||||||
BenchmarkDeviceAdapter
|
|
||||||
BenchmarkFieldAlgorithms
|
|
||||||
BenchmarkTopologyAlgorithms
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TARGET vtkm_rendering)
|
|
||||||
list(APPEND benchmarks BenchmarkRayTracing)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
function(add_benchmark name files)
|
function(add_benchmark name files)
|
||||||
add_executable(${name}_SERIAL ${files})
|
add_executable(${name}_SERIAL ${files})
|
||||||
target_link_libraries(${name}_SERIAL PRIVATE vtkm_cont)
|
target_link_libraries(${name}_SERIAL PRIVATE vtkm_cont)
|
||||||
@ -40,12 +27,36 @@ function(add_benchmark name files)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (TARGET vtkm::cuda)
|
if (TARGET vtkm::cuda)
|
||||||
set_source_files_properties(${files} PROPERTIES LANGUAGE "CUDA")
|
get_filename_component(fname "${name}" NAME_WE)
|
||||||
add_executable(${name}_CUDA ${files})
|
get_filename_component(fullpath "${name}.cxx" ABSOLUTE)
|
||||||
|
file(GENERATE
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu
|
||||||
|
CONTENT "#include \"${fullpath}\"")
|
||||||
|
|
||||||
|
add_executable(${name}_CUDA ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu)
|
||||||
target_link_libraries(${name}_CUDA PRIVATE vtkm_cont)
|
target_link_libraries(${name}_CUDA PRIVATE vtkm_cont)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
set(benchmarks
|
||||||
|
BenchmarkArrayTransfer
|
||||||
|
BenchmarkCopySpeeds
|
||||||
|
BenchmarkDeviceAdapter
|
||||||
|
BenchmarkFieldAlgorithms
|
||||||
|
BenchmarkTopologyAlgorithms
|
||||||
|
)
|
||||||
|
|
||||||
foreach (benchmark ${benchmarks})
|
foreach (benchmark ${benchmarks})
|
||||||
add_benchmark(${benchmark} ${benchmark}.cxx)
|
add_benchmark(${benchmark} ${benchmark}.cxx)
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
if(TARGET vtkm_rendering)
|
||||||
|
add_benchmark(BenchmarkRayTracing BenchmarkRayTracing.cxx)
|
||||||
|
target_link_libraries(BenchmarkRayTracing_SERIAL PRIVATE vtkm_rendering)
|
||||||
|
if(TARGET BenchmarkRayTracing_TBB)
|
||||||
|
target_link_libraries(BenchmarkRayTracing_TBB PRIVATE vtkm_rendering)
|
||||||
|
endif()
|
||||||
|
if(TARGET BenchmarkRayTracing_CUDA)
|
||||||
|
target_link_libraries(BenchmarkRayTracing_CUDA PRIVATE vtkm_rendering)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user