Skip to content

Commit

Permalink
Histogram: don't use OpenMP SIMD reductions on array on WIN32
Browse files Browse the repository at this point in the history
Seems to break…
  • Loading branch information
aurelienpierre committed Jul 17, 2024
1 parent bdda704 commit 6d3535a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libs/histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,17 @@ static inline void _bin_pixels_waveform(const float *const restrict image, uint3

// Process
#ifdef _OPENMP
#ifndef _WIN32
#pragma omp parallel for default(none) \
dt_omp_firstprivate(image, height, width, binning_size, vertical) \
reduction(+: bins[0: binning_size]) \
schedule(static) collapse(3)
#else
#pragma omp parallel for default(none) \
dt_omp_firstprivate(image, height, width, binning_size, vertical) \
shared(bins) \
schedule(static) collapse(3)
#endif
#endif
for(size_t i = 0; i < height; i++)
for(size_t j = 0; j < width; j++)
Expand Down Expand Up @@ -444,10 +451,17 @@ static void _bin_pixels_vectorscope(const float *const restrict image, uint32_t
for(size_t k = 0; k < HISTOGRAM_BINS * HISTOGRAM_BINS; k++) vectorscope[k] = 0;

#ifdef _OPENMP
#ifndef _WIN32
#pragma omp parallel for default(none) \
dt_omp_firstprivate(image, n_pixels, profile, zoom) \
reduction(+: vectorscope[0: HISTOGRAM_BINS * HISTOGRAM_BINS]) \
schedule(static)
#else
#pragma omp parallel for default(none) \
dt_omp_firstprivate(image, n_pixels, profile, zoom) \
shared(vectorscope) \
schedule(static)
#endif
#endif
for(size_t k = 0; k < n_pixels * 4; k += 4)
{
Expand Down

0 comments on commit 6d3535a

Please sign in to comment.