Skip to content

Commit

Permalink
Merge branch 'branch-24.06' into fea/static_test_dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard authored Apr 15, 2024
2 parents 7b46323 + 80d0ecb commit bd2bb09
Show file tree
Hide file tree
Showing 40 changed files with 1,875 additions and 1,579 deletions.
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ repos:
rev: v16.0.6
hooks:
- id: clang-format
exclude: |
(?x)^(
cpp/libcugraph_etl|
cpp/tests/c_api
)
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: https://github.com/rapidsai/dependency-file-generator
Expand Down
75 changes: 16 additions & 59 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ rapids_find_package(CUDAToolkit REQUIRED
INSTALL_EXPORT_SET cugraph-exports
)

set(CUGRAPH_C_FLAGS "")
set(CUGRAPH_CXX_FLAGS "")
set(CUGRAPH_CUDA_FLAGS "")

Expand Down Expand Up @@ -106,6 +107,7 @@ endif()

if(NOT USE_CUGRAPH_OPS)
message(STATUS "Disabling functions that reference cugraph-ops")
list(APPEND CUGRAPH_C_FLAGS -DNO_CUGRAPH_OPS)
list(APPEND CUGRAPH_CXX_FLAGS -DNO_CUGRAPH_OPS)
list(APPEND CUGRAPH_CUDA_FLAGS -DNO_CUGRAPH_OPS)
endif()
Expand Down Expand Up @@ -143,7 +145,6 @@ if(USE_CUGRAPH_OPS)
include(cmake/thirdparty/get_libcugraphops.cmake)
endif()

include(cmake/thirdparty/get_nccl.cmake)

if (BUILD_CUGRAPH_MTMG_TESTS)
include(cmake/thirdparty/get_ucp.cmake)
Expand Down Expand Up @@ -340,49 +341,26 @@ target_include_directories(cugraph
"$<INSTALL_INTERFACE:include>"
)

set(COMPILED_RAFT_LIB "")
if(CUDA_STATIC_RUNTIME)
get_target_property(_includes raft::raft INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(cugraph PUBLIC ${_includes})
# Add CTK include paths because we make our CTK library links private below
target_include_directories(cugraph SYSTEM PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
if(CUGRAPH_COMPILE_RAFT_LIB)
set(COMPILED_RAFT_LIB )
if(CUGRAPH_COMPILE_RAFT_LIB)
set(COMPILED_RAFT_LIB raft::compiled)
if(USE_RAFT_STATIC)
set(COMPILED_RAFT_LIB raft::compiled_static)
endif()
else()
if(CUGRAPH_COMPILE_RAFT_LIB)
set(COMPILED_RAFT_LIB raft::compiled)
endif()
endif()

################################################################################
# - link libraries -------------------------------------------------------------
if (USE_CUGRAPH_OPS)
target_link_libraries(cugraph
PUBLIC
rmm::rmm
cugraph-ops::cugraph-ops++
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:raft::raft>
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:${COMPILED_RAFT_LIB}>
PRIVATE
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:raft::raft>
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:${COMPILED_RAFT_LIB}>
cuco::cuco
NCCL::NCCL
)
else()
target_link_libraries(cugraph
PUBLIC
rmm::rmm
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:raft::raft>
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:${COMPILED_RAFT_LIB}>
PRIVATE
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:raft::raft>
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:${COMPILED_RAFT_LIB}>
cuco::cuco
NCCL::NCCL
target_link_libraries(cugraph
PUBLIC
rmm::rmm
raft::raft
$<BUILD_LOCAL_INTERFACE:CUDA::toolkit>
$<TARGET_NAME_IF_EXISTS:cugraph-ops::cugraph-ops++>
PRIVATE
${COMPILED_RAFT_LIB}
cuco::cuco
)
endif()

################################################################################
# - C-API library --------------------------------------------------------------
Expand Down Expand Up @@ -469,30 +447,9 @@ target_include_directories(cugraph_c
"$<INSTALL_INTERFACE:include>"
)

if(CUDA_STATIC_RUNTIME)
get_target_property(_includes raft::raft INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(cugraph_c PUBLIC ${_includes})
# Add CTK include paths because we make our CTK library links private below
target_include_directories(cugraph_c SYSTEM PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
set(_ctk_static_suffix "_static")
endif()

################################################################################
# - C-API link libraries -------------------------------------------------------
target_link_libraries(cugraph_c
PUBLIC
CUDA::curand${_ctk_static_suffix}
CUDA::cusolver${_ctk_static_suffix}
CUDA::cusparse${_ctk_static_suffix}
rmm::rmm
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:raft::raft>
$<$<NOT:$<BOOL:${CUDA_STATIC_RUNTIME}>>:${COMPILED_RAFT_LIB}>
PRIVATE
cuco::cuco
cugraph::cugraph
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:raft::raft>
$<$<BOOL:${CUDA_STATIC_RUNTIME}>:${COMPILED_RAFT_LIB}>
)
target_link_libraries(cugraph_c PRIVATE cugraph::cugraph)

################################################################################
# - generate tests -------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions cpp/libcugraph_etl/include/cugraph_etl/functions.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@
#include <cudf/column/column.hpp>
#include <cudf/table/table.hpp>
#include <cudf/types.hpp>

#include <raft/core/handle.hpp>

namespace cugraph {
Expand Down
28 changes: 14 additions & 14 deletions cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
* limitations under the License.
*/

/*
/*
* FIXME: This file is copied from cudf because CuCollections doesnt support concurrent
* insert/find for 8 byte key-value pair size. The plan is to migrate to
* using the cuco when the feature is supported. At that point this file can be deleted.
*/
#pragma once

#include <hash/hash_allocator.cuh>
#include <hash/helper_functions.cuh>
#include <hash/managed.cuh>

#include <cudf/detail/utilities/device_atomics.cuh>
#include <cudf/hashing/detail/default_hash.cuh>
#include <cudf/hashing/detail/hash_functions.cuh>
Expand All @@ -34,6 +30,10 @@

#include <thrust/pair.h>

#include <hash/hash_allocator.cuh>
#include <hash/helper_functions.cuh>
#include <hash/managed.cuh>

#include <iostream>
#include <iterator>
#include <limits>
Expand Down Expand Up @@ -437,10 +437,10 @@ class concurrent_unordered_map {
m_hashtbl_values = m_allocator.allocate(m_capacity, stream);
}
RAFT_CUDA_TRY(cudaMemcpyAsync(m_hashtbl_values,
other.m_hashtbl_values,
m_capacity * sizeof(value_type),
cudaMemcpyDefault,
stream.value()));
other.m_hashtbl_values,
m_capacity * sizeof(value_type),
cudaMemcpyDefault,
stream.value()));
}

void clear_async(rmm::cuda_stream_view stream = rmm::cuda_stream_default)
Expand Down Expand Up @@ -484,12 +484,12 @@ class concurrent_unordered_map {
delete this;
}

concurrent_unordered_map() = delete;
concurrent_unordered_map(concurrent_unordered_map const&) = default;
concurrent_unordered_map(concurrent_unordered_map&&) = default;
concurrent_unordered_map() = delete;
concurrent_unordered_map(concurrent_unordered_map const&) = default;
concurrent_unordered_map(concurrent_unordered_map&&) = default;
concurrent_unordered_map& operator=(concurrent_unordered_map const&) = default;
concurrent_unordered_map& operator=(concurrent_unordered_map&&) = default;
~concurrent_unordered_map() = default;
concurrent_unordered_map& operator=(concurrent_unordered_map&&) = default;
~concurrent_unordered_map() = default;

private:
hasher m_hf;
Expand Down
Loading

0 comments on commit bd2bb09

Please sign in to comment.