OpenMP 4.0 for Accelerators: Target Nvidia GPU

I am trying to use openMP for Accelerators (openMP 4.0) in Visual Studio 2012 using Intel C ++ 15.0 compiler.

My accelerator is an Nvidia GeForce GTX 670.

This code doesn't compile:

#include <stdio.h>
#include<iostream>
#include <omp.h>

using namespace std;

int main(){
    #pragma omp target
    #pragma omp parallel for
        for (int i=0; i<1000; i++)
            cout<<"Hello world, i am number "<< i <<endl;
    }

      

Of course everything is fine when I comment out a line #pragma omp target

.

I have the same problem when I do anything related to accelerators in the OpenMP 4.0 norm (e.g. a function omp_get_num_devices()

that should return the number of potential accelerators on my system)

I am getting the following errors and warnings:

error #10340: problem encountered when performing target compilation
error : *MIC* cannot open source file "stdio.h"

warning #10362: Environment configuration problem encountered.  Please check for proper MPSS installation and environment setup.

      

Because of the tag *MIC*

, here's my theory: By default, my Intel compiler tries to build a MIC app (for Xeon Phi accelerators) and doesn't accept my Nvidia GPU as a valid accelerator. As much as possible? Is this something I can control in my VS project properties?

If not, I might have a bigger problem: Does OpenMP 4.0 support Nvidia GPUs as accelerators? (I know OpenACC is built for this purpose, but for economic reasons I would prefer to use evry OpenMP function I can)

Any help would be really appreciated.

0


source to share


2 answers


To your first question: ICC only supports Intel MIC for offload. So you cannot use OpenMP 4.0 with ICC to program the Nvidia GPU.



My knowledge may be outdated, but the only OpenMP 4.0 compiler available that targets Nvidia GPUs is the Cray compiler that sells with their clusters. Perhaps the PGI compiler can support OpenMP 4.0, but that's a wild guess. Anyway, these compilers will not be supported on Windows plattforms.

+1


source


OpenMP 4.0 supports Nvidia GPUs as accelerators. What you really want to know is if the OpenMP implementation is supported by your particular compiler. And if you're stuck with MSVC (even using the Intel compiler at the back) then the answer is NO. You can check this , however, to see how this works with clang.



0


source







All Articles