<div dir="ltr"><div>Hi,</div><div><br></div><div>When trying to use openmp target offloading with llvm I get the following error</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="courier new, monospace"><b>$ cat offload.cpp</b><br></font><font face="courier new, monospace">#include <omp.h><br></font><font face="courier new, monospace">int main() {<br></font><font face="courier new, monospace">#pragma omp target teams distribute parallel for<br></font><font face="courier new, monospace"> for(int i=0; i<100; i++);<br></font><font face="courier new, monospace"> return 0;<br></font><font face="courier new, monospace">}<br></font><font face="courier new, monospace"><b>$ clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=$CUDA_TOOLKIT_ROOT_DIR offload.cpp -o offload</b><br></font><font face="courier new, monospace"><b>$ ./offload</b><br></font><font face="courier new, monospace">Libomptarget fatal error 1: default offloading policy must switched to mandatory or disabled<br></font><font face="courier new, monospace"><b>$</b></font></blockquote><div><br></div><div>I have llvm-8.0.0 installed in my system at <font face="courier new, monospace">LLVM_PATH</font>.</div><div>I downloaded openmp-8.0.0 source from the llvm download page. To build openmp I used the following command:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="courier new, monospace">$ mkdir build && cd build<br></font><font face="courier new, monospace">$ <span style="color:rgb(0,0,0)">cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$LLVM_PATH</span><span style="color:rgb(0,0,0)"> -DCMAKE_C_COMPILER=</span><span style="color:rgb(0,0,0)">$LLVM_PATH</span><span style="color:rgb(0,0,0)">/bin/clang -DCMAKE_CXX_COMPILER=</span>
<span style="color:rgb(0,0,0)">$LLVM_PATH</span><span style="color:rgb(0,0,0)">/bin/clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_</span><span style="color:rgb(0,0,0)">CAPABILITIES=35,60,70 ..<br></span></font><span style="color:rgb(0,0,0)"><font face="courier new, monospace">$ make && make install<br></font></span><span style="color:rgb(0,0,0)"><font face="courier new, monospace" style="">$</font></span></blockquote><div><span style="color:rgb(0,0,0);font-family:Menlo;font-size:16px"><br></span></div><div>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.</div><div><br></div><div>--<br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div>Thank You.</div><div>Regards,</div>Alok<i><br></i></div><div style="text-align:center"><i><font color="#666666">'FOR THE GREATER GOOD'</font></i></div></div></div></div></div></div></div>