Skip to content

Commit

Permalink
Add NVBench in CMake (#8619)
Browse files Browse the repository at this point in the history
This PR added NVBench in cudf's CMake config file.

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

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

URL: #8619
  • Loading branch information
PointKernel authored Jun 30, 2021
1 parent fa50b7d commit 96af10e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
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()

0 comments on commit 96af10e

Please sign in to comment.