Skip to content

Commit

Permalink
add run_benchmarks target for running benchmarks with json output
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Dec 9, 2021
1 parent 8e5b23c commit 1ff7611
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ add_library(
synchronization/synchronization.cpp io/cuio_benchmark_common.cpp
)
target_link_libraries(cudf_benchmark_common PRIVATE cudf_datagen)
add_custom_command(
OUTPUT CUDF_BENCHMARKS
COMMAND echo Running benchmarks
COMMAND mkdir -p results
VERBATIM
COMMENT "Running cudf benchmarks."
USES_TERMINAL
)

# This function takes in a benchmark name and benchmark source and handles setting all of the
# associated properties and linking to build the benchmark
Expand All @@ -54,6 +62,13 @@ function(ConfigureBench CMAKE_BENCH_NAME)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE cudf_benchmark_common cudf_datagen benchmark::benchmark_main
)
add_custom_command(
OUTPUT CUDF_BENCHMARKS
COMMAND ${CMAKE_BENCH_NAME} --benchmark_out_format=json
--benchmark_out=results/${CMAKE_BENCH_NAME}.json
APPEND
COMMENT "Adding ${CMAKE_BENCH_NAME}"
)
endfunction()

# This function takes in a benchmark name and benchmark source for nvbench benchmarks and handles
Expand Down Expand Up @@ -254,3 +269,9 @@ ConfigureBench(JSON_BENCH string/json_benchmark.cpp)
# ##################################################################################################
# * io benchmark ---------------------------------------------------------------------
ConfigureBench(MULTIBYTE_SPLIT_BENCHMARK io/text/multibyte_split_benchmark.cpp)

add_custom_target(
run_benchmarks
DEPENDS CUDF_BENCHMARKS
COMMENT "Custom command for running cudf benchmarks."
)

0 comments on commit 1ff7611

Please sign in to comment.