-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Deprecate syclcompat #19861
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
[SYCL] Deprecate syclcompat #19861
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Test to verify that syclcompat namespace and APIs generate deprecation | ||
// warnings. | ||
|
||
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -Wall -Wextra | ||
|
||
#include <syclcompat/syclcompat.hpp> | ||
|
||
int main() { | ||
// Test deprecated namespace | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::dim3 grid(1, 1, 1); | ||
|
||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
auto queue = syclcompat::get_default_queue(); | ||
|
||
// Test deprecated memory APIs | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
void *ptr = syclcompat::malloc(1024); | ||
|
||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::free(ptr); | ||
|
||
// Test deprecated utility APIs | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
auto device_count = syclcompat::device_count(); | ||
|
||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::wait(); | ||
|
||
// Test deprecated atomic APIs | ||
int value = 42; | ||
int operand = 10; | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::atomic_fetch_add(&value, operand); | ||
|
||
// Test deprecated math APIs | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
auto result = syclcompat::max(1, 2); | ||
|
||
// Test deprecated device APIs | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::device_info info; | ||
|
||
// Test deprecated experimental APIs | ||
// expected-warning@+1{{'syclcompat' is deprecated}} | ||
syclcompat::experimental::launch_policy my_config( | ||
sycl::nd_range<1>{{32}, {32}}); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that this isn't of much help as SYCL headers are treated as system headers and warnings are suppressed from them. Another option is to use
#warning
instead of pragma but not all MSVC versions support #warning, as it's a C++23 feature.@aelovikov-intel suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how that's an issue: https://godbolt.org/z/YG75Kx5rE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this Godbolt accurately describes our compilation toolchain. I was debugging the failure in the new test I added (
sycl/test/syclcompat/warnings_deprecated_msvc.cpp
) and that when I found that no warning is being thrown for MSVC. Instead of including the header via-fsycl
, if I explicitly include the header-I
, then the warning is thrown properly (so the problem isn't with macros).I also saw that we faced the same problem in #6808 as well.
In clang driver, do you know if we explicitly suppress warnings from system headers somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What warning? On the
namespace syclcompat
?pragma message
isn't a warning, just a message.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. The problem was with
clang-cl
's imitation of MSVC's option. See https://godbolt.org/z/96aG1K1G8 - clang-cl's interpretation of/external:W0
is different from that of MSVC and the clang-cl also disables pragma messages with/external:W0
.Also, clang-cl, unlike MSVC, do not ignore
[[deprecated]]
attribute and so, I've modifiedwarnings_deprecated.cpp
test to also run on windows.