I'm trying to paralelize some code with OpenACC.
#pragma acc parallel loop reduction (+:matriz())
for(auto i = 0; i <= (width-siz); i += siz)
for(auto j = 0; j <= (width-siz); j += siz)
for(auto k = 0; k <= (width-siz); k += siz)
for(auto l = 0; l <= (width-siz); l += siz)
matriz[i][j][k][l] = matriz[i][j][k+1][l] + matriz[i][j][k][l+1];
matriz is declared like this:
vector<vector<vector<vector<short>>>> matriz;
I compile with this command:
pgc++ -std=c++11 -acc -ta=multicore,tesla -Minfo=accel boxcount4d.cpp -o boxcount4d
And I get this error:
"boxcount4d.cpp", line 304: error: expected a ")"
#pragma acc parallel loop reduction (+:matriz())
^
1 error detected in the compilation of "boxcount4d.cpp".
I don't know if it is just a syntax error or if I have to use this library https://docs.nvidia.com/cuda/thrust/index.html because I couln't use STL vectors with OpenACC