Is there any way of making a particular thread to wait for other threads upon some condition in Open
<pre>

__kernel
void example(__global int *a, __global int *dependency, uint cols)
{
int j = genter code hereet_global_id(0);
int i = get_global_id(1);
if(i > 0 && j > 0)
{
while(1)
{
test = 1;
}
//Wait for the dependents

-----------------------------

--------------------------
}
}

</pre>
In the above kernel code why the while loop is just skipped in all the threads with out infinitely looping. Any ideas on this.
I'm working on some interesting problem which requires a thread to wait for some other threads to finish based on some criteria but every time while of above or while(wait_condition) is skipped when it is being run on GPU.

Is there any other way of making a particular thread to wait for the other threads in OpenCL kernel on GPU?

Thanks in advance!
<pre>



__kernel

void example(__global int *a, __global int *dependency, uint cols)

{

int j = genter code hereet_global_id(0);

int i = get_global_id(1);

if(i > 0 && j > 0)

{

while(1)

{

test = 1;

}

//Wait for the dependents



-----------------------------



--------------------------

}

}



</pre>

In the above kernel code why the while loop is just skipped in all the threads with out infinitely looping. Any ideas on this.

I'm working on some interesting problem which requires a thread to wait for some other threads to finish based on some criteria but every time while of above or while(wait_condition) is skipped when it is being run on GPU.



Is there any other way of making a particular thread to wait for the other threads in OpenCL kernel on GPU?



Thanks in advance!

#1
Posted 03/13/2012 05:46 PM   
Scroll To Top