vtk-m/CMake/testing/VTKmPerformanceTestRun.cmake
Kenneth Moreland 1f34e0eaa6 Add performance configuration options
Added a name option that allows the same benchmark executable to be used
in multiple benchmark tests. This allows the benchmarks to be separated.
Also added an option to pass customized arguments to the benchmark
executable to overwrite the default values.
2022-12-05 13:20:18 -07:00

37 lines
1.3 KiB
CMake

##============================================================================
## 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.
##============================================================================
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake")
REQUIRE_FLAG("VTKm_PERF_BENCH_PATH")
REQUIRE_FLAG("VTKm_PERF_REGEX")
REQUIRE_FLAG("VTKm_PERF_COMPARE_JSON")
REQUIRE_FLAG("VTKm_PERF_STDOUT")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_BENCH_DEVICE")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REPETITIONS")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_MIN_TIME")
execute(
COMMAND "${VTKm_PERF_BENCH_PATH}"
--vtkm-device "${VTKm_PERF_BENCH_DEVICE}"
${VTKm_PERF_ARGS}
"--benchmark_filter=${VTKm_PERF_REGEX}"
"--benchmark_out=${VTKm_PERF_COMPARE_JSON}"
"--benchmark_repetitions=${VTKm_PERF_REPETITIONS}"
"--benchmark_min_time=${VTKm_PERF_MIN_TIME}"
--benchmark_out_format=json
--benchmark_counters_tabular=true
OUTPUT_VARIABLE report_output
)
# Write compare.py output to disk
file(WRITE "${VTKm_PERF_STDOUT}" "${report_output}")