Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace thrust::min/max with cuda::std::min/max #4871

Merged
merged 3 commits into from
Jan 21, 2025
Merged
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
3 changes: 2 additions & 1 deletion cpp/tests/sampling/detail/nbr_sampling_validate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <rmm/device_scalar.hpp>
#include <rmm/device_uvector.hpp>

#include <cuda/std/functional>
#include <thrust/count.h>
#include <thrust/distance.h>
#include <thrust/equal.h>
Expand Down Expand Up @@ -275,7 +276,7 @@ bool validate_sampling_depth(raft::handle_t const& handle,
tuple_iter + d_distances.size(),
d_distances.begin(),
[] __device__(auto tuple) {
return thrust::min(thrust::get<0>(tuple), thrust::get<1>(tuple));
return cuda::std::min(thrust::get<0>(tuple), thrust::get<1>(tuple));
});
}
}
Expand Down
6 changes: 4 additions & 2 deletions cpp/tests/utilities/check_utilities.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
* Copyright (c) 2019-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 All @@ -20,6 +20,8 @@
#include <raft/core/handle.hpp>
#include <raft/core/span.hpp>

#include <cuda/std/functional>

#include <numeric>
#include <type_traits>
#include <vector>
Expand Down Expand Up @@ -95,7 +97,7 @@ struct device_nearly_equal {
bool __device__ operator()(type_t lhs, type_t rhs) const
{
return std::abs(lhs - rhs) <
thrust::max(thrust::max(lhs, rhs) * threshold_ratio, threshold_magnitude);
cuda::std::max(thrust::max(lhs, rhs) * threshold_ratio, threshold_magnitude);
}
};

Expand Down
Loading