| /* Neither built-in nor included from Cutorch, use our definition lifted from CUDA */ |
| #define __thalign__(n) __attribute__((aligned(n))) |
| #define __thalign__(n) __declspec(align(n)) |
| typedef struct __thalign__(2){ |
| typedef struct __thalign__(4) { |
| typedef __THHalf2 THHalf2; |
| TH_API void TH_float2halfbits(float*, unsigned short*); |
| TH_API void TH_halfbits2float(unsigned short*, float*); |
| TH_API THHalf TH_float2half(float); |
| TH_API float TH_half2float(THHalf); |
| #ifndef TH_HALF_BITS_TO_LITERAL |
| # define TH_HALF_BITS_TO_LITERAL(n) { n } |
| #define TH_HALF_ZERO 0x0U |
| #define TH_HALF_INF 0x7C00U |