vtk-m/benchmarking/CMakeLists.txt

57 lines
1.8 KiB
CMake
Raw Normal View History

2015-07-06 21:44:29 +00:00
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
2019-04-15 23:24:21 +00:00
##
2015-07-06 21:44:29 +00:00
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
# Find Google Benchmark. Note that benchmark_DIR must be pointed at an
# installation, not a build directory.
find_package(benchmark REQUIRED)
function(add_benchmark)
set(options)
set(oneValueArgs NAME FILE)
set(multiValueArgs LIBS)
cmake_parse_arguments(VTKm_AB
"${options}" "${oneValueArgs}" "${multiValueArgs}"
${ARGN}
)
set(exe_name ${VTKm_AB_NAME})
2019-04-18 14:29:24 +00:00
add_executable(${exe_name} ${VTKm_AB_FILE})
target_link_libraries(${exe_name} PRIVATE ${VTKm_AB_LIBS})
target_link_libraries(${exe_name} PRIVATE benchmark::benchmark)
vtkm_add_drop_unused_function_flags(${exe_name})
vtkm_add_target_information(${exe_name})
set_target_properties(${exe_name} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
CXX_VISIBILITY_PRESET "hidden"
CUDA_VISIBILITY_PRESET "hidden"
)
vtkm_add_target_information(${exe_name} DEVICE_SOURCES ${VTKm_AB_FILE})
endfunction()
2015-07-06 21:44:29 +00:00
set(benchmarks
BenchmarkArrayTransfer
2018-08-29 16:03:07 +00:00
BenchmarkAtomicArray
BenchmarkCopySpeeds
BenchmarkDeviceAdapter
BenchmarkFieldAlgorithms
2018-07-13 16:08:28 +00:00
BenchmarkFilters
BenchmarkTopologyAlgorithms
)
foreach (benchmark ${benchmarks})
add_benchmark(NAME ${benchmark} FILE ${benchmark}.cxx LIBS vtkm_source vtkm_filter)
endforeach ()
if(TARGET vtkm_rendering)
add_benchmark(NAME BenchmarkRayTracing FILE BenchmarkRayTracing.cxx LIBS vtkm_rendering)
endif()