<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/offload/test, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libomptarget] Add a test for OMP_TARGET_OFFLOAD=disabled (#146385)</title>
<updated>2025-06-30T18:29:36+00:00</updated>
<author>
<name>Ye Luo</name>
<email>yeluo@anl.gov</email>
</author>
<published>2025-06-30T18:29:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=536ba87726d8dea862d964678dbb761ca32e21fb'/>
<id>536ba87726d8dea862d964678dbb761ca32e21fb</id>
<content type='text'>
closes https://github.com/llvm/llvm-project/issues/144786</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes https://github.com/llvm/llvm-project/issues/144786</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP] Fix crash with duplicate mapping on target directive (#146136)</title>
<updated>2025-06-29T21:41:24+00:00</updated>
<author>
<name>Julian Brown</name>
<email>julian.brown@amd.com</email>
</author>
<published>2025-06-29T21:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b62b58d1bbbff7ca200f166603c80470639a0632'/>
<id>b62b58d1bbbff7ca200f166603c80470639a0632</id>
<content type='text'>
OpenMP allows duplicate mappings, i.e. in OpenMP 6.0, 7.9.6 "map
Clause":

  Two list items of the map clauses on the same construct must not share
  original storage unless one of the following is true: they are the same
  list item [or other omitted reasons]"

Duplicate mappings can arise as a result of user-defined mapper
processing (which I think is a separate bug, and is not addressed here),
but also in straightforward cases such as:

  #pragma omp target map(tofrom: s.mem[0:10]) map(tofrom: s.mem[0:10])

Both these cases cause crashes at runtime at present, due to an
unfortunate interaction between reference counting behaviour and shadow
pointer handling for blocks. This is what happens:

  1.  The member "s.mem" is copied to the target
  2.  A shadow pointer is created, modifying the pointer on the target
  3.  The member "s.mem" is copied to the target again
  4. The previous shadow pointer metadata is still present, so the runtime doesn't modify the target pointer a second time.

The fix is to disable step 3 if we've already done step 2 for a given
block that has the "is new" flag set.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenMP allows duplicate mappings, i.e. in OpenMP 6.0, 7.9.6 "map
Clause":

  Two list items of the map clauses on the same construct must not share
  original storage unless one of the following is true: they are the same
  list item [or other omitted reasons]"

Duplicate mappings can arise as a result of user-defined mapper
processing (which I think is a separate bug, and is not addressed here),
but also in straightforward cases such as:

  #pragma omp target map(tofrom: s.mem[0:10]) map(tofrom: s.mem[0:10])

Both these cases cause crashes at runtime at present, due to an
unfortunate interaction between reference counting behaviour and shadow
pointer handling for blocks. This is what happens:

  1.  The member "s.mem" is copied to the target
  2.  A shadow pointer is created, modifying the pointer on the target
  3.  The member "s.mem" is copied to the target again
  4. The previous shadow pointer metadata is still present, so the runtime doesn't modify the target pointer a second time.

The fix is to disable step 3 if we've already done step 2 for a given
block that has the "is new" flag set.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Fix entry_points.td test (#145292)</title>
<updated>2025-06-23T10:09:08+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-06-23T10:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=02d2a1646a4aec3a7cc5fba9ae3cb54af41fa05d'/>
<id>02d2a1646a4aec3a7cc5fba9ae3cb54af41fa05d</id>
<content type='text'>
This was broken as part of #144494 , and just needs an update to the
check lines.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was broken as part of #144494 , and just needs an update to the
check lines.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload][PGO] Fix new GPU PGO tests (#143645)</title>
<updated>2025-06-12T16:14:21+00:00</updated>
<author>
<name>Ethan Luis McDonough</name>
<email>ethanluismcdonough@gmail.com</email>
</author>
<published>2025-06-12T16:14:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=daee5eee8562d26d234f85152e803b6571b15ee2'/>
<id>daee5eee8562d26d234f85152e803b6571b15ee2</id>
<content type='text'>
`pgo_atomic_teams.c` and `pgo_atomic_threads.c` currently are set to run
on NVPTX despite the changes for that target not being upstreamed yet.
This patch also replaces instances of `llvm-profdata` with `%profdata`
in those tests.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`pgo_atomic_teams.c` and `pgo_atomic_threads.c` currently are set to run
on NVPTX despite the changes for that target not being upstreamed yet.
This patch also replaces instances of `llvm-profdata` with `%profdata`
in those tests.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang][OpenMP] Fix mapping of arrays of structs with members with mappers (#142511)</title>
<updated>2025-06-11T19:03:55+00:00</updated>
<author>
<name>Abhinav Gaba</name>
<email>abhinav.gaba@intel.com</email>
</author>
<published>2025-06-11T19:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=02b6849cf1feb425885bf6f5ee505d5cd4a824d7'/>
<id>02b6849cf1feb425885bf6f5ee505d5cd4a824d7</id>
<content type='text'>
This builds upon #101101 from @jyu2-git, which used compiler-generated
mappers when mapping an array-section of structs with members that have
user-defined default mappers.

Now we do the same when mapping arrays of structs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This builds upon #101101 from @jyu2-git, which used compiler-generated
mappers when mapping an array-section of structs with members that have
user-defined default mappers.

Now we do the same when mapping arrays of structs.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Fix APU detection for MI300 testing (#143026)</title>
<updated>2025-06-05T20:31:55+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-05T20:31:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=051945304b1dc0bc2e7c9336a1d34c998ca16d05'/>
<id>051945304b1dc0bc2e7c9336a1d34c998ca16d05</id>
<content type='text'>
Summary:
We have this check when the target is MI300 but it fails if this
environment variable isn't set. Set a default value of '0' if not
present so that will be converted to bool false.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
We have this check when the target is MI300 but it fails if this
environment variable isn't set. Set a default value of '0' if not
present so that will be converted to bool false.</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][Offload] Fix typo in error message (#142589)</title>
<updated>2025-06-03T12:33:45+00:00</updated>
<author>
<name>Jan Patrick Lehr</name>
<email>JanPatrick.Lehr@amd.com</email>
</author>
<published>2025-06-03T12:33:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e97f42e931208878e3ec30052fb65b6a3cef7b4e'/>
<id>e97f42e931208878e3ec30052fb65b6a3cef7b4e</id>
<content type='text'>
It appears that the spelling was incorrect in those test cases. At least
on machines with ROCm version &gt; 6.3.

I had no chance to test with ROCm version version &lt; 6.2 and would be
interested in the result if someone has the chance.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It appears that the spelling was incorrect in those test cases. At least
on machines with ROCm version &gt; 6.3.

I had no chance to test with ROCm version version &lt; 6.2 and would be
interested in the result if someone has the chance.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Make AMDGPU plugin handle empty allocation properly (#142383)</title>
<updated>2025-06-02T13:12:20+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-02T13:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b26baf1779cae380040051932e7134371e3058d3'/>
<id>b26baf1779cae380040051932e7134371e3058d3</id>
<content type='text'>
Summary:
`malloc(0)` and `free(nullptr)` are both defined by the standard but we
current trigger erros and assertions on them. Fix that so this works
with empty arguments.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
`malloc(0)` and `free(nullptr)` are both defined by the standard but we
current trigger erros and assertions on them. Fix that so this works
with empty arguments.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Fix broken tablegen test after #140879 (#141796)</title>
<updated>2025-05-28T16:30:15+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-05-28T16:30:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a1191b48755a8ce651792ba06a430338f41af2f1'/>
<id>a1191b48755a8ce651792ba06a430338f41af2f1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpenMP][GPU][FIX] Enable generic barriers in single threaded contexts (#140786)</title>
<updated>2025-05-21T02:33:54+00:00</updated>
<author>
<name>Johannes Doerfert</name>
<email>johannes@jdoerfert.de</email>
</author>
<published>2025-05-21T02:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=57a90edacdf4ef14c6a95531681e8218cd23c4ab'/>
<id>57a90edacdf4ef14c6a95531681e8218cd23c4ab</id>
<content type='text'>
The generic GPU barrier implementation checked if it was the main thread
in generic mode to identify single threaded regions. This doesn't work
since inside of a non-active (=sequential) parallel, that thread becomes
the main thread of a team, and is not the main thread in generic mode.
At least that is the implementation of the APIs today.

To identify single threaded regions we now check the team size
explicitly.

This exposed three other issues; one is, for now, expected and not a
bug, the second one is a bug and has a FIXME in the
single_threaded_for_barrier_hang_1.c file, and the final one is also
benign as described in the end.

The non-bug issue comes up if we ever initialize a thread state.
Afterwards we will never run any region in parallel. This is a little
conservative, but I guess thread states are really bad for performance
anyway.

The bug comes up if we optimize single_threaded_for_barrier_hang_1 and
execute it in Generic-SPMD mode. For some reason we loose all the
updates to b. This looks very much like a compiler bug, but could also
be another logic issue in the runtime. Needs to be investigated.

Issue number 3 comes up if we have nested parallels inside of a target
region. The clang SPMD-check logic gets confused, determines SPMD (which
is fine) but picks an unreasonable thread count. This is all benign, I
think, just weird:

```
  #pragma omp target teams
  #pragma omp parallel num_threads(64)
  #pragma omp parallel num_threads(10)
  {}
```
Was launched with 10 threads, not 64.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The generic GPU barrier implementation checked if it was the main thread
in generic mode to identify single threaded regions. This doesn't work
since inside of a non-active (=sequential) parallel, that thread becomes
the main thread of a team, and is not the main thread in generic mode.
At least that is the implementation of the APIs today.

To identify single threaded regions we now check the team size
explicitly.

This exposed three other issues; one is, for now, expected and not a
bug, the second one is a bug and has a FIXME in the
single_threaded_for_barrier_hang_1.c file, and the final one is also
benign as described in the end.

The non-bug issue comes up if we ever initialize a thread state.
Afterwards we will never run any region in parallel. This is a little
conservative, but I guess thread states are really bad for performance
anyway.

The bug comes up if we optimize single_threaded_for_barrier_hang_1 and
execute it in Generic-SPMD mode. For some reason we loose all the
updates to b. This looks very much like a compiler bug, but could also
be another logic issue in the runtime. Needs to be investigated.

Issue number 3 comes up if we have nested parallels inside of a target
region. The clang SPMD-check logic gets confused, determines SPMD (which
is fine) but picks an unreasonable thread count. This is all benign, I
think, just weird:

```
  #pragma omp target teams
  #pragma omp parallel num_threads(64)
  #pragma omp parallel num_threads(10)
  {}
```
Was launched with 10 threads, not 64.</pre>
</div>
</content>
</entry>
</feed>
