<p>As there is a lot of active development in this space, the answer to the question which compiler is best for offloading to NVIDIA GPUs will probably vary over time/versions (as well as the application). So if you want to be sure you are getting the best performance, you will need to benchmark the most recent versions of the different compilers (See Jérôme Richard's answer) with your specific application and keep doing so in the future.</p>
<p>Depending on size and complexity of your application one might argue that the time this takes could be spent better on implementing CUDA kernels but on the other hand a bad CUDA implementation is potentially as slow as what the &quot;worst compiler&quot; is generating from OpenMP.</p>
<p>There are papers benchmarking different OpenMP implementations, but at this point in time I have not found any including the Intel compiler used by OP. The results in <a href="https://arxiv.org/abs/2010.09454v2" rel="nofollow noreferrer">Performance Assessment of OpenMP Compilers Targeting NVIDIA V100 GPUs (2020)</a> are probably not very meaningful anymore.</p>
<p><a href="https://arxiv.org/abs/2203.02096" rel="nofollow noreferrer">Portability for GPU-accelerated molecular docking applications for cloud and HPC: can portable compiler directives provide performance across all platforms? (2022)</a> might be worth looking into for getting an overview of implementations, optimizations and portable alternatives to OpenMP.</p>
<p>All that being said, if you have no other reason for using the DPC++ compiler, and do not want to do all that benchmarking, I would rather go for either one of the big, established FOS toolchains (GCC or Clang) due to the big user base or for the NVIDIA HPC compilers due to their interest in being fast on their own hardware. Until the Intel compiler is more established and there are more results available publicly I would only use it for offloading to Intel hardware.</p>
<p>Since new supercomputers with AMD (<a href="https://en.wikipedia.org/wiki/Frontier_(supercomputer)" rel="nofollow noreferrer">Frontier</a> and <a href="https://en.wikipedia.org/wiki/LUMI" rel="nofollow noreferrer">LUMI</a>) and Intel (<a href="https://en.wikipedia.org/wiki/Aurora_(supercomputer)" rel="nofollow noreferrer">Aurora</a>) accelerators are already here or will be in the very near future, I expect a lot of comparisons between accelerators and portable programming models to be published as many HPC libraries and applications will need to support accelerators from all vendors.</p>
OpenMP offloading with Intel oneAPI DPC++ compiler to NVIDIA GPU
<p>I'm on a mission to write a <a href="https://stackoverflow.com/questions/73472975/openmp-marking-functions-to-be-included-in-the-offloaded-code">program with OpenMP offloading to a GPU</a>. At the moment I compile my code with Intel oneAPI DPC++ compiler <code>icpx</code> v2022.1.0 and aim to utilise an NVIDIA Tesla V100 at the backend. Please find below the relevant parts of my <code>Makefile</code>:</p>
<pre><code>MKLROOT   = /lustre/system/local/apps/intel/oneapi/2022.2.0/mkl/latest

CXX       = icpx
INC       =-I&quot;${MKLROOT}/include&quot;
CXXFLAGS  =-qopenmp -fopenmp-targets=spir64 ${INC} --gcc-toolchain=/lustre/system/local/apps/gcc9/9.3.0
LDFLAGS   =-qopenmp -fopenmp-targets=spir64 -fsycl -L${MKLROOT}/lib/intel64
LDLIBS    =-lmkl_sycl -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lsycl -lOpenCL -lstdc++ -lpthread -lm -ldl

${EXE}: ${OBJ}
    ${CXX} ${CXXFLAGS} $^ ${LDFLAGS} ${LDLIBS} -o $@
</code></pre>
<p>The code compiles without errors and warnings, but I'm not entirely sure it does use the GPU when it runs.</p>
<ol>
<li>How can I verify that? Can I use an Intel or an NVIDIA profiler to check that?</li>
<li>Is my assumption correct, that Intel compiler supports offloading to an NVIDIA GPU?</li>
<li>Or should I better use an NVIDIA compiler to enable OpenMP offloading to NVIDIA graphics cards?</li>
</ol>