Fr4nz

"sizeof" bug with uchar vectors?

Discussion created by Fr4nz on Oct 19, 2011
Latest reply on Oct 26, 2011 by Fr4nz

Hi all!

I've noticed a strange thing: if I write this in a kernel (with cl_amd_printf enabled):

[...]

__local uchar test[256];

printf("%d", sizeof(test));

[...]

the printf will print "4" instead of "256" (as it should do). In other words, it seems that the sizeof operator is returning the size of the pointer to the vector and not the size of the vector...

Any explanation about this?

Outcomes