Namespace c10¶
Defines the Struct Half type (half-precision floating-point) including conversions to standard C types and basic arithmetic operations.
Page Contents
Detailed Description¶
Note that arithmetic operations are implemented by converting to floating point and performing the operation in float32, instead of using CUDA half intrinsics. Most uses of this type within ATen are memory bound, including the element-wise kernels, and the half intrinsics aren’t efficient on all GPUs. If you are writing a compute bound kernel, you can use the CUDA half intrinsics directly on the Struct Half type from device code.