mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
fixes error when trying to convert float4 -> half4 (#1300)
This commit is contained in:
parent
50a399ffa3
commit
8562b5a04f
1 changed files with 1 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ class CUDACodegen(CStyleCodegen):
|
|||
#include <cuda_fp16.h>
|
||||
struct __align__(8) half4 {
|
||||
half2 x, y;
|
||||
__device__ __forceinline__ explicit half4(const float4& a): x(make_half2(__float2half(a.x), __float2half(a.y))), y(make_half2(__float2half(a.z),__float2half(a.w))) {}
|
||||
__device__ __forceinline__ explicit operator float4() const {return make_float4(__half2float(x.x), __half2float(x.y), __half2float(y.x), __half2float(y.y)); }
|
||||
};
|
||||
""")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue