Hi forum
Can somebody help me with this 2 questions?
-
Im running an app in the kerner. The grid only uses 1 thread by block, now I need synchronize all threads before perform a new operation. How can I do it?
-
Later the all threads are synchronized I need increases a var (to simulate a clock cycle). How can I handle this var.
my general scheme is this
__global__ void kernel(......)
{
tid = .....
for (int i=0; i <100000; i++)
{
if (tid % 2 == 0)
//call function1
else
//call function 2
//here I need increases the var, but only when all threads are synchronized
clocks++;
}
}
thanks in advanced