-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add SYCL version check #989
base: main
Are you sure you want to change the base?
Add SYCL version check #989
Conversation
tests/header/header_test.cpp
Outdated
@@ -45,6 +45,7 @@ class TEST_NAME : public util::test_base { | |||
#define TEST_FAIL | |||
log.note("SYCL_LANGUAGE_VERSION not present"); | |||
#else | |||
static_assert(SYCL_LANGUAGE_VERSION, "202012L"); |
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.
Shouldn't this be something like:
static_assert(SYCL_LANGUAGE_VERSION == 202012L)
Followed by a check that the type is really long
.
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.
Agree, fixed
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.
Followed by a check that the type is really
long
.
Something like:
static_assert(std::is_same_v<decltype(SYCL_LANGUAGE_VERSION), long>);
tests/header/header_test.cpp
Outdated
@@ -45,6 +45,7 @@ class TEST_NAME : public util::test_base { | |||
#define TEST_FAIL | |||
log.note("SYCL_LANGUAGE_VERSION not present"); | |||
#else | |||
static_assert(SYCL_LANGUAGE_VERSION, "202012L"); | |||
log.note("SYCL_LANGUAGE_VERSION = %d", static_cast<int>(SYCL_LANGUAGE_VERSION)); |
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 log message is still useful since we are now checking for a specific 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.
As for me, we can remove this log message due to static_assert.
Ping |
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.
Thanks.
By the way, it is better to write SYCL in uppercase everywhere, even in the commit messages.
Check of SYCL version was added according to agreement, see details:
KhronosGroup/SYCL-Docs#634