AnsweredAssumed Answered

problems of "do while" in kernel

Question asked by qishengkiss on Sep 25, 2012
Latest reply on Sep 27, 2012 by binying

Hi,

 

I have a do while in kernel.

a)
__kernel(...)

{

      bool shutdown = false;

      do

      {

            // do something

            shutdown = true;

      } while ( !shutdown )

}

The kernel will not stop, instead of stopping loop.

 

On the other hand,

b)

__kernel(...)

{

     bool shutdown = false;

     do

     {

           // do something

           shutdown = true;

            if( shutdown )

           {

                  break;

            }

     } while ( true )

}

The kernel work well.

 

Why a) do not work? isn't it supported in OpenCL kernel?

Outcomes