About built-in vector types in CUDA?
How is the vector-types in CUDA maps to its memory address?
e.g. considering an array of int4 (assuming no alignment issues):
Then I cast it into an array of int:
int32_t * S1 = reinterpret_cast<int32_t *>(S);
Then can I assume that S1=S.x, S1=S.y, S1=S.z, S1=S.w, S1=S.x…?
review the definitions in vector_types.h, which should answer any questions you have, since the vector types are all defined there.
On a standard linux install, that is at /usr/local/cuda/include/vector_types.h
For example, int4 is defined as:
struct device_builtin builtin_align(16) int4
int x, y, z, w;
So it is a struct definition, with x first, then y, then z, then w. You should be able to use standard C language rules to answer any questions about casting.