-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Refactor C++14 support #4303
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
romanovvlad
merged 13 commits into
intel:sycl
from
romanovvlad:private2/vromanov/GuardingCPP17
Sep 24, 2021
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c0fc6dd
[SYCL] Refactor C++14 support
romanovvlad 063a9b5
Minor fixes
romanovvlad 54b4b2e
Merge remote-tracking branch 'public/sycl' into private2/vromanov/Gua…
romanovvlad 626b9a1
fix header
romanovvlad 5e19563
Merge remote-tracking branch 'public/sycl' into private2/vromanov/Gua…
romanovvlad 041cec1
Fixed after merge
romanovvlad d40ac3a
revert unnecessary change
romanovvlad 59f8cab
clang-format
romanovvlad 2dd073f
Fix test
romanovvlad cfbd569
Merge remote-tracking branch 'public/sycl' into private2/vromanov/Gua…
romanovvlad 03f0e79
Adjust for windows
romanovvlad 97b4e80
Address comments
romanovvlad ef92812
Update sycl/doc/PreprocessorMacros.md
romanovvlad 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,9 @@ | |
#endif | ||
|
||
#ifndef __SYCL_DEPRECATED | ||
#ifndef SYCL_DISABLE_DEPRECATION_WARNINGS | ||
// The deprecated attribute is not supported in some situations(e.g. namespace) | ||
// in C++14 mode | ||
#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS) && __cplusplus >= 201703L | ||
romanovvlad marked this conversation as resolved.
Show resolved
Hide resolved
romanovvlad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#define __SYCL_DEPRECATED(message) [[deprecated(message)]] | ||
#else // SYCL_DISABLE_DEPRECATION_WARNINGS | ||
#define __SYCL_DEPRECATED(message) | ||
|
@@ -90,7 +92,7 @@ | |
// define __SYCL_WARNING convenience macro to report compiler warnings | ||
#if defined(__GNUC__) | ||
#define __SYCL_GCC_PRAGMA(x) _Pragma(#x) | ||
#define __SYCL_WARNING(msg) __SYCL_GCC_PRAGMA(GCC warning msg) | ||
#define __SYCL_WARNING(msg) __SYCL_GCC_PRAGMA(message msg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified it to the message to align with definitions of this macro for other environments(clang, msvc). The name of the macro seems to be incorrect though. |
||
#elif defined(_MSC_VER) && !defined(__clang__) | ||
#define __SYCL_QUOTE1(x) #x | ||
#define __SYCL_QUOTE(x) __SYCL_QUOTE1(x) | ||
|
@@ -100,3 +102,10 @@ | |
// clang emits "warning:" in the message pragma output | ||
#define __SYCL_WARNING(msg) __pragma(message(msg)) | ||
#endif // __GNUC__ | ||
|
||
// Emitting a message instead of a warning here in order to avoid hard error | ||
romanovvlad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// if an app is compiled with "-werror" option. | ||
#if !defined(SYCL_DISABLE_CPP_VERSION_CHECK_MESSAGE) && __cplusplus < 201703L | ||
__SYCL_WARNING("DPCPP does not support C++ version earlier than C++17. Some " | ||
"features might not be available.") | ||
#endif |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out | ||
// RUN: %clangxx -fsycl -std=c++14 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out | ||
// RUN: %clangxx -fsycl -std=c++17 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out | ||
// RUN: %clangxx -fsycl -std=c++20 -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note,warning %s -c -o %t.out | ||
// RUN: %clangxx -fsycl --no-system-header-prefix=CL/sycl -Wall -pedantic -Wno-c99-extensions -Wno-deprecated -fsyntax-only -Xclang -verify %s -c -o %t.out | ||
// RUN: %clangxx -std=c++14 -fsycl --no-system-header-prefix=CL/sycl -Wall -pedantic -Wno-c99-extensions -Wno-deprecated -fsyntax-only -Xclang -verify %s -c -o %t.out | ||
// RUN: %clangxx -std=c++17 -fsycl --no-system-header-prefix=CL/sycl -Wall -pedantic -Wno-c99-extensions -Wno-deprecated -fsyntax-only -Xclang -verify %s -c -o %t.out | ||
// RUN: %clangxx -std=c++20 -fsycl --no-system-header-prefix=CL/sycl -Wall -pedantic -Wno-c99-extensions -Wno-deprecated -fsyntax-only -Xclang -verify %s -c -o %t.out | ||
// expected-no-diagnostics | ||
|
||
#include <CL/sycl.hpp> |
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.
GCC complained about multi line comments.