If statements in GFOR loops

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

If statements in GFOR loops

Postby melonakos » Wed Jul 21, 2010 6:35 pm

One programmer recently asked the following:

If there is a 'for' loop in my code, is it correct to assume I cannot change it to a 'gfor' loop if there are 'if' statements within the loop? (Because the statements within the code would then be dependent).

Yes, that is the correct assumption. You cannot use IF statements in the body of a GFOR loop. For detailed descriptions of this, see:


The above link also shares some options for working around the IF statement limitation.

Also, note, that we are currently working on a major upgrade to GFOR that we hope to have ready for the next major release of Jacket.

John Melonakos (john@arrayfire.com)
User avatar
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am

Return to [archive-commercial] Programming & Development with ArrayFire