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

[SYCL] Disambiguate atomic_ref references #545

Merged
merged 3 commits into from Nov 8, 2021
Merged

[SYCL] Disambiguate atomic_ref references #545

merged 3 commits into from Nov 8, 2021

Conversation

ghost
Copy link

@ghost ghost commented Nov 1, 2021

According to SYCL 2020, the atomic_ref type must become standard and be
placed into the sycl:: namespace. So, when two atomic_ref types are there,
the sycl::atomic_ref and sycl::ext::oneapi::atomic_ref ones, the reference
to atomic_ref will become ambiguous:

SYCL/AtomicRef/sub.h(132,20): error: reference to 'atomic_ref' is ambiguous

To disambiguate the atomic_ref reference, the fully qualified name is used
in the tests.

Signed-off-by: Pavel Samolysov [email protected]

AGindinson
AGindinson previously approved these changes Nov 1, 2021
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.

@ghost
Copy link
Author

ghost commented Nov 1, 2021

I get the following error for llvm-test-suite as well as for intel/llvm:

slm_split_barrier.cpp(71,16): error: cannot initialize a parameter of type 'cl::sycl::ext::intel::experimental::esimd::fence_mask' with an rvalue of type 'cl::sycl::ext::intel::experimental::esimd::EsimdFenceMask'
[2021-11-01T14:27:39.220Z]   esimd::fence(ESIMD_GLOBAL_COHERENT_FENCE);

I'm sure, this PR doesn't touch any ESIMD-related code at all.

@Pennycook
Copy link

I don't understand why we're only testing the sycl::ext::oneapi:: version of atomic_ref. Shouldn't we be testing the version that we want people to use (i.e. sycl::atomic_ref)?

@ghost
Copy link
Author

ghost commented Nov 2, 2021

@Pennycook I'm going to get compilable tests to let the reviewers merge my PR in the compiler that adds sycl::atomic_ref. Then I'll add the tests for sycl::atomic_ref in llvm-test-suite.

steffenlarsen
steffenlarsen previously approved these changes Nov 2, 2021
Copy link

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

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

I'm going to get compilable tests to let the reviewers merge my PR in the compiler that adds sycl::atomic_ref. Then I'll add the tests for sycl::atomic_ref in llvm-test-suite.

Sounds reasonable! LGTM.

@ghost ghost self-requested a review as a code owner November 2, 2021 11:10
@ghost
Copy link
Author

ghost commented Nov 2, 2021

The following code snippet fails in the SYCL/DeprecatedFeatures/kernel_interop.cpp:

  try {
    kernel Kernel(ClKernel, Context1);
  } catch (cl::sycl::invalid_parameter_error e) {
    Pass = true;
  }
  assert(Pass);

I see the control flow never comes in the catch block even though the exception type is changed to the modern sycl::exception as well as just the ellipsis catch (...). I have no idea is it a change in the logic or an issue in the compiler.

@ghost ghost requested review from AGindinson and steffenlarsen November 2, 2021 16:39
AGindinson
AGindinson previously approved these changes Nov 2, 2021
Pavel Samolysov added 3 commits November 3, 2021 10:06
According to SYCL 2020, the atomic_ref type must become standard and be
placed into the sycl:: namespace. So, when two atomic_ref types are there,
the sycl::atomic_ref and sycl::ext::oneapi::atomic_ref ones, the reference
to atomic_ref will become ambiguous:

  SYCL/AtomicRef/sub.h(132,20): error: reference to 'atomic_ref' is ambiguous

To disambiguate the atomic_ref reference, the fully qualified name is used
in the tests.

Signed-off-by: Pavel Samolysov <[email protected]>
Signed-off-by: Pavel Samolysov <[email protected]>
@ghost
Copy link
Author

ghost commented Nov 3, 2021

@steffenlarsen @Pennycook @AGindinson I've rebased the tests on the updated intel branch to solve problems with pre-ci-linux check. All the checks have passed. Could you review the PR again and merge it if it is possible? Thanks.

@vladimirlaz vladimirlaz merged commit 0e6f7a2 into intel:intel Nov 8, 2021
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Apr 12, 2022
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
According to SYCL 2020, the atomic_ref type must become standard and be
placed into the sycl:: namespace. So, when two atomic_ref types are there,
the sycl::atomic_ref and sycl::ext::oneapi::atomic_ref ones, the reference
to atomic_ref will become ambiguous:

  SYCL/AtomicRef/sub.h(132,20): error: reference to 'atomic_ref' is ambiguous

To disambiguate the atomic_ref reference, the fully qualified name is used
in the tests.

Signed-off-by: Pavel Samolysov <[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.

4 participants