Hi!
Is this normal that such a structure
struct Vector3
{
float x,y,z;
__device__ inline float& operator[](const unsigned int i)
{
switch(i)
{
case 0: return x;
case 1: return y;
default: return z;
}
}
};
forces all vector3 to be allocated in local memory, but
if i define a function that has exacly the same code, but is used like vector.at(i) then vectors stay in registers / shared memory.
Is that normal? and why? :)
edit: sorry, wrong board.