Nevertheless, there seem to be some problems with the array:
test.cpp:18:5: error: use of undeclared identifier 'files'
files[n] = n;
^
test.cpp:21:5: error: use of undeclared identifier 'cout'
cout << files[0] << endl;
^
test.cpp:21:13: error: use of undeclared identifier 'files'; did you mean 'fileno'?
cout << files[0] << endl;
cout << files[0] << endl;
Where / how do I have to declare the array so that the erros disappear?
#include <omp.h>
#include <iostream> // Used for C++ console i/o
usingnamespace std;
constexprint ARRSZ = 20; // Specifies size of array as compile time costant
int main(void)
{
#pragma omp parallel target num_teams(3)
#pragma omp parallel num_threads(3)
int files[ARRSZ]; // Define files as an array of ARRSZ elements
#pragma omp for ordered
for (int n = 0; n < ARRSZ; ++n) {
files[n] = n;
#pragma omp ordered
cout << files[0] << endl;
}
return 0;
}