2015-07-06 21:44:29 +00:00
|
|
|
##============================================================================
|
|
|
|
## Copyright (c) Kitware, Inc.
|
|
|
|
## All rights reserved.
|
|
|
|
## See LICENSE.txt for details.
|
|
|
|
## 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.
|
|
|
|
##
|
2017-09-20 21:33:44 +00:00
|
|
|
## Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2015-07-06 21:44:29 +00:00
|
|
|
## Copyright 2014 UT-Battelle, LLC.
|
|
|
|
## Copyright 2014 Los Alamos National Security.
|
|
|
|
##
|
2017-09-20 21:33:44 +00:00
|
|
|
## Under the terms of Contract DE-NA0003525 with NTESS,
|
2015-07-06 21:44:29 +00:00
|
|
|
## the U.S. Government retains certain rights in this software.
|
|
|
|
##
|
|
|
|
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
|
|
## Laboratory (LANL), the U.S. Government retains certain rights in
|
|
|
|
## this software.
|
|
|
|
##============================================================================
|
2018-10-30 15:02:21 +00:00
|
|
|
function(add_benchmark name files lib)
|
2018-01-16 22:23:12 +00:00
|
|
|
set(benchmarks )
|
|
|
|
|
2017-11-08 22:24:02 +00:00
|
|
|
add_executable(${name}_SERIAL ${files})
|
2018-01-16 22:23:12 +00:00
|
|
|
list(APPEND benchmarks ${name}_SERIAL)
|
2018-05-21 18:47:41 +00:00
|
|
|
target_compile_definitions(${name}_SERIAL PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
|
2017-11-08 22:24:02 +00:00
|
|
|
|
|
|
|
if (TARGET vtkm::tbb)
|
|
|
|
add_executable(${name}_TBB ${files})
|
2018-01-16 22:23:12 +00:00
|
|
|
list(APPEND benchmarks ${name}_TBB)
|
2018-05-21 18:47:41 +00:00
|
|
|
target_compile_definitions(${name}_TBB PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
|
2017-11-08 22:24:02 +00:00
|
|
|
endif()
|
2016-06-02 16:06:56 +00:00
|
|
|
|
2018-03-01 21:20:31 +00:00
|
|
|
if (TARGET vtkm::openmp)
|
|
|
|
add_executable(${name}_OPENMP ${files})
|
|
|
|
list(APPEND benchmarks ${name}_OPENMP)
|
|
|
|
target_compile_definitions(${name}_OPENMP PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_OPENMP")
|
|
|
|
endif()
|
|
|
|
|
2017-11-08 22:24:02 +00:00
|
|
|
if (TARGET vtkm::cuda)
|
2017-12-29 19:39:31 +00:00
|
|
|
get_filename_component(fname "${name}" NAME_WE)
|
|
|
|
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)
|
2018-01-16 22:23:12 +00:00
|
|
|
list(APPEND benchmarks ${name}_CUDA)
|
2018-05-21 18:47:41 +00:00
|
|
|
target_compile_definitions(${name}_CUDA PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_CUDA")
|
2017-11-08 22:24:02 +00:00
|
|
|
endif()
|
2018-01-16 22:23:12 +00:00
|
|
|
|
|
|
|
foreach(benchmark ${benchmarks})
|
2018-10-30 15:02:21 +00:00
|
|
|
target_link_libraries(${benchmark} PRIVATE ${lib})
|
2018-01-16 22:23:12 +00:00
|
|
|
set_target_properties(${benchmark} PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
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
|
2017-12-29 19:39:31 +00:00
|
|
|
BenchmarkTopologyAlgorithms
|
|
|
|
)
|
|
|
|
|
2017-11-08 22:24:02 +00:00
|
|
|
foreach (benchmark ${benchmarks})
|
2019-01-14 21:50:08 +00:00
|
|
|
add_benchmark(${benchmark} ${benchmark}.cxx vtkm_filter)
|
2017-11-17 16:12:16 +00:00
|
|
|
endforeach ()
|
2017-12-29 19:39:31 +00:00
|
|
|
|
|
|
|
if(TARGET vtkm_rendering)
|
2018-10-30 15:02:21 +00:00
|
|
|
add_benchmark(BenchmarkRayTracing BenchmarkRayTracing.cxx vtkm_rendering)
|
2017-12-29 19:39:31 +00:00
|
|
|
endif()
|