Reputation: 467
I'm using Ubuntu 14.04.
If yes:
which icc version do I need ? (can I do it with gcc ?)
which Intel processors are supported ?
Upvotes: 1
Views: 1957
Reputation: 5662
Some OpenMP 4 constructs work on Intel GPUs with the Intel C/C++ compiler.
I've tested the following code on Xeon E3, probably Haswell (v3) generation and with Intel compiler version 15 or 16 (probably the latter). I tested on Linux and find that it is not supported on Mac.
void vadd4(int n, float * RESTRICT a, float * RESTRICT b, float * RESTRICT c)
{
#if defined(_OPENMP) && (_OPENMP >= 201307)
//#pragma omp target teams distribute map(to:n,a[0:n],b[0:n]) map(from:c[0:n])
#pragma omp target map(to:n,a[0:n],b[0:n]) map(from:c[0:n])
#pragma omp parallel for simd
#else
#warning No OpenMP target/simd support!
#pragma omp parallel for
#endif
for(int i = 0; i < n; i++)
c[i] = a[i] + b[i];
}
The full test code I used to evaluate Intel GPU compute software is https://github.com/jeffhammond/HPCInfo/blob/master/openmp/offload/test_vadd.c.
Unfortunately, the distribute
and teams
are not supported for the -qopenmp-offload=gfx
target, so one needs some preprocessing to generate functionally portable code.
Additional documentation includes:
Disclaimer: I work for Intel, but in a research capacity. I am not responsible for implementing or supporting the Intel compiler or Intel GPU software.
Upvotes: 0