The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

In my case, filling x,y,z with 0 to match the alignment is not really an option , and vloadn/vstoren seem to induce a lot of overhead... and vectorization is a benefit I don't want to lose if x,y,z are of size 4 000 001

Thank you!

Edit :
According to the standard :
Casting a pointer to a
new type represents an unchecked assertion that the address is correctly aligned. The developer
will also need to know the endianness of the OpenCL device and the endianness of the data

What does endianness mean when it comes to vector types? Does it apply to the whole vector or each individual element?

Re: Is it safe to cast a pointer-to-vector to pointer-to-sca

I have done some further tests. In case someone wonders, on my NVidia OpenCL 1.1 SDK,
*((float*)x) = 0
Results in CL_OUT_OF_RESOURCES, so I guess such a cast has undefined behavior.

In case some people wonder what I am doing to solve the issue after a bit more thinking:
What I am doing now is allocating for 16 (the highest alignment) possible, while the user will still see a size of 9, the 8 remaining ones are just fillers... this way I can safely use the vector as float4* on one device, and float8* on another device, for example