I have the following class:
Class L{
public:
bool foo(vector<bool> & data);
private:
C** cArray;
}
and would like to parallelize the for loop in the function foo which is called somtime after an object of L is created and all the elements in cArray are initialized.
bool L::foo(vector<int> & data){
int row, col;
#pragma omp parallel shared(SIZE, cArray, data) private(row, col)
for (row=0, row<SIZE; ++row)
{
for (col=0; col<SIZE; ++col)
{
cArray[row][col].computeScore(data);
}
}
}
But this gives an error: error C3028: 'L::cArray' : only a variable or static data member can be used in a data-sharing clause.
Is there anything that can be done about this assuming I don't want to make cArray static?
L::foo
: you usevector<bool>
in the former andvector<int>
in the latter.