I am trying to implement < a href="www.futurechips.org/tips-for-power-coders/writing-optimizing-parallel-programs-complete.html" >
the histogram parallelization (www.futurechips.org/tips-for-power-coders/writing-optimizing-parallel-programs-complete.html) < /a > to one of my code using OpenMP. The snippet of my code is as follows:
#pragma omp parallel //shared(frame, f_end, chain) private(f, dt, d)
{
int tid = omp_get_thread_num();
__declspec(align(64))double p_acfRv[num_threads + 1][corr_length + 2];
// memset(p_acfRv, 0, sizeof(double) * (corr_length + 2));
#pragma omp for
for(f = frame; f >= f_end; f--) {
dt = abs(frame - f);
for(d = 0; d < DIM; d++)
p_acfRv[tid][dt] += (Rv[f][chain][d] * Rv[frame][chain][d]);
}
#pragma omp for
for(f = frame; f >= f_end; f--) {
dt = abs(frame - f);
for(int t = 0; t < num_threads; t++) {
acfRv[dt] += p_acfRv[t][dt];
}
}
}
When I try to compile the code, it shows the following error:
error: expected ‘;’ before ‘double’ error ‘p_acfRv’ undeclared (first use in this function)
Can anyone point out, how can I get rid of this error. I am very new to the OpenMP world.