[llvm-bugs] [Bug 44367] private clause not working in offload

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 24 06:47:45 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44367

Alexey Bataev <a.bataev at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #4 from Alexey Bataev <a.bataev at hotmail.com> ---
(In reply to Ye Luo from comment #3)
> (In reply to Alexey Bataev from comment #1)
> > Do you see the problem when building for ТМЗЕЧ? try to offload to the host
> > and what you get when the offloading device is the host.
> 
> Yes, I was testing offload to NVPTX.
> clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
> target_teams_distribute_private.c

Try to compile and run this cuda code:

#include <stdio.h>
__global__ void foo() {
  int a;
  printf("%d, %p\n", threadIdx.x, &a);
}

int main() {
  foo<<<1, 32>>>();
  if (cudaDeviceSynchronize() != cudaSuccess) {
    fprintf(stderr, "Cuda call failed\n");
  }

  return 0;
}


You will get the same result. This is a feature of NVPTX. Local variables are
allocated in local memory which private to each thread. So, it is not a bug, it
is a feature of GPU architecture and the test is not compatible with target.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191224/9ef70d57/attachment.html>


More information about the llvm-bugs mailing list