Dear all,
Please find below a minimal example that mimics a code fragment of the Eigen library
include <iostream>
#include <omp.h>
void processRow(int i)
{
int a=i;
}
int main()
{
int threads = 4;
int n = 100;
#pragma omp parallel for schedule(dynamic,(n+threads*4-1)/(threads*4)) num_threads(threads)
for(int i=0; i<n; ++i)
processRow(i);
return 0;
}
The PGI C++ compiler (pgc++ -mp test.cpp -o test
) stops compilation with the following error message
"test.cpp", line 14: error: expected an integer constant
#pragma omp parallel for schedule(dynamic,(n+threads*4-1)/(threads*4)) num_threads(threads)
Is this a bug in PGI (same error in 20.9 and older versions) or a violation of the OpenMP standard? This code compiles well with other compilers, e.g., GCC or ICC.
Kind regards,
Matthias