Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ find_package(Cython REQUIRED)
find_package(OpenMP)

include_directories(.)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD 17)
add_subdirectory(implicit)
35 changes: 4 additions & 31 deletions implicit/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,27 @@ else()
add_cython_target(_cuda CXX)

# use rapids-cmake to install dependencies
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake
set(rapids-cmake-version "26.02")
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/refs/heads/release/26.02/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
include(rapids-cpm)
include(rapids-cuda)
include(rapids-export)
include(rapids-find)
include(${rapids-cmake-dir}/cpm/package_override.cmake)

rapids_cpm_init()
rapids_cmake_build_type(Release)

# thrust/cub have a cmake issue where the conda build fails
# to find them, and needs these patches
# https://github.com/benfred/cub/commit/97934d146b771fd2e8bda75f73349a4b3c9e10a7
# https://github.com/benfred/thrust/commit/8452c764cc8d772314169e99811535f3a9108cfe
# (note that cub is pulled in through thrust here - meaning we only need to override
# the thrust version to pull it in)
# Issue is tracked in https://github.com/NVIDIA/thrust/issues/1966
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json
[=[
{
"packages" : {
"Thrust" : {
"version" : "1.17.2",
"git_url" : "https://github.com/benfred/thrust.git",
"git_tag" : "no_cmake_find_root_path",
"git_shallow" : true,
"always_download" : true,
}
}
}
]=])
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json)

# get rmm
include(${rapids-cmake-dir}/cpm/rmm.cmake)
rapids_cpm_rmm(BUILD_EXPORT_SET implicit-exports INSTALL_EXPORT_SET implicit-exports)

# get raft
# note: we're using RAFT in header only mode right now - mainly to reduce binary
# size of the compiled wheels
rapids_cpm_find(raft 23.12
rapids_cpm_find(raft 26.02
CPM_ARGS
GIT_REPOSITORY https://github.com/rapidsai/raft.git
GIT_TAG branch-23.12
DOWNLOAD_ONLY YES
GIT_TAG v26.02.00
)
include_directories(${raft_SOURCE_DIR}/cpp/include)

Expand Down
7 changes: 4 additions & 3 deletions implicit/gpu/knn.cu
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <cfloat>
#include <vector>

#include <cub/device/device_radix_sort.cuh>
#include <cub/device/device_segmented_radix_sort.cuh>
#include <cuda_runtime.h>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/mr/device/cuda_memory_resource.hpp>
#include <rmm/mr/device/device_memory_resource.hpp>
#include <rmm/mr/device/pool_memory_resource.hpp>
#include <rmm/mr/cuda_memory_resource.hpp>
#include <rmm/mr/device_memory_resource.hpp>
#include <rmm/mr/pool_memory_resource.hpp>
#include <thrust/device_ptr.h>
#include <thrust/functional.h>
#include <thrust/iterator/constant_iterator.h>
Expand Down
5 changes: 4 additions & 1 deletion implicit/gpu/knn.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
#include <memory>

#include <raft/core/resources.hpp>
#include <rmm/mr/device/device_memory_resource.hpp>

#include "implicit/gpu/matrix.h"

namespace rmm::mr {
struct device_memory_resource;
}

namespace implicit {
namespace gpu {
class KnnQuery {
Expand Down
Loading