@@ -172,7 +172,7 @@ void VolumeRestorationKernels<T>::restorationSigmaCostError(T& error, const std:
172
172
const vec2_type<T>* __restrict__ d_fV1 = (vec2_type<T>*)_d_fV1;
173
173
const vec2_type<T>* __restrict__ d_fV2 = (vec2_type<T>*)_d_fV2;
174
174
175
- auto error_func = [=] __device__ (int n) {
175
+ auto error_func = [=] __device__ (int n) -> T {
176
176
const T R2n = d_R2[n];
177
177
if (R2n <= 0.25 ) {
178
178
const T H1 = exp (K1 * R2n);
@@ -222,7 +222,7 @@ template< typename T >
222
222
std::pair<T, T> VolumeRestorationKernels<T>::computeAvgStd(const T* __restrict__ d_N, size_t volume_size) {
223
223
const T avg = thrust::reduce (thrust::device, d_N, d_N + volume_size);
224
224
225
- auto square_kernel = [=] __device__ (T x) {
225
+ auto square_kernel = [=] __device__ (T x) -> T {
226
226
return x * x;
227
227
};
228
228
@@ -233,7 +233,7 @@ std::pair<T, T> VolumeRestorationKernels<T>::computeAvgStd(const T* __restrict__
233
233
234
234
template < typename T >
235
235
std::pair<T, T> VolumeRestorationKernels<T>::computeAvgStdWithMask(const T* __restrict__ d_N, const int * __restrict__ d_mask, size_t mask_size, size_t volume_size) {
236
- auto masked_k = [=] __device__ (int n) {
236
+ auto masked_k = [=] __device__ (int n) -> T {
237
237
if (d_mask[n]) {
238
238
return d_N[n];
239
239
} else {
@@ -244,7 +244,7 @@ std::pair<T, T> VolumeRestorationKernels<T>::computeAvgStdWithMask(const T* __re
244
244
const T avg = thrust::transform_reduce (thrust::device, thrust::counting_iterator<int >(0 ), thrust::counting_iterator<int >(volume_size), masked_k,
245
245
static_cast <T>(0 ), thrust::plus<T>());
246
246
247
- auto masked_square_k = [=] __device__ (int n) {
247
+ auto masked_square_k = [=] __device__ (int n) -> T {
248
248
if (d_mask[n]) {
249
249
return d_N[n] * d_N[n];
250
250
} else {
0 commit comments