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

[SYCL] Rely on automatic enabling of native/emulated FP atomics #308

Merged
merged 2 commits into from
Jun 10, 2021

Conversation

AGindinson
Copy link

After OpenCL CPU support of SPV_EXT_shader_atomic_float_* has arrived,
the compiler is switched to defining the SYCL_USE_NATIVE_FP_ATOMICS
internally for non-FPGA, non-NVPTX targets. Any further compiler changes
that may come after NVPTX/FPGA HW support lands will not require test
change, as the guarantee will remain that correct (native or emulated)
versions of FP atomic functions get emitted and executed by the HW.

Signed-off-by: Artem Gindinson [email protected]

Artem Gindinson added 2 commits June 2, 2021 18:59
After OpenCL CPU support of SPV_EXT_shader_atomic_float_* has arrived,
the compiler is switched to defining the SYCL_USE_NATIVE_FP_ATOMICS
internally for non-FPGA, non-NVPTX targets. Any further compiler changes
that may come after NVPTX/FPGA HW support lands will not require test
change, as the guarantee will remain that correct (native or emulated)
versions of FP atomic functions get emitted and executed by the HW.

Signed-off-by: Artem Gindinson <[email protected]>
@AGindinson AGindinson force-pushed the native-fp-atomics branch from ba2eda4 to 96d031c Compare June 2, 2021 16:00
@AGindinson AGindinson changed the title Rely on automatic enabling of native/emulated FP atomics [SYCL] Rely on automatic enabling of native/emulated FP atomics Jun 2, 2021
@AGindinson AGindinson marked this pull request as ready for review June 9, 2021 07:03
@AGindinson
Copy link
Author

This tests intel/llvm#3869. This change to the test suite needs to be merged first so that the compiler PR can be verified based off that; the effect will be that until the compiler PR is merged, native atomic functionality will not be tested.

Copy link

@bader bader left a comment

Choose a reason for hiding this comment

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

  1. Why do you remove tests testing emulated workflow? I think it's still useful for the target that do not support FP atomics natively.
  2. How do you know that tests pass because FP atomics are supported natively and not emulated? I don't see any checks for that. The test just verifies that FP atomics are functional.

Comment on lines 2 to +4
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
Copy link

Choose a reason for hiding this comment

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

What is the reason for this reordering?

Copy link
Author

Choose a reason for hiding this comment

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

This is the issue with how Git concatenates the two commits of this PR (the actual changes w/ deleted/moved files). It may be easier to review the actual changes by looking at f66a122 specifically - the reordering would not be shown there.

@AGindinson
Copy link
Author

Why do you remove tests testing emulated workflow? I think it's still useful for the target that do not support FP atomics natively.

Once the tested compiler PR is merged, this is exactly what will be happening - CUDA and FPGA will be tested with emulated FP atomic functions, while SPIR/CPU/Intel GPU compilations will receive the SYCL_USE_NATIVE_FP_ATOMICS macro automatically. The point here is to delegate the configuration of native vs. emulated atomics to the compiler driver, and not to the end user.

How do you know that tests pass because FP atomics are supported natively and not emulated? I don't see any checks for that. The test just verifies that FP atomics are functional.

The driver PR that is being tested by these changes will ensure that; the driver unit tests verify that the macro is passed for the targets that support the functionality. That said, please note my earlier comment: the test coverage will, in fact, be temporarily reduced to "just functional verficiation" until the compiler changes come into effect.

@AGindinson AGindinson requested a review from bader June 9, 2021 11:11
@AGindinson
Copy link
Author

@bader, could you please revisit the PR and merge if the approach looks good?

@bader bader merged commit 5308b10 into intel:intel Jun 10, 2021
@AGindinson AGindinson deleted the native-fp-atomics branch June 15, 2021 14:50
smaslov-intel pushed a commit to smaslov-intel/llvm-test-suite that referenced this pull request Aug 12, 2021
…l#308)

After OpenCL CPU support of SPV_EXT_shader_atomic_float_* has arrived,
the compiler is switched to defining the SYCL_USE_NATIVE_FP_ATOMICS
internally for non-FPGA, non-NVPTX targets. Any further compiler changes
that may come after NVPTX/FPGA HW support lands will not require test
change, as the guarantee will remain that correct (native or emulated)
versions of FP atomic functions get emitted and executed by the HW.

Signed-off-by: Artem Gindinson <[email protected]>
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Apr 12, 2022
After removal of program class tests were updated in scope of
intel#474. The commit was cherrypicked to xmain
in scope of intel#266. The files removal was missed during cherry pick.
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…l/llvm-test-suite#308)

After OpenCL CPU support of SPV_EXT_shader_atomic_float_* has arrived,
the compiler is switched to defining the SYCL_USE_NATIVE_FP_ATOMICS
internally for non-FPGA, non-NVPTX targets. Any further compiler changes
that may come after NVPTX/FPGA HW support lands will not require test
change, as the guarantee will remain that correct (native or emulated)
versions of FP atomic functions get emitted and executed by the HW.

Signed-off-by: Artem Gindinson <[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