I want to parallelize this code getting the best performance. \"histogram\" stores number of appareances of a certain colour (there are 10 different colours, so the size of
With OpenMP 4.5, you can simply use a array reduction in C:
int histogram[BINS] = {0}; #pragma omp parallel for reduction(+:hist) for(i=0; i