[llvm-bugs] [Bug 46867] compile-time crash when using target enter data to map a constexpr array

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 12 18:19:29 PDT 2021


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

Ye Luo <xw111luoye at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xw111luoye at gmail.com
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Ye Luo <xw111luoye at gmail.com> ---
I just tried
```
#include <cstdio>
#define LENGTH 2
int main()
{
  constexpr double h_chebyshev_coefs[LENGTH] = { 0, 2.1 };
#pragma omp target enter data map(to:h_chebyshev_coefs[0:LENGTH])
  #pragma omp target
  {
    printf("print in target %lf %lf\n", h_chebyshev_coefs[0],
h_chebyshev_coefs[1]);
  }
  return 0;
}
```
$ clang++ -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
01d59c0de822099c62f12f275c41338f6df9f5ac)
$ clang++ -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda constexpr.cpp &&
./a.out
print in target 0.000000 2.100000

It seems good now.

-- 
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/20210813/5f8a3727/attachment-0001.html>


More information about the llvm-bugs mailing list