<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Date: Mon, 9 Nov 2020 17:06:12 +0000<br>
From: Simone Atzeni via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>><br><br>
I have a general question on the behavior of `omp_get_num_devices()`, which seems to be interpreted differently across different compiler vendors (I tried Clang/LLVM and IBM XL).<br></blockquote><div><br></div><div>The device side implementation of omp_get_num_devices() in clang returns 0, seeĀ <a href="https://github.com/llvm/llvm-project/blob/master/openmp/libomptarget/deviceRTLs/common/src/libcall.cu">https://github.com/llvm/llvm-project/blob/master/openmp/libomptarget/deviceRTLs/common/src/libcall.cu</a> for the implementation.</div><div><br></div><div>That is standards conforming if I understand correctly, but not particularly convenient for the user. A downstream fork adds a couple of fields to the global omptarget_device_environment to implement get_num_devices and get_device_num.</div><div><br></div><div>I can put a patch together for this.</div><div><br></div><div>Thanks,</div><div><br></div><div>Jon</div></div></div>