Open Thyre opened 5 days ago
@llvm/issue-subscribers-openmp
Author: Jan André Reuter (Thyre)
The results match with LLVM 19.1.2. Like mentioned, I'm currently unable to test LLVM/Clang trunk on my workstation due to the following error when trying to run offloaded code:
: CommandLine Error: Option 'abort-on-max-devirt-iterations-reached' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
[1] 3101877 IOT instruction (core dumped) ./a.out
The OpenMP interface offers a simple function to communicate with an attached tool, which can be just information dumping, sanitizer like Archer or performance tools like Score-P and TAU. While playing around with
omp_control_tool
and its counterpartompt_callback_control_tool
I noticed that the runtime might returnomp_control_tool_notool
, even though a tool was just initialized. This mainly affects offloading constructs and callingomp_control_tool
as its first action.My testing was unfortunately only done with LLVM 18.1.8. With LLVM trunk and an AMD GPU, trying to run any OpenMP example with offload fails with an error message. I'm building LLVM 19.1.2 right now to test against.
Here's a simple reproducer:
The program tries to call
omp_control_tool
with the four specified options. Additional ones can be defined by a tool. The user code prints the result ofomp_control_tool
, the tool prints which command was used. Via defines, one can enable a target region and a parallel region.Without any OpenMP directives
With LLVM 18.1.8, I get these results:
This is broken. Even though a tool was initialized, the user code never gets that information. Once the first parallel region was created we finally get the information that a tool is attached and working.
With a parallel region before
omp_control_tool
A parallel region gives the results one would expect.
With a target region before
omp_control_tool
A target region is not sufficient for
omp_control_tool
to succeed. Similar to the first case, the first parallel region will cause the call to work correctly.