-
Notifications
You must be signed in to change notification settings - Fork 787
[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
[SYCL] Refactor C++14 support #4303
Conversation
romanovvlad
commented
Aug 10, 2021
- Modified some constructs to avoid using C++17 features
- Fixed the test to better check support of different C++ versions
- Fixed several compiler warnings
- Add a warning(message) if headers are compiled in <= C++17 mode
1. Modified some constructs to avoid using C++17 features 2. Fixed the test to better check support of different C++ versions 3. Fixed several compiler warnings 4. Add a warning(message) if headers are compiled in <= C++17 mode
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.
just a couple of less-helpful comments, I don't see anything in the C++ code that sticks out as incorrect.
@@ -79,8 +79,8 @@ namespace detail { | |||
// | |||
// 0x00000001 - CG type KERNEL version 0 | |||
// 0x01000001 - CG type KERNEL version 1 | |||
// /\ |
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.
@@ -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 comment
The 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.
/summary:run |
/summary:run |
// 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 | ||
// expected-no-diagnostics | ||
// RUN: %clangxx -std=c++14 -fsycl -Wall -pedantic -Wno-c99-extensions -Wno-deprecated -fsyntax-only -Xclang -verify=expected,cxx14 %s -c -o %t.out |
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.
Planning to unify/merge with sycl/test/warnings/warnings.cpp
in a separate PR.
/summary:run |
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
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.
sycl/doc/PreprocessorMacros.md changes lgtm
@@ -179,31 +179,29 @@ struct KernelLambdaHasKernelHandlerArgT { | |||
// Helpers for running kernel lambda on the host device | |||
|
|||
template <typename KernelType> | |||
typename detail::enable_if_t< | |||
KernelLambdaHasKernelHandlerArgT<KernelType>::value, void> | |||
typename std::enable_if_t<KernelLambdaHasKernelHandlerArgT<KernelType>::value> |
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 believe the keyword 'typename' is not required when you use std::enable_if_t, but Ok. Thank you for the additional changes anyway.