Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NVBench in CMake #8619

Merged
merged 10 commits into from
Jun 30, 2021
6 changes: 4 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)

option(USE_NVTX "Build with NVTX support" ON)
option(BUILD_TESTS "Configure CMake to build tests" ON)
option(BUILD_BENCHMARKS "Configure CMake to build (google) benchmarks" OFF)
option(BUILD_BENCHMARKS "Configure CMake to build (google & nvbench) benchmarks" OFF)
option(BUILD_SHARED_LIBS "Build cuDF shared libraries" ON)
option(JITIFY_USE_CACHE "Use a file cache for JIT compiled kernels" ON)
option(CUDF_USE_ARROW_STATIC "Build and statically link Arrow libraries" OFF)
Expand All @@ -54,7 +54,7 @@ option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)

message(VERBOSE "CUDF: Build with NVTX support: ${USE_NVTX}")
message(VERBOSE "CUDF: Configure CMake to build tests: ${BUILD_TESTS}")
message(VERBOSE "CUDF: Configure CMake to build (google) benchmarks: ${BUILD_BENCHMARKS}")
message(VERBOSE "CUDF: Configure CMake to build (google & nvbench) benchmarks: ${BUILD_BENCHMARKS}")
message(VERBOSE "CUDF: Build cuDF shared libraries: ${BUILD_SHARED_LIBS}")
message(VERBOSE "CUDF: Use a file cache for JIT compiled kernels: ${JITIFY_USE_CACHE}")
message(VERBOSE "CUDF: Build and statically link Arrow libraries: ${CUDF_USE_ARROW_STATIC}")
Expand Down Expand Up @@ -576,6 +576,8 @@ if(CUDF_BUILD_BENCHMARKS)
GIT_SHALLOW TRUE
OPTIONS "BENCHMARK_ENABLE_TESTING OFF"
"BENCHMARK_ENABLE_INSTALL OFF")
# Find or install NVBench
include(cmake/thirdparty/CUDF_GetNVBench.cmake)
add_subdirectory(benchmarks)
endif()

Expand Down
1 change: 1 addition & 0 deletions cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ target_link_libraries(cudf_datagen
GTest::gmock_main
GTest::gtest_main
benchmark::benchmark
nvbench::main
Threads::Threads
cudf)

Expand Down
34 changes: 34 additions & 0 deletions cpp/cmake/thirdparty/CUDF_GetNVBench.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#=============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

# NVBench doesn't have a public release yet

function(find_and_configure_nvbench)

if(TARGET nvbench::main)
return()
endif()

CPMFindPackage(NAME nvbench
GIT_REPOSITORY https://github.com/NVIDIA/nvbench.git
GIT_TAG main
GIT_SHALLOW TRUE
OPTIONS "NVBench_ENABLE_EXAMPLES OFF"
"NVBench_ENABLE_TESTING OFF")

endfunction()

find_and_configure_nvbench()