-
Notifications
You must be signed in to change notification settings - Fork 792
[SYCL] Improve SYCL library versioning macro #16137
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
base: sycl
Are you sure you want to change the base?
[SYCL] Improve SYCL library versioning macro #16137
Conversation
We have a macro `__SYCL_COMPILER_VERSION` which only corresponds to a date when build was performed - it does not give any indication of the actual compiler version, nor does it give any indication of the actual library build. This patch attempts to deprecate that old macro and replaces it with `__LIBSYCL_TIMESTAMP` which contains a date of the latest commit included into the SYCL library (and therefore SYCL headers) build. Using commit date is more relibable than build date and its naming speicifally refers to library instead of the compiler. "Attempts" above is because it is a bit tricky to deprecate a macro and heavily depends on the compiler which is being used. Not every 3rd-party host compiler is covered, i.e. deprecation message may only be emitted from device compilation pass in certain cases. Resolves intel#2250
|
||
#ifndef __LIBSYCL_TIMESTAMP | ||
#error "__LIBSYCL_TIMESTAMP is expected to be defined by sycl.hpp" | ||
Some weird code to cause compilation error |
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.
Do we need this line? I expect #error
preprocessor directive to emit an error.
# the hash won't be updated. It is not considered to be a problem, because for | ||
# local incremental builds made during the library/headers development the date | ||
# doesn't matter much and we can guarantee it to be always correct when we do | ||
# nightly builds. |
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.
It sounds like you assume that nightly builds
!= incremental builds
. I don't think we have a formal requirement for our CI system like this. Perhaps we can explicitly state that here.
We have a macro
__SYCL_COMPILER_VERSION
which only corresponds to a date when build was performed - it does not give any indication of the actual compiler version, nor does it give any indication of the actual library build.This patch attempts to deprecate that old macro and replaces it with
__LIBSYCL_TIMESTAMP
which contains a date of the latest commit included into the SYCL library (and therefore SYCL headers) build. Using commit date is more relibable than build date and its naming speicifally refers to library instead of the compiler."Attempts" above is because it is a bit tricky to deprecate a macro and heavily depends on the compiler which is being used. Not every 3rd-party host compiler is covered, i.e. deprecation message may only be emitted from device compilation pass in certain cases.
Resolves #2250