Skip to content

Conversation

AlexeySachkov
Copy link
Contributor

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

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
Copy link
Contributor

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.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SYCL] Improve SYCL library versioning mechanism

2 participants