Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

OpenMP 4.5 array reduction not working under Intel C++ 17.1.132

$
0
0

Hi,

According to the OpenMP website, Intel C++ 2017 supports OpenMP 4.5: http://www.openmp.org/resources/openmp-compilers/

I created an OpenMP 4.5 compliant code, which compiles fine under GCC 6.3.1:

    vector<double> res(n);
    double* results = res.data();

    #pragma omp parallel for reduction(+: results[:n])
    for(int s = 0; s < n; ++s) {
        // do something
    }

    return res;

This triggers a compilation error:

/home/marmstrz/pw-brandes/brandes.cpp(15): error: no matching declaration for this reduction
      #pragma omp parallel for reduction(+: results[:n])

Why doesn't this work with the Intel compiler?


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>