https://bugs.llvm.org/show_bug.cgi?id=48184
Bug ID: 48184
Summary: use_device_addr always returns a NULL pointer
Product: OpenMP
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Runtime Library
Assignee: unassignedb...@nondot.org
Reporter: csda...@lbl.gov
CC: llvm-bugs@lists.llvm.org
The use_device_addr clause appears to be implemented incorrectly
(use_device_ptr clause works as expected). The LLVM OpenMP trace shows
use_device_addr returns a NULL pointer `Libomptarget --> Returning device
pointer 0x0000000000000000` before the test program segfaults on the fprintf
statement.
```
#include <stdio.h>
#include <stdlib.h>
#define N 100
int main()
{
double *x = malloc(N*sizeof(double));
#pragma omp target enter data map(alloc:x[:N])
#pragma omp target data use_device_ptr(x)
{
fprintf(stderr, "ptr=%p\n", (void*)x);
}
#pragma omp target data use_device_addr(x)
{
fprintf(stderr, "addr=%p\n", (void*)x); // Fail
}
return 0;
}
```
I tested with Clang/LLVM commit bae9aedb341c5f4eceafba2ee1fec7c05d842c97 (12
Nov 2020)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs