Skip to content

Commit

Permalink
Add ConfigureNVBench to avoid concurrent main() entry points (#8662)
Browse files Browse the repository at this point in the history
This PR fixes a bug where both `nvbench::main` and `benchmark_main` are trying to insert `main()` entry points. It creates a new `ConfigureNVBench` macro to build nvbench benchmarks in a separate directory.

Authors:
  - Yunsong Wang (https://github.com/PointKernel)

Approvers:
  - Robert Maynard (https://github.com/robertmaynard)

URL: #8662
  • Loading branch information
PointKernel authored Jul 7, 2021
1 parent 718eccf commit f0f2170
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ target_link_libraries(cudf_datagen
GTest::gmock_main
GTest::gtest_main
benchmark::benchmark
nvbench::main
Threads::Threads
cudf)

Expand All @@ -51,11 +50,19 @@ target_link_libraries(cudf_benchmark_common PRIVATE cudf_datagen)
function(ConfigureBench CMAKE_BENCH_NAME)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(${CMAKE_BENCH_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/gbenchmarks>")
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>")
target_link_libraries(${CMAKE_BENCH_NAME}
PRIVATE cudf_benchmark_common cudf_datagen benchmark::benchmark_main)
endfunction()

function(ConfigureNVBench CMAKE_BENCH_NAME)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(${CMAKE_BENCH_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>")
target_link_libraries(${CMAKE_BENCH_NAME}
PRIVATE cudf_benchmark_common cudf_datagen nvbench::main)
endfunction()

###################################################################################################
# - column benchmarks -----------------------------------------------------------------------------
ConfigureBench(COLUMN_CONCAT_BENCH column/concatenate_benchmark.cpp)
Expand Down

0 comments on commit f0f2170

Please sign in to comment.