From e4d443bc2cfc735b62d42a2d4d978bcb7d008a44 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Dec 2023 16:01:12 -0600 Subject: [PATCH] Add proclaim_return_type to matrix_wrappers.hpp. --- .../raft/spectral/detail/matrix_wrappers.hpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp index b90b24e406..6de0dced8a 100644 --- a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp @@ -30,6 +30,8 @@ #include #include +#include + #include // ========================================================= @@ -107,15 +109,16 @@ class vector_t { value_type nrm1() const { - return thrust::reduce(thrust_policy, - buffer_.data(), - buffer_.data() + buffer_.size(), - value_type{0}, - [] __device__(auto left, auto right) { - auto abs_left = left > 0 ? left : -left; - auto abs_right = right > 0 ? right : -right; - return abs_left + abs_right; - }); + return thrust::reduce( + thrust_policy, + buffer_.data(), + buffer_.data() + buffer_.size(), + value_type{0}, + cuda::proclaim_return_type([] __device__(auto left, auto right) { + auto abs_left = left > 0 ? left : -left; + auto abs_right = right > 0 ? right : -right; + return abs_left + abs_right; + })); } void fill(value_type value)