Skip to content

Commit

Permalink
Drop deprecated boolean argument for cub::DeviceSegmentedReduce::Max
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 23, 2025
1 parent a9567b4 commit 887a20f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
7 changes: 3 additions & 4 deletions cpp/cmake/thirdparty/get_cccl.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
Expand All @@ -14,9 +14,8 @@

# Use CPM to find or clone CCCL
function(find_and_configure_cccl)
include(${rapids-cmake-dir}/cpm/cccl.cmake)
rapids_cpm_cccl(BUILD_EXPORT_SET cuml-exports
INSTALL_EXPORT_SET cuml-exports)
set(CMAKE_PREFIX_PATH "/home/miscco/cccl/lib/cmake")
find_package(CCCL REQUIRED)
endfunction()

find_and_configure_cccl()
5 changes: 2 additions & 3 deletions cpp/src/hdbscan/detail/membership.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, 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 Down Expand Up @@ -80,8 +80,7 @@ void get_probabilities(const raft::handle_t& handle,
int,
const value_idx*,
const value_idx*,
cudaStream_t,
bool) =
cudaStream_t) =
cub::DeviceSegmentedReduce::Max<const value_t*, value_t*, const value_idx*, const value_idx*>;
Utils::cub_segmented_reduce(
lambdas, deaths.data(), n_clusters, sorted_parents_offsets.data(), stream, reduce_func);
Expand Down
5 changes: 2 additions & 3 deletions cpp/src/hdbscan/detail/stabilities.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, 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 Down Expand Up @@ -104,8 +104,7 @@ void compute_stabilities(const raft::handle_t& handle,
int,
const value_idx*,
const value_idx*,
cudaStream_t,
bool) =
cudaStream_t) =
cub::DeviceSegmentedReduce::Min<const value_t*, value_t*, const value_idx*, const value_idx*>;
Utils::cub_segmented_reduce(lambdas,
births_parent_min.data() + 1,
Expand Down
14 changes: 3 additions & 11 deletions cpp/src/hdbscan/detail/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,11 @@ void cub_segmented_reduce(const value_t* in,
{
rmm::device_uvector<char> d_temp_storage(0, stream);
size_t temp_storage_bytes = 0;
cub_reduce_func(
nullptr, temp_storage_bytes, in, out, n_segments, offsets, offsets + 1, stream, false);
cub_reduce_func(nullptr, temp_storage_bytes, in, out, n_segments, offsets, offsets + 1, stream);
d_temp_storage.resize(temp_storage_bytes, stream);

cub_reduce_func(d_temp_storage.data(),
temp_storage_bytes,
in,
out,
n_segments,
offsets,
offsets + 1,
stream,
false);
cub_reduce_func(
d_temp_storage.data(), temp_storage_bytes, in, out, n_segments, offsets, offsets + 1, stream);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/hdbscan/prediction_data.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
* Copyright (c) 2022-2025, 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 Down Expand Up @@ -130,7 +130,7 @@ void generate_prediction_data(const raft::handle_t& handle,

// this is to find maximum lambdas of all children under a parent
cudaError_t (*reduce_func)(
void*, size_t&, const float*, float*, int, const int*, const int*, cudaStream_t, bool) =
void*, size_t&, const float*, float*, int, const int*, const int*, cudaStream_t) =
cub::DeviceSegmentedReduce::Max<const float*, float*, const int*, const int*>;
detail::Utils::cub_segmented_reduce(lambdas,
prediction_data.get_deaths(),
Expand Down

0 comments on commit 887a20f

Please sign in to comment.