Add Half conversion of bit cast for SYCL kernel (#64340)
authorjohnlu <chengjun.lu@intel.com>
Wed, 8 Sep 2021 15:24:46 +0000 (08:24 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 8 Sep 2021 15:25:47 +0000 (08:25 -0700)
commitba8c1fc64854b2c6b3c76244bd228d9e2c6f5682
tree7f6a0c492e9020e78f79d77056106a2d336d8217
parent7f0feafa552b37385c1813e1dd2b427c39f3200e
Add Half conversion of bit cast for SYCL kernel (#64340)

Summary:
## Motivation
Enhance the performance of Half/float conversion in SYCL kernels.

## Solution
Add the native SYCL half type to help convert the half from/to float in the kernel code.

## Additional Context
`__SYCL_DEVICE_ONLY__` is a MACRO only valid when compiling the kernel code for SYCL backend.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/64340

Reviewed By: gchanan

Differential Revision: D30720823

Pulled By: ezyang

fbshipit-source-id: e7e770d02df5b2d45da61d2fed3ba59383b3dc3a
c10/util/Half-inl.h