Skip to content

Commit

Permalink
Unconditionally init CUDA architectures in Python builds since cuco r…
Browse files Browse the repository at this point in the history
…equires them. (#3041)
  • Loading branch information
vyasr authored Dec 5, 2022
1 parent 1cfbfd7 commit 0502585
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
17 changes: 6 additions & 11 deletions python/cugraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@ set(cugraph_version 22.12.00)

include(../../fetch_rapids.cmake)

# We always need CUDA for cuML because the raft dependency brings in a
# header-only cuco dependency that enables CUDA unconditionally.
include(rapids-cuda)
rapids_cuda_init_architectures(cugraph-python)

project(
cugraph-python
VERSION ${cugraph_version}
LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C
# language to be enabled here. The test project that is built in scikit-build to verify
# various linking options for the python library is hardcoded to build with C, so until
# that is fixed we need to keep C.
C CXX
C CXX CUDA
)

################################################################################
Expand All @@ -51,16 +56,6 @@ endif()
include(rapids-cython)

if(NOT cugraph_FOUND)
# TODO: This will not be necessary once we upgrade to CMake 3.22, which will pull in the required
# languages for the C++ project even if this project does not require those languges.
include(rapids-cuda)
rapids_cuda_init_architectures(cugraph-python)
enable_language(CUDA)

# Since cugraph only enables CUDA optionally, we need to manually include the file that
# rapids_cuda_init_architectures relies on `project` including.
include("${CMAKE_PROJECT_cugraph-python_INCLUDE}")

set(BUILD_TESTS OFF)
set(BUILD_CUGRAPH_MG_TESTS OFF)
set(BUILD_CUGRAPH_OPS_CPP_TESTS OFF)
Expand Down
17 changes: 6 additions & 11 deletions python/pylibcugraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@ set(pylibcugraph_version 22.12.00)

include(../../fetch_rapids.cmake)

# We always need CUDA for cuML because the raft dependency brings in a
# header-only cuco dependency that enables CUDA unconditionally.
include(rapids-cuda)
rapids_cuda_init_architectures(pylibcugraph-python)

project(
pylibcugraph-python
VERSION ${pylibcugraph_version}
LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C
# language to be enabled here. The test project that is built in scikit-build to verify
# various linking options for the python library is hardcoded to build with C, so until
# that is fixed we need to keep C.
C CXX
C CXX CUDA
)

################################################################################
Expand All @@ -51,16 +56,6 @@ endif()
include(rapids-cython)

if (NOT cugraph_FOUND)
# TODO: This will not be necessary once we upgrade to CMake 3.22, which will pull in the required
# languages for the C++ project even if this project does not require those languges.
include(rapids-cuda)
rapids_cuda_init_architectures(pylibcugraph-python)
enable_language(CUDA)

# Since cugraph only enables CUDA optionally, we need to manually include the file that
# rapids_cuda_init_architectures relies on `project` including.
include("${CMAKE_PROJECT_pylibcugraph-python_INCLUDE}")

set(BUILD_TESTS OFF)
set(BUILD_CUGRAPH_MG_TESTS OFF)
set(BUILD_CUGRAPH_OPS_CPP_TESTS OFF)
Expand Down

0 comments on commit 0502585

Please sign in to comment.