Remove thrust::unary_function (#23506)

### Description
<!-- Describe your changes. -->
Remove thrust::unary_function which is deprecated in later versions of
CUDA.

### Motivation and Context
Addresses issue: https://github.com/microsoft/onnxruntime/issues/23499
This commit is contained in:
Dmitri Smirnov 2025-01-28 08:58:18 -08:00 committed by GitHub
parent 8db97a68f2
commit ded8730d6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,7 +13,6 @@
#include "core/providers/cuda/tensor/compress_impl.h"
#include <thrust/functional.h>
#include <thrust/iterator/transform_iterator.h>
namespace onnxruntime {
@ -23,7 +22,7 @@ namespace cuda {
// in InclusiveSum(). By default, the accumulator type matches the input, but for int8_t
// the sum overflows quickly, so we want the source type to match the output (int32_t).
// see https://github.com/NVIDIA/cub/issues/384
struct CastToInt32 : public thrust::unary_function<int8_t, int32_t> {
struct CastToInt32 {
__host__ __device__ int32_t operator()(int8_t v) const {
return static_cast<int32_t>(v);
}