[cfe-users] Fwd: omp_get_num_devices() returns 0 even though I have GPUs

mashilamani sambasivam via cfe-users cfe-users at lists.llvm.org
Thu Jul 2 22:41:43 PDT 2020

I forgot to mention that I am using the latest clang-llvm-openmp versions
of source code (10.0.0).
---------- Forwarded message ---------
From: mashilamani sambasivam <kandanarul1976 at gmail.com>
Date: Fri, Jul 3, 2020 at 10:56 AM
Subject: omp_get_num_devices() returns 0 even though I have GPUs
To: <cfe-users at lists.llvm.org>

I am trying to offload to my GPUs. I have GTX1060 6GB with compute
capability of 6.1.

I followed the instructions given in

Then I compiled my helloworld program using the following environment
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"



my helloworld program simply printfs omp_get_num_devices() after #including

it compiles fine; but when i run it i get the number of devices as 0.

Does someone have any idea?
Thanks much,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20200703/fb867ba1/attachment.html>

More information about the cfe-users mailing list