mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
Enhance negative operator for SYCL half conversion (#79850)
Enhance negative operator for SYCL half conversion with sycl::bit_cast implementation. Pull Request resolved: https://github.com/pytorch/pytorch/pull/79850 Approved by: https://github.com/ngimel
This commit is contained in:
committed by
PyTorch MergeBot
parent
604f8d2ed5
commit
84564f2fab
@@ -98,7 +98,7 @@ inline C10_HOST_DEVICE Half operator-(const Half& a) {
|
||||
defined(__HIP_DEVICE_COMPILE__)
|
||||
return __hneg(a);
|
||||
#elif defined(__SYCL_DEVICE_ONLY__)
|
||||
return -static_cast<sycl::half>(a);
|
||||
return -sycl::bit_cast<sycl::half>(a);
|
||||
#else
|
||||
return -static_cast<float>(a);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user