I am trying to GPU offload my code using OpenMP and compiling with nvc++. However, when I compile with nvc++, I get this error:
error: invalid text in pragma
#pragma omp target teams distributed parallel for collapse(2) map(centroidPnts)
^
error: extra text after expected end of preprocessing directive
#pragma omp target teams distributed parallel for collapse(2) map(centroidPnts)
^
These is how I compile the code:
nvc++ --compiler-options -std=c++17 -Xcompiler -openmp -mp=gpu -o <NAME> <NAME>.cpp
This is the part of the code where the problem occurs:
#pragma omp target teams distributed parallel for collapse(2) map(centroidPnts)
for (int i = 0; i < k; ++i)
{
for (int j = 0; j < args; ++j)
{
centroidPnts[i].args[j] = 0;
}
}
Any ideas what might be the problem?