Unverified Commit 73e01d6d authored by Muhammed Fatih BALIN's avatar Muhammed Fatih BALIN Committed by GitHub
Browse files

[CUDA] Update CCCL to 2.3.0 (#7171)

parent ff66c42b
...@@ -139,8 +139,6 @@ endif() ...@@ -139,8 +139,6 @@ endif()
if(USE_CUDA) if(USE_CUDA)
message(STATUS "Build with CUDA support") message(STATUS "Build with CUDA support")
project(dgl C CXX) project(dgl C CXX)
# see https://github.com/NVIDIA/thrust/issues/1401
add_definitions(-DTHRUST_CUB_WRAPPED_NAMESPACE=dgl)
include(cmake/modules/CUDA.cmake) include(cmake/modules/CUDA.cmake)
message(STATUS "Use external CCCL library for a consistent API and performance.") message(STATUS "Use external CCCL library for a consistent API and performance.")
cuda_include_directories(BEFORE "${CMAKE_SOURCE_DIR}/third_party/cccl/thrust") cuda_include_directories(BEFORE "${CMAKE_SOURCE_DIR}/third_party/cccl/thrust")
......
...@@ -70,8 +70,6 @@ target_link_libraries(${LIB_GRAPHBOLT_NAME} "${TORCH_LIBRARIES}") ...@@ -70,8 +70,6 @@ target_link_libraries(${LIB_GRAPHBOLT_NAME} "${TORCH_LIBRARIES}")
if(USE_CUDA) if(USE_CUDA)
set_target_properties(${LIB_GRAPHBOLT_NAME} PROPERTIES CUDA_STANDARD 17) set_target_properties(${LIB_GRAPHBOLT_NAME} PROPERTIES CUDA_STANDARD 17)
message(STATUS "Use external CCCL library for a consistent API and performance for graphbolt.") message(STATUS "Use external CCCL library for a consistent API and performance for graphbolt.")
target_compile_definitions(${LIB_GRAPHBOLT_NAME} PRIVATE CUB_WRAPPED_NAMESPACE=graphbolt)
target_compile_definitions(${LIB_GRAPHBOLT_NAME} PRIVATE THRUST_NS_QUALIFIER=thrust)
target_include_directories(${LIB_GRAPHBOLT_NAME} PRIVATE target_include_directories(${LIB_GRAPHBOLT_NAME} PRIVATE
"../third_party/cccl/thrust" "../third_party/cccl/thrust"
"../third_party/cccl/cub" "../third_party/cccl/cub"
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <dgl/array.h> #include <dgl/array.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
#include <dgl/array.h> #include <dgl/array.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <dgl/array.h> #include <dgl/array.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
#include <thrust/iterator/counting_iterator.h> #include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/transform_iterator.h> #include <thrust/iterator/transform_iterator.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
#include <dgl/array.h> #include <dgl/array.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "../../runtime/cuda/cuda_hashtable.cuh" #include "../../runtime/cuda/cuda_hashtable.cuh"
#include "../filter.h" #include "../filter.h"
#include "./dgl_cub.cuh"
using namespace dgl::runtime::cuda; using namespace dgl::runtime::cuda;
......
/**
* Copyright (c) 2021 by Contributors
* @file cuda_common.h
* @brief Wrapper to place cub in dgl namespace.
*/
#ifndef DGL_ARRAY_CUDA_DGL_CUB_CUH_
#define DGL_ARRAY_CUDA_DGL_CUB_CUH_
// This should be defined in CMakeLists.txt
#ifndef THRUST_CUB_WRAPPED_NAMESPACE
static_assert(false, "THRUST_CUB_WRAPPED_NAMESPACE must be defined for DGL.");
#endif
#include "cub/cub.cuh"
#endif // DGL_ARRAY_CUDA_DGL_CUB_CUH_
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <thrust/zip_function.h> #include <thrust/zip_function.h>
#include <algorithm> #include <algorithm>
#include <cub/cub.cuh> // NOLINT
#include <limits> #include <limits>
#include <numeric> #include <numeric>
#include <type_traits> #include <type_traits>
...@@ -44,7 +45,6 @@ ...@@ -44,7 +45,6 @@
#include "../../graph/transform/cuda/cuda_map_edges.cuh" #include "../../graph/transform/cuda/cuda_map_edges.cuh"
#include "../../random/continuous_seed.h" #include "../../random/continuous_seed.h"
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./functor.cuh" #include "./functor.cuh"
#include "./spmm.cuh" #include "./spmm.cuh"
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
#include <dgl/array_iterator.h> #include <dgl/array_iterator.h>
#include <dgl/random.h> #include <dgl/random.h>
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
using namespace dgl::runtime; using namespace dgl::runtime;
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include <dgl/runtime/tensordispatch.h> #include <dgl/runtime/tensordispatch.h>
#include <cub/cub.cuh>
#include <numeric> #include <numeric>
#include "../../array/cuda/atomic.cuh" #include "../../array/cuda/atomic.cuh"
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
using namespace dgl::cuda; using namespace dgl::cuda;
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#include <dgl/random.h> #include <dgl/random.h>
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include <cub/cub.cuh>
#include <numeric> #include <numeric>
#include "../../array/cuda/atomic.cuh" #include "../../array/cuda/atomic.cuh"
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
// require CUB 1.17 to use DeviceSegmentedSort // require CUB 1.17 to use DeviceSegmentedSort
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
#include <thrust/execution_policy.h> #include <thrust/execution_policy.h>
#include <thrust/for_each.h> #include <thrust/for_each.h>
#include <cub/cub.cuh>
#include <numeric> #include <numeric>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./atomic.cuh" #include "./atomic.cuh"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* @brief Utilities for CUDA kernels. * @brief Utilities for CUDA kernels.
*/ */
#include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "./dgl_cub.cuh"
#include "./utils.h" #include "./utils.h"
namespace dgl { namespace dgl {
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include <dgl/runtime/ndarray.h> #include <dgl/runtime/ndarray.h>
#include <dmlc/logging.h> #include <dmlc/logging.h>
#include <cub/cub.cuh>
#include <type_traits> #include <type_traits>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "dgl_cub.cuh"
namespace dgl { namespace dgl {
namespace cuda { namespace cuda {
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
*/ */
#include <algorithm> #include <algorithm>
#include <cub/cub.cuh> // NOLINT
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include "../../../array/cuda/atomic.cuh" #include "../../../array/cuda/atomic.cuh"
#include "../../../array/cuda/dgl_cub.cuh"
#include "../../../runtime/cuda/cuda_common.h" #include "../../../runtime/cuda/cuda_common.h"
#include "frequency_hashmap.cuh" #include "frequency_hashmap.cuh"
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#include <dgl/random.h> #include <dgl/random.h>
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include <cub/cub.cuh>
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "../../../array/cuda/dgl_cub.cuh"
#include "../../../runtime/cuda/cuda_common.h" #include "../../../runtime/cuda/cuda_common.h"
#include "frequency_hashmap.cuh" #include "frequency_hashmap.cuh"
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include <algorithm> #include <algorithm>
#include <cub/cub.cuh> // NOLINT
#include <limits> #include <limits>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <vector> #include <vector>
#include "../../../array/cuda/dgl_cub.cuh"
#include "../../../array/cuda/utils.h" #include "../../../array/cuda/utils.h"
#include "../../../runtime/cuda/cuda_common.h" #include "../../../runtime/cuda/cuda_common.h"
#include "../knn.h" #include "../knn.h"
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
#include <dgl/runtime/device_api.h> #include <dgl/runtime/device_api.h>
#include "../../array/cuda/dgl_cub.cuh" #include <cub/cub.cuh>
#include "../../runtime/cuda/cuda_common.h" #include "../../runtime/cuda/cuda_common.h"
#include "../../runtime/workspace.h" #include "../../runtime/workspace.h"
#include "../partition_op.h" #include "../partition_op.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment