compute
compute copied to clipboard
Add float3_ type
It's been supported in the official OpenCL standard since quite a long time.
Could you let me know a little more about your use-case? Could you instead use float4_
?
Note that, due to padding, sizeof(cl_float3) == sizeof(cl_float4)
and there isn't any difference in memory usage between the two types.
Mainly to keep the code looking the same, I suppose. float3 communicates something different than float4 to somebody reading the code.
In OpenCL everytypedef <type>4_ <type>3_
.
I guess things like the dot products would return different results when using float3 vs float4 (if you have garbage in the padded byte). But I don't have a prove for this right now...
Add
float3_
type
My conclusion: We cannot do it before Khronos changes OpenCL headers, so cl_float3
is not a simple alias of cl_float4
(typedef
), but a separate struct.