Hi… I have a question about a shared memory
I want to use shared memory like memory offset.
This is source code.
global static void test(short* a, short* b, short* c)
{
const int idx = threadIdx.x;
shared unsigned int ff;
{
__syncthreads();
c[ff] = a[idx] + b[idx];
ff++;
}
}
I want ff to be 0, 1, 2, 3, …in each other thread.
But I can’t solve this problem.
IF execute it, the result does not correct. ff is 0, 1, 1, 1, …
How can I solve the problem… Please help me