<div dir="ltr"><div><br></div>I forgot to mention that I am using the latest clang-llvm-openmp versions of source code (10.0.0).<br><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">mashilamani sambasivam</b> <span dir="auto"><<a href="mailto:kandanarul1976@gmail.com">kandanarul1976@gmail.com</a>></span><br>Date: Fri, Jul 3, 2020 at 10:56 AM<br>Subject: omp_get_num_devices() returns 0 even though I have GPUs<br>To:  <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>><br></div><br><br><div dir="ltr"><div>Hi,</div><div>I am trying to offload to my GPUs. I have GTX1060 6GB with compute capability of 6.1.</div><div><br></div><div>I followed the instructions given in <br></div><div><a href="https://hpc-wiki.info/hpc/Building_LLVM/Clang_with_OpenMP_Offloading_to_NVIDIA_GPUs" target="_blank">https://hpc-wiki.info/hpc/Building_LLVM/Clang_with_OpenMP_Offloading_to_NVIDIA_GPUs</a></div><div><br></div><div>Then I compiled my helloworld program using the following environment variables:</div><div>CFLAGS="-fopenmp -fopenmp-targets=nvptx64-sm_61 -pthread -I /usr/lib/gcc/x86_64-linux-gnu/9/include -O2 --libomptarget-nvptx-path=$CLANG_HOME/lib --cuda-gpu-arch=sm_61"</div><div><br></div><div>LD_LIBRARY_PATH=$CLANG_HOME/lib:$LD_LIBRARY_PATH</div><div><br></div><div>CC=clang</div><div><br></div><div>my helloworld program simply printfs omp_get_num_devices() after #including <omp.h><br></div><div><br></div><div>it compiles fine; but when i run it i get the number of devices as 0.</div><div><br></div><div>Does someone have any idea?</div><div>Thanks much,</div><div>Mani<br></div></div>
</div></div></div>