================
@@ -3,7 +3,7 @@
 
 typedef int int4 __attribute__((ext_vector_type(4)));
 typedef float float4 __attribute__((ext_vector_type(4)));
-typedef half half4 __attribute__((ext_vector_type(4)));
+typedef _Float16 half4 __attribute__((ext_vector_type(4)));
----------------
shiltian wrote:

Hmm, these are OpenCL code, so I'd imagine this should be OpenCL type (thus 
`half`), but since our builtins are used both for OpenCL and HIP, and in HIP we 
use `_Float16` instead, I'm not sure how we can nicely handle that.

```
//  h -> half (__fp16, OpenCL)
//  x -> half (_Float16)
//  y -> half (__bf16)
```

Based on the document, OpenCL's original `half` (or `__fp16`) is more like a 
storage type w/ arithmetic operations promoting to `float` for computation.

Maybe here we just need to enable `cl_khr_fp16` extension? WDYT? @arsenm 
@yxsamliu

https://github.com/llvm/llvm-project/pull/164358
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to