compute icon indicating copy to clipboard operation
compute copied to clipboard

Add float3_ type

Open svenstaro opened this issue 9 years ago • 5 comments

It's been supported in the official OpenCL standard since quite a long time.

svenstaro avatar Nov 29 '15 17:11 svenstaro

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.

kylelutz avatar Dec 01 '15 18:12 kylelutz

Mainly to keep the code looking the same, I suppose. float3 communicates something different than float4 to somebody reading the code.

svenstaro avatar Dec 01 '15 22:12 svenstaro

In OpenCL every3 is identical in size, alignment and behavior to cl_4, so basically we only need to add typedef <type>4_ <type>3_.

jszuppe avatar Dec 06 '15 16:12 jszuppe

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...

TomSmartBishop avatar Apr 29 '16 01:04 TomSmartBishop

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.

jszuppe avatar Mar 21 '17 12:03 jszuppe