Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Split AtomicRef 64-bit tests into separate files #436

Merged

Conversation

steffenlarsen
Copy link

@steffenlarsen steffenlarsen commented Sep 1, 2021

Some devices do not support 64-bit atomics, in which case most AtomicRef tests would fail due to them assuming 64-bit atomics being available.

The availability of 64-bit atomics can be queried in SYCL 2020 using aspect::atomic64. However, the generated device code will fail to compile if there exists any kernels using 64-bit atomics, even if the test intents to skip testing said kernel.

To circumvent this, all AtomicRef tests that previously mixed 64-bit atomics with smaller atomic operations are split into two test files, one with non-64-bit atomics and one with only the 64-bit atomics. The latter test is skipped if the selected device does not have aspect::atomic64.

Likewise, the atomic memory order test is further split into tests for each of the tested atomic memory orderings. This is also to avoid invalid instructions in the generated device code on devices that do not support the corresponding atomic memory order.

Additionally, affected AtomicRef tests are now also run on accelerators.

Change summary:

  • AtomicRef tests for 64-bit atomics are split into separate test files guarded by a check if the used device has aspect::atomic64.
  • SYCL/AtomicRef/atomic_memory_order.cpp is further split into separate files testing memory_order::acq_rel and memory_order::seq_cst.
  • All AtomicRef tests changed in this commit will now run on accelerators.

Note: Check for aspect::atomic64 on devices is currently only implemented for the CUDA backend, so the 64-bit atomic tests are not run on any other backend until correct responses are implemented for aspect::atomic64 on other backends.

Some devices do not support 64-bit atomics, in which case most AtomicRef
tests would fail due to them assuming 64-bit atomics being available.

The availability of 64-bit atomics can be queried in SYCL 2020 using
`aspect::atomic64`. However, the generated device code will fail to
compile if there exists any kernels using 64-bit atomics, even if the
test intents to skip testing said kernel.

To circumvent this, all AtomicRef tests that previously mixed 64-bit
atomics with smaller atomic operations are split into two test files,
one with non-64-bit atomics and one with only the 64-bit atomics. The
latter test is skipped if the selected device does not have
`aspect::atomic64`.

Likewise, the atomic memory order test is further split into tests for
each of the tested atomic memory orderings. This is also to avoid
invalid instructions in the generated device code on devices that do not
support the corresponding atomic memory order.

Additionally, affected AtomicRef tests are also run on accelerators.

Change summary:
 * AtomicRef tests for 64-bit atomics are split into separate test files
   guarded by a check if the used device has `aspect::atomic64`.
 * SYCL/AtomicRef/atomic_memory_order.cpp is further split into separate
   files testing `memory_order::acq_rel` and `memory_order::seq_cst`.
 * All AtomicRef tests changed in this commit will now run on
   accelerators.

Signed-off-by: Steffen Larsen <[email protected]>
Signed-off-by: Steffen Larsen <[email protected]>
Signed-off-by: Steffen Larsen <[email protected]>
Copy link

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; special kudos for the PR description!

@vladimirlaz vladimirlaz merged commit b405c81 into intel:intel Sep 2, 2021
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…est-suite#436)

* [SYCL] Split AtomicRef 64-bit tests into separate files

Some devices do not support 64-bit atomics, in which case most AtomicRef
tests would fail due to them assuming 64-bit atomics being available.

The availability of 64-bit atomics can be queried in SYCL 2020 using
`aspect::atomic64`. However, the generated device code will fail to
compile if there exists any kernels using 64-bit atomics, even if the
test intents to skip testing said kernel.

To circumvent this, all AtomicRef tests that previously mixed 64-bit
atomics with smaller atomic operations are split into two test files,
one with non-64-bit atomics and one with only the 64-bit atomics. The
latter test is skipped if the selected device does not have
`aspect::atomic64`.

Likewise, the atomic memory order test is further split into tests for
each of the tested atomic memory orderings. This is also to avoid
invalid instructions in the generated device code on devices that do not
support the corresponding atomic memory order.

Additionally, affected AtomicRef tests are also run on accelerators.

Change summary:
 * AtomicRef tests for 64-bit atomics are split into separate test files
   guarded by a check if the used device has `aspect::atomic64`.
 * SYCL/AtomicRef/atomic_memory_order.cpp is further split into separate
   files testing `memory_order::acq_rel` and `memory_order::seq_cst`.
 * All AtomicRef tests changed in this commit will now run on
   accelerators.

Signed-off-by: Steffen Larsen <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants