@@ -220,15 +220,12 @@ inline float cast_if_host_half(half_impl::half val) {
220
220
} // namespace sycl
221
221
} // __SYCL_INLINE_NAMESPACE(cl)
222
222
223
- using half = cl::sycl::detail::half_impl::half;
224
-
225
223
// Partial specialization of some functions in namespace `std`
226
224
namespace std {
227
225
228
-
229
226
// Partial specialization of `std::hash<cl::sycl::half>`
230
- template <> struct hash <half> {
231
- size_t operator ()(half const &Key) const noexcept {
227
+ template <> struct hash <cl::sycl:: half> {
228
+ size_t operator ()(cl::sycl:: half const &Key) const noexcept {
232
229
return hash<uint16_t >{}(reinterpret_cast <const uint16_t &>(Key));
233
230
}
234
231
};
@@ -260,7 +257,7 @@ template <> struct hash<half> {
260
257
261
258
#define SYCL_HLF_RADIX 2
262
259
263
- template <> struct numeric_limits <half> {
260
+ template <> struct numeric_limits <cl::sycl:: half> {
264
261
static constexpr const bool is_specialized = true ;
265
262
266
263
static constexpr const bool is_signed = true ;
@@ -307,51 +304,53 @@ template <> struct numeric_limits<half> {
307
304
308
305
static constexpr const float_round_style round_style = round_to_nearest;
309
306
310
- static __SYCL_CONSTEXPR_ON_DEVICE const half (min)() noexcept {
307
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half (min)() noexcept {
311
308
return SYCL_HLF_MIN;
312
309
}
313
310
314
- static __SYCL_CONSTEXPR_ON_DEVICE const half (max)() noexcept {
311
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half (max)() noexcept {
315
312
return SYCL_HLF_MAX;
316
313
}
317
314
318
- static __SYCL_CONSTEXPR_ON_DEVICE const half lowest () noexcept {
315
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half lowest () noexcept {
319
316
return -SYCL_HLF_MAX;
320
317
}
321
318
322
- static __SYCL_CONSTEXPR_ON_DEVICE const half epsilon () noexcept {
319
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half epsilon () noexcept {
323
320
return SYCL_HLF_EPSILON;
324
321
}
325
322
326
- static __SYCL_CONSTEXPR_ON_DEVICE const half round_error () noexcept {
323
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl::half
324
+ round_error () noexcept {
327
325
return 0 .5F ;
328
326
}
329
327
330
- static __SYCL_CONSTEXPR_ON_DEVICE const half infinity () noexcept {
328
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half infinity () noexcept {
331
329
return __builtin_huge_valf ();
332
330
}
333
331
334
- static __SYCL_CONSTEXPR_ON_DEVICE const half quiet_NaN () noexcept {
332
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half quiet_NaN () noexcept {
335
333
return __builtin_nanf (" " );
336
334
}
337
335
338
- static __SYCL_CONSTEXPR_ON_DEVICE const half signaling_NaN () noexcept {
336
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl::half
337
+ signaling_NaN () noexcept {
339
338
return __builtin_nansf (" " );
340
339
}
341
340
342
- static __SYCL_CONSTEXPR_ON_DEVICE const half denorm_min () noexcept {
341
+ static __SYCL_CONSTEXPR_ON_DEVICE const cl::sycl:: half denorm_min () noexcept {
343
342
return 5 .96046e-08F ;
344
343
}
345
344
};
346
345
347
346
} // namespace std
348
347
349
- inline std::ostream &operator <<(std::ostream &O, half const &rhs) {
348
+ inline std::ostream &operator <<(std::ostream &O, cl::sycl:: half const &rhs) {
350
349
O << static_cast <float >(rhs);
351
350
return O;
352
351
}
353
352
354
- inline std::istream &operator >>(std::istream &I, half &rhs) {
353
+ inline std::istream &operator >>(std::istream &I, cl::sycl:: half &rhs) {
355
354
float ValFloat = 0 .0f ;
356
355
I >> ValFloat;
357
356
rhs = ValFloat;
0 commit comments