I have a 2D array of doubles. I’d love to be able to use texture memory and the associated cache, but textures are limited to ints and floats. Is there any way I can treat my array of doubles as an array of float2’s? I tried a few things but nothing worked. Is there any way to do implicit aliasing between float2 and double?
I’m thinking something like:
[codebox]float2 x_f2[10];
double *pd;
pd = (double*)x_f2;[/codebox]
Since the memory layout of float2 should be the same as a double (64-bits each) it seems like this should work.
I have a 2D array of doubles. I’d love to be able to use texture memory and the associated cache, but textures are limited to ints and floats. Is there any way I can treat my array of doubles as an array of float2’s? I tried a few things but nothing worked. Is there any way to do implicit aliasing between float2 and double?
I’m thinking something like:
[codebox]float2 x_f2[10];
double *pd;
pd = (double*)x_f2;[/codebox]
Since the memory layout of float2 should be the same as a double (64-bits each) it seems like this should work.