<html><body><p><font size="2">Hi Jan,</font><br><br><font size="2">Can you try compiling with:</font><br><br><font size="2">-fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=/usr/local/cuda/ -Xopenmp-target -march=sm_35</font><br><br><font size="2">and see if it works?</font><br><br><font size="2">George</font><br><br><img width="16" height="16" src="cid:1__=0ABB0B66DFF688E88f9e8a93df938690918c0AB@" border="0" alt="Inactive hide details for "Eichstaedt, Jan R via Openmp-dev" ---13/12/2017 13:11:46---Hello, I am using llvm and clang version "><font size="2" color="#424282">"Eichstaedt, Jan R via Openmp-dev" ---13/12/2017 13:11:46---Hello, I am using llvm and clang version 5.0.0 together with the openmp project of that version on U</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">"Eichstaedt, Jan R via Openmp-dev" <openmp-dev@lists.llvm.org></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">via Openmp-dev <openmp-dev@lists.llvm.org></font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">13/12/2017 13:11</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">[Openmp-dev] offloading to Nvidia GPUs</font><br><font size="2" color="#5F5F5F">Sent by:        </font><font size="2">"Openmp-dev" <openmp-dev-bounces@lists.llvm.org></font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><font face="Helvetica">Hello,</font><br><font face="Helvetica"><br>I am using llvm and clang version 5.0.0 together with the openmp project of that version on Ubuntu 16.04. <br>I try to compile a simple program involving a </font><i><font face="Helvetica">#pragma omp target teams distribute parallel for </font></i><font face="Helvetica">statement to offload to a Nvidia-GPU using the following flags:<br>-fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=/usr/local/cuda/ --cuda-gpu-arch=sm_35<br></font><br><font face="Helvetica">However, the compilation fails, with the following being the first assertion that is triggered:<br>clang++: [...]/llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Cuda.cpp:346: virtual void clang::driver::toolchains::CudaToolChain::addClangTargetOptions(const llvm::opt::ArgList&, llvm::opt::ArgStringList&, clang::driver::Action::OffloadKind) const: Assertion `!GpuArch.empty() && "Must have an explicit GPU arch."' failed.<br><br>Is there a way to pass the GPU architecture differently? Or is target offloading not fully supported in v5.0.0 yet and I might better use the clang-ykt project? Or have I overlooked something else completely?<br><br>Thanks for any help you can offer.<br><br>Cheers,<br>Jan</font><br><br><tt><font size="2">_______________________________________________<br>Openmp-dev mailing list<br>Openmp-dev@lists.llvm.org<br></font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=vUzu_jPe12M6_8ewEkPhMQEAXBAOQHu8IN-_tSnF_Vs&s=LtMWpij0-tQi1INxgWhLXGMEgqeWC7FwoPemRWaDtfw&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_openmp-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=qJFsxTCvA8OSxFqEA7g0sy3-tW87hS-BunEYitahOog&m=vUzu_jPe12M6_8ewEkPhMQEAXBAOQHu8IN-_tSnF_Vs&s=LtMWpij0-tQi1INxgWhLXGMEgqeWC7FwoPemRWaDtfw&e=</a></font></tt><tt><font size="2"><br></font></tt><br><br><BR>
</body></html>