@@ -143,8 +143,12 @@ sycl::marray<bfloat16, N> fabs(sycl::marray<bfloat16, N> x) {
143
143
auto partial_res = __clc_fabs (detail::to_uint32_t (x, i * 2 ));
144
144
std::memcpy (&res[i * 2 ], &partial_res, sizeof (uint32_t ));
145
145
}
146
-
147
- if constexpr (N % 2 ) {
146
+ #if __cplusplus >= 201703L
147
+ if constexpr (N % 2 )
148
+ #else
149
+ if (N % 2 )
150
+ #endif // __cplusplus >= 201703L
151
+ {
148
152
res[N - 1 ] = bfloat16::from_bits (__clc_fabs (x[N - 1 ].raw ()));
149
153
}
150
154
return res;
@@ -179,7 +183,12 @@ sycl::marray<bfloat16, N> fmin(sycl::marray<bfloat16, N> x,
179
183
std::memcpy (&res[i * 2 ], &partial_res, sizeof (uint32_t ));
180
184
}
181
185
182
- if constexpr (N % 2 ) {
186
+ #if __cplusplus >= 201703L
187
+ if constexpr (N % 2 )
188
+ #else
189
+ if (N % 2 )
190
+ #endif // __cplusplus >= 201703L
191
+ {
183
192
res[N - 1 ] =
184
193
bfloat16::from_bits (__clc_fmin (x[N - 1 ].raw (), y[N - 1 ].raw ()));
185
194
}
@@ -217,7 +226,12 @@ sycl::marray<bfloat16, N> fmax(sycl::marray<bfloat16, N> x,
217
226
std::memcpy (&res[i * 2 ], &partial_res, sizeof (uint32_t ));
218
227
}
219
228
220
- if constexpr (N % 2 ) {
229
+ #if __cplusplus >= 201703L
230
+ if constexpr (N % 2 )
231
+ #else
232
+ if (N % 2 )
233
+ #endif // __cplusplus >= 201703L
234
+ {
221
235
res[N - 1 ] =
222
236
bfloat16::from_bits (__clc_fmax (x[N - 1 ].raw (), y[N - 1 ].raw ()));
223
237
}
@@ -257,7 +271,12 @@ sycl::marray<bfloat16, N> fma(sycl::marray<bfloat16, N> x,
257
271
std::memcpy (&res[i * 2 ], &partial_res, sizeof (uint32_t ));
258
272
}
259
273
260
- if constexpr (N % 2 ) {
274
+ #if __cplusplus >= 201703L
275
+ if constexpr (N % 2 )
276
+ #else
277
+ if (N % 2 )
278
+ #endif // __cplusplus >= 201703L
279
+ {
261
280
res[N - 1 ] = bfloat16::from_bits (
262
281
__clc_fma (x[N - 1 ].raw (), y[N - 1 ].raw (), z[N - 1 ].raw ()));
263
282
}
0 commit comments