Skip to content

[SYCL] Deprecate sycl::atomics in SYCL 2020 mode #5440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Feb 3, 2022
Merged

[SYCL] Deprecate sycl::atomics in SYCL 2020 mode #5440

merged 26 commits into from
Feb 3, 2022

Conversation

IgorKharchikov
Copy link
Contributor

Explicitly marked class cl::sycl::atomic as deprecated to meet an ad hoc requirement of new SYCL standard.

IgorKharchikov and others added 21 commits January 14, 2022 21:20
Redefinition of default constructor image_accessor() (previously used "= default") to make it possible to use const references in parallel_for.
Reduced ad hoc test file.
Created new test for fixed issue with mismatched namespace for ctz function.
[SYCL]Created regression test for ctz fix
…ed_tests

Revert "[SYCL]Created regression test for ctz fix"
Reduced test file so it contains only func() function, edited commented line for test running.
Edited commented line for testing, corrected typos in code.
Removed SYCL_EXTERNAL attribute due to it's unnecessity in this test (parallel_for is used here).
cl::sycl::atomic was marked as deprecated to meet new SYCL standart.
@IgorKharchikov IgorKharchikov requested a review from a team as a code owner January 31, 2022 23:32
vladimirlaz
vladimirlaz previously approved these changes Feb 1, 2022
@bader bader changed the title [SYCL] Marked sycl::atomics as deprecated [SYCL] Deprecate sycl::atomics in SYCL 2020 mode Feb 2, 2022
@bader
Copy link
Contributor

bader commented Feb 2, 2022

Just out of curiosity. What are following commands doing in the test:

// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2017 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out
// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=1.2.1 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out

I would expect that they are added to check that the compiler doesn't emit any errors or warnings in SYCL 1.2.1 mode, but I don't see any checks for that. @vladimirlaz, could you clarify, please?

BTW, I think one of them must be removed. There is a driver check that -sycl-std=1.2.1 and -sycl-std=2017 work the same, so using both is unnecessary.

@IgorKharchikov
Copy link
Contributor Author

@bader, as far as I am concerned, -sycl-std args are to explicitly mark the version of the compiler, with which the syntax shall be checked, additionally ignoring notes, if any (due to -verify-ignore-unexpected=note). Is that right? In addition, I understand that this may be redundant here, as deprecations from this list must appear only in 2020, but I am still not sure.

@bader
Copy link
Contributor

bader commented Feb 2, 2022

-sycl-std args are to explicitly mark the version of the compiler

It's not the version of the compiler, but the version of the SYCL standard the compiler should comply with.

The test does four compilations and two of the are obviously redundant.
One of two (that are supposed to be useful) doesn't seem to work as intended, but I'm not sure about that, so I'd like @vladimirlaz to confirm if my concern is valid.

@bader
Copy link
Contributor

bader commented Feb 3, 2022

@vladimirlaz, ping.
@alexbatashev, do you know how the test is supposed to work?

@alexbatashev
Copy link
Contributor

@bader this isn't how this test looked like when it was created. Originally, it was using -Werror to check, that there're no warnings for SYCL 1.2.1. That was changed with this commit 8445dc1

@vladimirlaz
Copy link
Contributor

I would expect that they are added to check that the compiler doesn't emit any errors or warnings in SYCL 1.2.1 mode, but I don't see any checks for that. @vladimirlaz, could you clarify, please?

I have the same expectations.

@bader
Copy link
Contributor

bader commented Feb 3, 2022

I would expect that they are added to check that the compiler doesn't emit any errors or warnings in SYCL 1.2.1 mode, but I don't see any checks for that. @vladimirlaz, could you clarify, please?

I have the same expectations.

Cool. Do you agree that test does exactly the opposite and checks that warnings are emitted for SYCL-1.2.1?

@vladimirlaz
Copy link
Contributor

yes.
It is reasonable to update the test to make sure that no warning is emitted when -sycl-std=2020 is specified and is not emitted when if is not specific.
But it is out of the scope of the PR. It can be done separately.

@bader
Copy link
Contributor

bader commented Feb 3, 2022

Okay. I would prefer to remove lines 2-4 within this PR and add a check for "no warnings" in a separate PR. Does it sound okay to everyone?

@IgorKharchikov
Copy link
Contributor Author

@bader, ok, I will do it right now, but just to put it clear: only the first //RUN string shall remain, right?

Copy link
Contributor

@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.

only the first //RUN string shall remain, right?

Right. Thanks.

@bader
Copy link
Contributor

bader commented Feb 3, 2022

yes. It is reasonable to update the test to make sure that no warning is emitted when -sycl-std=2020 is specified and is not emitted when if is not specific. But it is out of the scope of the PR. It can be done separately.

It's very surprising.

// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2017 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out
// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=1.2.1 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out

These two checks are successfully passing i.e. the compiler emits warnings in SYCL 1.2.1 mode.

@bader bader merged commit 52fad5a into intel:sycl Feb 3, 2022
alexbatashev added a commit to alexbatashev/llvm that referenced this pull request Feb 5, 2022
* upstream/sycl: (3571 commits)
  [ESIMD] Doxygen update part III - core APIs. (intel#5472)
  [SYCL][DOC] Move proposed FPGA extensions (intel#5453)
  [SYCL] Add -fsycl-fp32-prec-sqrt flag (intel#5309)
  [SYCL] Emit program build logs for warning levels >= 2 (intel#5319)
  [SYCL] Add clang support for code_location in KernelInfo (intel#5335)
  [SYCL][Doc] Move FPGA extensions (intel#5470)
  [ESIMD] Fix public simd and simd_view APIs. (intel#5465)
  [SYCL] Deprecate sycl::atomics in SYCL 2020 mode (intel#5440)
  [SYCL] Add unit test for PR 5414 (intel#5450)
  [XPTI] Allow arbitrary data types in metadata (intel#4998)
  [SYCL][DOC] Move discard queue events to supported (intel#5452)
  [Driver][SYCL] Initial support for allowing fat static -lname processing (intel#5413)
  [SYCL] Fix dead pointer usage if leaf buffer overflows (intel#5417)
  [SYCL][L0] Fix memory leak in USM prefetch (intel#5461)
  [SYCL][Doc] Add new free function queries proposal (intel#5106)
  [SYCL][ESIMD] Update vc-intrinsics deps to the top of the trunk (intel#5460)
  [SYCL][DOC] Move old spec constant extension spec (intel#5456)
  [SYCL][DOC] Move deprecated extensions (intel#5458)
  [SYCL][DOC] Fix links to old SubGroupMask doc (intel#5459)
  [ESIMD] Doxygen update part II - memory APIs. (intel#5443)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants