Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948018 - llvm-core/clang 20.0.0 omp device number is 1 despite having 2 devices. This appears to confuse #pragma omp target enter data commands
Summary: llvm-core/clang 20.0.0 omp device number is 1 despite having 2 devices. This ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-13 03:29 UTC by Benjamin Schulz
Modified: 2025-01-13 05:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
testprogram in c++ source (main.cpp,4.44 KB, text/plain)
2025-01-13 03:31 UTC, Benjamin Schulz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schulz 2025-01-13 03:29:20 UTC
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
Comment 1 Benjamin Schulz 2025-01-13 03:31:19 UTC
Created attachment 916410 [details]
testprogram in c++ source

should be compiled with clang and -fopenmp   -fopenmp-targets=nvptx64-nvidia-cuda
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-13 03:35:35 UTC
I think you'll need to report this one upstream.