@@ -83,7 +83,7 @@ static void relu(const T * x, T * dst, const int k,
83
83
if (i >= k) {
84
84
return ;
85
85
}
86
- dst[i] = sycl::fmax ((T)( x[i]), (T) 0 );
86
+ dst[i] = sycl::fmax ((x[i]), static_cast <T>( 0 ) );
87
87
}
88
88
89
89
template <typename T>
@@ -208,7 +208,7 @@ static void step(const T * x, T * dst, const int k,
208
208
if (i >= k) {
209
209
return ;
210
210
}
211
- dst[i] = x[i] > (T) 0 .0f ;
211
+ dst[i] = x[i] > static_cast <T>( 0 .0f ) ;
212
212
}
213
213
214
214
template <typename T>
@@ -219,8 +219,8 @@ static void leaky_relu(const T *x, T *dst, const int k, const float negative_slo
219
219
if (i >= k) {
220
220
return ;
221
221
}
222
- dst[i] = sycl::fmax ((T)( x[i]), (T) 0 ) +
223
- sycl::fmin ((T)( x[i]), (T) 0 .0f ) * negative_slope;
222
+ dst[i] = sycl::fmax ((x[i]), static_cast <T>( 0 ) ) +
223
+ sycl::fmin ((x[i]), static_cast <T>( 0 .0f ) ) * negative_slope;
224
224
}
225
225
226
226
template <typename T>
@@ -291,7 +291,7 @@ static void clamp(const T * x, T * dst, const float min, const float max, const
291
291
return ;
292
292
}
293
293
294
- dst[i] = x[i] < (T) min ? (T) min : (x[i] > (T) max ? (T) max : x[i]);
294
+ dst[i] = x[i] < static_cast <T>( min) ? static_cast <T>( min) : (x[i] > static_cast <T>( max) ? static_cast <T>( max) : x[i]);
295
295
}
296
296
297
297
static void acc_f32_sycl (const float *x, const float *y, float *dst,
0 commit comments