Basically, I have an if() in my kernel and if the condition is verified I would like to store a new value in dynamic list or array. The problem is that I can't use the threadIdx because it will not be filled in every kernel.
Something like :
__global__ void myKernel(customType *c)
{
int i = threadIdx.x;
//whatever
if(condition)
c->pop(newvalue)
}
In fact I would like to avoid a c[i]=newvalue because at the end I would need to check every c[i] if a value was inserted or not with a for loop in the host code and to fill properly another structure. I thought about thrust but it seems to be an overkill for my "simple" problem.
Hope you can help me find a workaround.