cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

qishengkiss
Journeyman III

problems of "do while" in kernel

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?

0 Likes
3 Replies
binying
Challenger

__kernel(...)

{

     bool shutdown = false;

     do

     {

           // do something

           shutdown = true;

     } while ( true )

}

work well too?

Edit: Oops, it shouldn't work.

0 Likes

not work.

0 Likes

"while ( true ) ;"

Should we need  ";" here?

can upgrading to the latest driver fix this?


0 Likes