Trying to get into brook+ GPU programming, I encountered a weird error with array indexes. Here's my test kernel:
kernel void testkernel(uint2 ker_in<>, uint ker_key, uint ker_s87, out uint2 ker_out<>)
uint ker_n1, ker_n2, t, z, mhm;
ker_n1 = (uint)ker_in.x;
ker_n2 = (uint)ker_in.y;
t = (ker_n1+ker_key) & (uint)0xFFFFFFFF;
z = ker_s87[mhm];
test.x = z;
test.y = mhm;
ker_out = (uint2)test;
Everything works okay, except of the highlited part.
Somehow "z" just returns zero.
"mhm" itself returns proper values: from zero to 255, and also if I just manually substitute the index in the "z" expression, for example:
z = ker_s87;
I get proper result, with z returning the needed element.
I can't really understand what's wrong here and why doesnt it work in proper way. :(
Thanks in advance for any ideas or suggestions!