Skip to content

[SYCL] Make __SYCL_COMPILER_VERSION reproducible #19692

@blenderfreaky

Description

@blenderfreaky

Is your feature request related to a problem? Please describe

Currently, __SYCL_COMPILER_VERSION is defined like this:

sycl/CMakeLists.txt:191:

string(TIMESTAMP __SYCL_COMPILER_VERSION "%Y%m%d")

meaning it is set to the date of compilation. If you compile an old version now, it will over-report its version. Similarly, if the system date is in the past, it will under-report (for example when building in a Nix sandbox, when it is always set to Unix Epoch for reproducibility).

In programs that check #if (__SYCL_COMPILER_VERSION < ...) (like in oneDNN), this may cause incorrect behavior.

Describe the solution you would like

Determine the date through another method. Some ideas:

  • Use git to check the date of the latest commit
  • Have some auto-updated file with the current date
  • Set it via a CMake flag, which CI fills in

Describe alternatives you have considered

n/a

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions