https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69826
Bug ID: 69826 Summary: problem with cilkplus pragma and preprocessor variable Product: gcc Version: 5.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ycollette.nospam at free dot fr Target Milestone: --- For cilkplus, the pragma cilk grainsize doesn't seems to accept preprocessor variables. Here is a small example: test.cpp #include <cilk/cilk.h> #define CILK_FOR_GRAINSIZE 128 void CoinAbcScatterUpdate(int number) { int result = 0; #pragma cilk grainsize=CILK_FOR_GRAINSIZE cilk_for(int j=0; j < number; j+=2) { result+=j; } } The compilation: $ g++ -c -fcilkplus test.cpp -o test.o The Error message: test.cpp: Dans la fonction ‘void CoinAbcScatterUpdate(int)’: test.cpp:9:24: erreur: ‘CILK_FOR_GRAINSIZE’ was not declared in this scope #pragma cilk grainsize=CILK_FOR_GRAINSIZE ^ test.cpp:9:9: erreur: invalid grainsize for _Cilk_for #pragma cilk grainsize=CILK_FOR_GRAINSIZE ^ If I replace #define CILK_FOR_GRAINSIZE 128 by int CILK_FOR_GRAINSIZE = 128; then the compilation went fine.