gfor loops not working

45 views
Skip to first unread message

E

unread,
Nov 28, 2023, 1:52:37 PM11/28/23
to ArrayFire Users
I cant get gfor loops to work even on simple examples

If I use : 

  af::gfor(seq n,N) { 
...
}

I get "expected unqualified-id before "for", and:
"expected primary-expression before ')' token"

errors. It's like it just isnt recognizing the gfor command at all.

Also i'm using RcppArrayFire (i.e. using ArrayFire via R) - not sure that matters though 

Thanks, 
Enzo 

John Melonakos

unread,
Nov 28, 2023, 2:07:16 PM11/28/23
to ArrayFire Users
We generally recommend avoiding gfor and are unsure if gfor is supported with the R wrapper. Anything you do with gfor can be accomplished by vectorizing the entire thing and adding an extra dimension to your data to account for the iterative variable. For more, see:  https://arrayfire.org/docs/vectorization.htm#gsc.tab=0
Reply all
Reply to author
Forward
0 new messages