Hi there, i have an nvidia NVIDIA GeForce GTX 1660 SUPER gpu and a ryzen AMD Ryzen 9 3900X 12-Core Processor. Yet if i compile the attached c++ test program with clang (version clang version 20.0.0git639e1fa2) , the omp device number is always just 1. This appears to cause problems with target enter data commands. I can write: #pragma omp target map(tofrom:x1data[0:10])device(0) in the attached c++ file and the map commands work. But if i replace it with, say: (just uncomment the respective lines in the c++ code) #pragma omp target enter data map(alloc: x1data[0:10])device(0) #pragma omp target map(to:x1data[0:10])device(0) and then #pragma omp target exit data map (from:x1data[0:10])device(0) before the last three printf commands in main will show that this will delete the data on the host before it is copied to the device and given to the called functions. Reproducible: Always
Created attachment 916410 [details] testprogram in c++ source should be compiled with clang and -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
I think you'll need to report this one upstream.