Skip to content

Commit

Permalink
Make cuco a private dependency and leverage rapids-cmake (rapidsai#2432)
Browse files Browse the repository at this point in the history
After rapidsai#2398 cuco is not actually part of libcugraph's public API and should not be required by consumers. Since it is already not being installed, this PR removes it from the public link interface of libcugraph. This PR also uses rapids-cmake to fetch cuco, ensuring that libcugraph remains in sync with the rest of RAPIDS.

There are a handful of tests that still rely on `libcugraph::detail` APIs that use cuco. To minimize the leakage of these dependencies, they are explicitly linked to cuco (rather than the current approach where they receive the cuco headers transitively from the libcugraph target).

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)
  - Chuck Hastings (https://github.com/ChuckHastings)

URL: rapidsai#2432
  • Loading branch information
vyasr authored Jul 25, 2022
1 parent 6644813 commit 2f301ad
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 38 deletions.
9 changes: 5 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ rapids_cpm_init()

# Putting this before raft to override RAFT from pulling them in.
include(cmake/thirdparty/get_libcudacxx.cmake)
include(cmake/thirdparty/get_cuco.cmake)
include(${rapids-cmake-dir}/cpm/cuco.cmake)
rapids_cpm_cuco(BUILD_EXPORT_SET cugraph-exports)

include(cmake/thirdparty/get_raft.cmake)

Expand Down Expand Up @@ -311,17 +312,17 @@ if (USE_CUGRAPH_OPS)
PUBLIC
cugraph-ops::cugraph-ops++
raft::raft
cuco::cuco
PRIVATE
cuco::cuco
cugraph::cuHornet
NCCL::NCCL
)
else()
target_link_libraries(cugraph
PUBLIC
raft::raft
cuco::cuco
PRIVATE
cuco::cuco
cugraph::cuHornet
NCCL::NCCL
)
Expand Down Expand Up @@ -441,8 +442,8 @@ target_link_libraries(cugraph_c
CUDA::cusolver
CUDA::cusparse
raft::raft
cuco::cuco
PRIVATE
cuco::cuco
cugraph::cugraph
)

Expand Down
34 changes: 0 additions & 34 deletions cpp/cmake/thirdparty/get_cuco.cmake

This file was deleted.

14 changes: 14 additions & 0 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ target_link_libraries(cugraphtestutil
PUBLIC
cugraph::cugraph
NCCL::NCCL
PRIVATE
cuco::cuco
)


Expand Down Expand Up @@ -467,6 +469,7 @@ ConfigureTest(RANDOM_WALKS_LOW_LEVEL_TEST sampling/rw_low_level_test.cu)
###########################################################################################
# - MG NBR SAMPLING tests -----------------------------------------------------------------
ConfigureTest(UNIFORM_NEIGHBOR_SAMPLING_TEST sampling/sg_uniform_neighbor_sampling.cu)
target_link_libraries(UNIFORM_NEIGHBOR_SAMPLING_TEST PRIVATE cuco::cuco)

###################################################################################################
# FIXME: since this is technically not a test, consider refactoring the the
Expand Down Expand Up @@ -581,48 +584,59 @@ if(BUILD_CUGRAPH_MG_TESTS)
###########################################################################################
# - MG PRIMS COUNT_IF_V tests -------------------------------------------------------------
ConfigureTestMG(MG_COUNT_IF_V_TEST prims/mg_count_if_v.cu)
target_link_libraries(MG_COUNT_IF_V_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS TRANSFORM_REDUCE_V_FRONTIER_OUTGOING_E_BY_DST tests --------------------------
ConfigureTestMG(MG_TRANSFORM_REDUCE_V_FRONTIER_OUTGOING_E_BY_DST_TEST
prims/mg_transform_reduce_v_frontier_outgoing_e_by_dst.cu)
target_link_libraries(MG_TRANSFORM_REDUCE_V_FRONTIER_OUTGOING_E_BY_DST_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS REDUCE_V tests ---------------------------------------------------------------
ConfigureTestMG(MG_REDUCE_V_TEST prims/mg_reduce_v.cu)
target_link_libraries(MG_REDUCE_V_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS TRANSFORM_REDUCE_V tests -----------------------------------------------------
ConfigureTestMG(MG_TRANSFORM_REDUCE_V_TEST prims/mg_transform_reduce_v.cu)
target_link_libraries(MG_TRANSFORM_REDUCE_V_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS TRANSFORM_REDUCE_E tests -----------------------------------------------------
ConfigureTestMG(MG_TRANSFORM_REDUCE_E_TEST prims/mg_transform_reduce_e.cu)
target_link_libraries(MG_TRANSFORM_REDUCE_E_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS COUNT_IF_E tests -------------------------------------------------------------
ConfigureTestMG(MG_COUNT_IF_E_TEST prims/mg_count_if_e.cu)
target_link_libraries(MG_COUNT_IF_E_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS PER_V_TRANSFORM_REDUCE_INCOMING_OUTGOING_E tests -----------------------------
ConfigureTestMG(MG_PER_V_TRANSFORM_REDUCE_INCOMING_OUTGOING_E_TEST
prims/mg_per_v_transform_reduce_incoming_outgoing_e.cu)
target_link_libraries(MG_PER_V_TRANSFORM_REDUCE_INCOMING_OUTGOING_E_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG PRIMS EXTRACT_IF_E tests -----------------------------------------------------------
ConfigureTestMG(MG_EXTRACT_IF_E_TEST prims/mg_extract_if_e.cu)
target_link_libraries(MG_EXTRACT_IF_E_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG GATHER_UTILS tests -----------------------------------------------------------------
ConfigureTestMG(MG_GATHER_UTILS_TEST sampling/detail/mg_gather_utils.cu)
target_link_libraries(MG_GATHER_UTILS_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG GATHER_ONE_HOP tests ---------------------------------------------------------------
ConfigureTestMG(MG_GATHER_ONE_HOP_TEST sampling/detail/mg_gather_one_hop.cu)
target_link_libraries(MG_GATHER_ONE_HOP_TEST PRIVATE cuco::cuco)

###########################################################################################
# - MG NBR SAMPLING tests -----------------------------------------------------------------
ConfigureTestMG(MG_UNIFORM_NEIGHBOR_SAMPLING_TEST sampling/mg_uniform_neighbor_sampling.cu)
target_link_libraries(MG_UNIFORM_NEIGHBOR_SAMPLING_TEST PRIVATE cuco::cuco)

###########################################################################################
# - RANDOM_WALKS tests --------------------------------------------------------------------
Expand Down

0 comments on commit 2f301ad

Please sign in to comment.