Skip to content

Commit

Permalink
Fix RAFT_NVTX option not set (rapidsai#4825)
Browse files Browse the repository at this point in the history
Pass `NVTX` option to raft in a more similar way to the other arguments and make sure `RAFT_NVTX` option in the installed `raft-config.cmake`.

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Robert Maynard (https://github.com/robertmaynard)

URL: rapidsai#4825
  • Loading branch information
achirkin authored Jul 27, 2022
1 parent 1184964 commit 7bf22cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(CUML_MIN_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00")
set(CUML_BRANCH_VERSION_raft "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}")

function(find_and_configure_raft)
set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_DIST USE_RAFT_NN USE_RAFT_STATIC USE_FAISS_STATIC CLONE_ON_PIN)
set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_DIST USE_RAFT_NN USE_RAFT_STATIC USE_FAISS_STATIC CLONE_ON_PIN NVTX)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

Expand All @@ -45,6 +45,10 @@ function(find_and_configure_raft)
set(RAFT_COMPILE_LIBRARIES OFF)
endif()

# We need to set this each time so that on subsequent calls to cmake
# the raft-config.cmake re-evaluates the RAFT_NVTX value
set(RAFT_NVTX ${PKG_NVTX})

message(VERBOSE "CUML: raft FIND_PACKAGE_ARGUMENTS COMPONENTS ${RAFT_COMPONENTS}")

rapids_cpm_find(raft ${PKG_VERSION}
Expand All @@ -62,7 +66,6 @@ function(find_and_configure_raft)
"RAFT_COMPILE_NN_LIBRARY ${PKG_USE_RAFT_NN}"
"RAFT_COMPILE_DIST_LIBRARY ${PKG_USE_RAFT_DIST}"
"RAFT_USE_FAISS_STATIC ${PKG_USE_FAISS_STATIC}"
"RAFT_NVTX ${NVTX}"
)

if(raft_ADDED)
Expand All @@ -89,4 +92,5 @@ find_and_configure_raft(VERSION ${CUML_MIN_VERSION_raft}
USE_RAFT_DIST ${CUML_USE_RAFT_DIST}
USE_RAFT_STATIC ${CUML_USE_RAFT_STATIC}
USE_FAISS_STATIC ${CUML_USE_FAISS_STATIC}
NVTX ${NVTX}
)

0 comments on commit 7bf22cb

Please sign in to comment.