<span style=" font-size:10pt;font-family:sans-serif">Hi Alok,</span><br><br><span style=" font-size:10pt;font-family:sans-serif">What type of machine
are you running on?</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Can you try to
see if any of the following env variables help in any way?</span><br><br><span style=" font-size:10pt;font-family:sans-serif">export OMP_DEFAULT_DEVICE=1</span><br><span style=" font-size:10pt;font-family:sans-serif">export CUDA_VISIBLE_DEVICES=0,1,2,3</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Which OpenMP runtime
are you using and are you picking up the correct one?</span><br><br><span style=" font-size:10pt;font-family:sans-serif">To resolve that
use -I -L in the compile line:</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Use -I to point
to the dir containing omp.h header and -L to point to the OpenMP runtime
library you're aiming to use. Make sure that you don't pick them from different
installations.</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Make sure that
your LD_LIBRARY_PATH also contains the path to the OpenMP runtime library
directory.</span><br><br><span style=" font-size:10pt;font-family:sans-serif">Thanks,</span><br><br><span style=" font-size:10pt;font-family:sans-serif">--Doru</span><br><p style="margin-top:0px;margin-Bottom:0px"></p><br><br><br><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">From:
       </span><span style=" font-size:9pt;font-family:sans-serif">Alok
Mishra via Openmp-dev <openmp-dev@lists.llvm.org></span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">To:
       </span><span style=" font-size:9pt;font-family:sans-serif">openmp-dev@lists.llvm.org</span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Date:
       </span><span style=" font-size:9pt;font-family:sans-serif">06/20/2019
02:01 PM</span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Subject:
       </span><span style=" font-size:9pt;font-family:sans-serif">[EXTERNAL]
[Openmp-dev] Using OpenMP target offloading in llvm-8.0.0</span><br><span style=" font-size:9pt;color:#5f5f5f;font-family:sans-serif">Sent
by:        </span><span style=" font-size:9pt;font-family:sans-serif">"Openmp-dev"
<openmp-dev-bounces@lists.llvm.org></span><br><hr noshade><br><br><br><span style=" font-size:12pt">Hi,</span><br><br><span style=" font-size:12pt">When trying to use openmp target offloading
with llvm I get the following error</span><br><br><span style=" font-size:12pt;font-family:Courier New"><b>$ cat offload.cpp</b><br>#include <omp.h><br>int main() {<br>#pragma omp target teams distribute parallel for<br>    for(int i=0; i<100; i++);<br>     return 0;<br>}<b><br>$ clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=$CUDA_TOOLKIT_ROOT_DIR
offload.cpp -o offload<br>$ ./offload</b><br>Libomptarget fatal error 1: default offloading policy must switched to
mandatory or disabled<b><br>$</b></span><br><br><span style=" font-size:12pt">I have llvm-8.0.0 installed in my system
at </span><span style=" font-size:12pt;font-family:Courier New">LLVM_PATH</span><span style=" font-size:12pt">.</span><br><span style=" font-size:12pt">I downloaded openmp-8.0.0 source from
the llvm download page. To build openmp I used the following command:</span><br><br><span style=" font-size:12pt;font-family:Courier New">$ mkdir build
&& cd build<br>$ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$LLVM_PATH -DCMAKE_C_COMPILER=$LLVM_PATH/bin/clang
-DCMAKE_CXX_COMPILER= $LLVM_PATH/bin/clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,70
..<br>$ make && make install<br>$</span><br><br><span style=" font-size:12pt">OpenMP got built without giving any error.
But when trying to use target offloading with OpenMP I get the above mentioned
fatal error. I tried this on 3 different machines, with same result.</span><br><br><span style=" font-size:12pt">--</span><br><span style=" font-size:12pt">Thank You.</span><br><span style=" font-size:12pt">Regards,</span><br><span style=" font-size:12pt">Alok</span><br><span style=" font-size:12pt;color:#5f5f5f"><i>'FOR THE GREATER GOOD'</i></span><tt><span style=" font-size:10pt">_______________________________________________<br>Openmp-dev mailing list<br>Openmp-dev@lists.llvm.org<br></span></tt><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev"><tt><span style=" font-size:10pt">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</span></tt></a><tt><span style=" font-size:10pt"><br></span></tt><br><br><BR>