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.
|
|
|
|
##============================================================================
|
2019-12-26 19:48:51 +00:00
|
|
|
|
2021-08-06 19:41:07 +00:00
|
|
|
#Find Google Benchmark.Note that benchmark_DIR must be pointed at an
|
|
|
|
#installation, not a build directory.
|
2020-01-09 19:28:48 +00:00
|
|
|
find_package(benchmark REQUIRED)
|
2019-12-26 19:48:51 +00:00
|
|
|
|
2019-02-15 19:47:07 +00:00
|
|
|
function(add_benchmark)
|
|
|
|
set(options)
|
|
|
|
set(oneValueArgs NAME FILE)
|
|
|
|
set(multiValueArgs LIBS)
|
|
|
|
cmake_parse_arguments(VTKm_AB
|
2019-12-26 19:48:51 +00:00
|
|
|
"${options}" "${oneValueArgs}" "${multiValueArgs}"
|
|
|
|
${ARGN}
|
|
|
|
)
|
2019-02-15 19:47:07 +00:00
|
|
|
set(exe_name ${VTKm_AB_NAME})
|
2018-01-16 22:23:12 +00:00
|
|
|
|
2019-04-18 14:29:24 +00:00
|
|
|
add_executable(${exe_name} ${VTKm_AB_FILE})
|
2019-02-15 19:47:07 +00:00
|
|
|
target_link_libraries(${exe_name} PRIVATE ${VTKm_AB_LIBS})
|
2019-12-26 19:48:51 +00:00
|
|
|
target_link_libraries(${exe_name} PRIVATE benchmark::benchmark)
|
2019-09-09 16:31:01 +00:00
|
|
|
vtkm_add_drop_unused_function_flags(${exe_name})
|
|
|
|
vtkm_add_target_information(${exe_name})
|
|
|
|
|
2019-02-15 19:47:07 +00:00
|
|
|
set_target_properties(${exe_name} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
|
2019-06-18 13:59:43 +00:00
|
|
|
CXX_VISIBILITY_PRESET "hidden"
|
2019-07-08 21:10:50 +00:00
|
|
|
CUDA_VISIBILITY_PRESET "hidden"
|
2019-06-18 13:59:43 +00:00
|
|
|
)
|
2019-09-09 16:31:01 +00:00
|
|
|
|
2019-07-08 21:10:50 +00:00
|
|
|
vtkm_add_target_information(${exe_name} DEVICE_SOURCES ${VTKm_AB_FILE})
|
2017-11-08 22:24:02 +00:00
|
|
|
endfunction()
|
2015-07-06 21:44:29 +00:00
|
|
|
|
2017-12-29 19:39:31 +00:00
|
|
|
set(benchmarks
|
|
|
|
BenchmarkArrayTransfer
|
2018-08-29 16:03:07 +00:00
|
|
|
BenchmarkAtomicArray
|
2017-12-29 19:39:31 +00:00
|
|
|
BenchmarkCopySpeeds
|
|
|
|
BenchmarkDeviceAdapter
|
|
|
|
BenchmarkFieldAlgorithms
|
2018-07-13 16:08:28 +00:00
|
|
|
BenchmarkFilters
|
2020-08-18 19:47:13 +00:00
|
|
|
BenchmarkODEIntegrators
|
2017-12-29 19:39:31 +00:00
|
|
|
BenchmarkTopologyAlgorithms
|
|
|
|
)
|
|
|
|
|
2020-03-19 19:15:32 +00:00
|
|
|
set(VTKm_BENCHS_RANGE_LOWER_BOUNDARY 4096 CACHE STRING "Smallest sample for input size bench for BenchmarkDeviceAdapter")
|
|
|
|
set(VTKm_BENCHS_RANGE_UPPER_BOUNDARY 134217728 CACHE STRING "Biggest sample for input size bench for BenchmarkDeviceAdapter")
|
|
|
|
mark_as_advanced(VTKm_BENCHS_RANGE_LOWER_BOUNDARY VTKm_BENCHS_RANGE_UPPER_BOUNDARY)
|
|
|
|
|
2017-11-08 22:24:02 +00:00
|
|
|
foreach (benchmark ${benchmarks})
|
2020-05-19 18:27:01 +00:00
|
|
|
add_benchmark(NAME ${benchmark} FILE ${benchmark}.cxx LIBS vtkm_source vtkm_filter vtkm_io)
|
2017-11-17 16:12:16 +00:00
|
|
|
endforeach ()
|
2017-12-29 19:39:31 +00:00
|
|
|
|
2022-05-12 20:00:30 +00:00
|
|
|
target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_LOWER_BOUNDARY=${VTKm_BENCHS_RANGE_LOWER_BOUNDARY})
|
|
|
|
target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_UPPER_BOUNDARY=${VTKm_BENCHS_RANGE_UPPER_BOUNDARY})
|
2020-03-19 19:15:32 +00:00
|
|
|
|
2017-12-29 19:39:31 +00:00
|
|
|
if(TARGET vtkm_rendering)
|
2021-06-09 19:58:39 +00:00
|
|
|
add_benchmark(NAME BenchmarkRayTracing FILE BenchmarkRayTracing.cxx LIBS vtkm_rendering vtkm_source)
|
2021-06-30 15:58:40 +00:00
|
|
|
add_benchmark(NAME BenchmarkInSitu FILE BenchmarkInSitu.cxx LIBS vtkm_rendering vtkm_source vtkm_filter vtkm_io)
|
2017-12-29 19:39:31 +00:00
|
|
|
endif()
|