Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ jobs:
id: build
# Emulate default value for manual dispatch as we've run out of available arguments.
run: cmake --build $GITHUB_WORKSPACE/build --target ${{ inputs.build_target || 'sycl-toolchain' }}
- run: $GITHUB_WORKSPACE/build/bin/clang++ --version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for debugging purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but I'd like to keep this just in case.

- name: check-llvm
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
env:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@ jobs:
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump

get_date:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.get_date.outputs.date }}
steps:
- id: get_date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

ubuntu2204_build:
needs: get_date
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl-linux-build.yml
secrets: inherit
with:
build_cache_root: "/__w/"
build_configure_extra_args: '--hip --cuda'
build_configure_extra_args: '--hip --cuda -DSYCL_BUILD_INFO="Nightly ${{ needs.get_date.outputs.date }}"'
build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest

retention-days: 90
Expand Down Expand Up @@ -183,6 +192,7 @@ jobs:
toolchain_decompress_command: ${{ needs.ubuntu2404_oneapi_build.outputs.toolchain_decompress_command }}

build-win:
needs: get_date
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A similar functionality is used in the tagging process below:

- name: Compute tag
id: tag
run: |
if [ "${{ github.event_name == 'schedule' }}" == "true" ]; then
echo "TAG=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
else
# TODO: Use date of the commit?
echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
fi

I suggest that we unify all places within this workflow file which rely on a date - I think that it is important that the date we put into nightly builds is aligned with tags that we push.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated here 479b59d

uses: ./.github/workflows/sycl-windows-build.yml
if: github.repository == 'intel/llvm'
with:
Expand All @@ -191,7 +201,7 @@ jobs:
# functionality, make sure Linux/Windows names follow the same pattern.
toolchain_artifact_filename: sycl_windows.tar.gz
# Disable the spirv-dis requirement as to not require SPIR-V Tools.
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off -DSYCL_BUILD_INFO="Nightly ${{ needs.get_date.outputs.date }}"
build_target: all

e2e-win:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sycl-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ jobs:
shell: bash
run: |
cmake --build build --target ${{ inputs.build_target }}
- run: build/bin/clang++ --version
- name: check-llvm
if: always() && !cancelled() && contains(inputs.changes, 'llvm')
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ namespace clang {
/// the CL_SYCL_LANGUAGE_VERSION and SYCL_LANGUAGE_VERSION macros.
llvm::SmallVector<std::pair<llvm::StringRef, llvm::StringRef>, 2>
getSYCLVersionMacros(const LangOptions &LangOpts);

/// Retrieves a string representing the Intel SYCL compiler build info.
std::string getSYCLBuildInfo();
}

#endif // LLVM_CLANG_BASIC_VERSION_H
1 change: 1 addition & 0 deletions clang/lib/Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ add_custom_command(OUTPUT "${version_inc}"
"-DLLVM_VC_REVISION=${llvm_vc_revision}"
"-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
"-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
"-DSYCL_BUILD_INFO=${SYCL_BUILD_INFO}"
-P "${generate_vcs_version_script}")

# Mark the generated header as being generated.
Expand Down
8 changes: 8 additions & 0 deletions clang/lib/Basic/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ std::string getClangVendor() {
#endif
}

std::string getSYCLBuildInfo() {
#ifdef SYCL_BUILD_INFO
return SYCL_BUILD_INFO;
#else
return "development";
#endif
}

std::string getClangFullRepositoryVersion() {
std::string buf;
llvm::raw_string_ostream OS(buf);
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2726,6 +2726,7 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
}

void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const {
OS << "Intel SYCL compiler " << getSYCLBuildInfo() << " build based on:\n";
Copy link
Contributor

@mdtoguchi mdtoguchi Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information would only be output via Driver invocation and other usages of getClangFullVersion() would just emit the clang version. Is there any reason to provide a more general version output as opposed to Driver only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, initially I tried to inline this into the getClangFullVersion() function. But, it causes many tests (~50) to fail, so some tweaking is required. On the other hand, the request was to just have this note in clang++ --version. So I decided to avoid additional test changes, as they seem excessive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info - Given that please add a --version test to verify the output is as expected to the Driver LIT tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small lit test to check if the output contains the build info.

if (IsFlangMode()) {
OS << getClangToolFullVersion("flang") << '\n';
} else {
Expand Down
5 changes: 5 additions & 0 deletions llvm/cmake/modules/GenerateVersionFromVCS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ foreach(name IN LISTS NAMES)
append_info(${name} "${revision}" "${repository}")
endforeach()

if(SYCL_BUILD_INFO)
file(APPEND "${HEADER_FILE}.tmp"
"#define SYCL_BUILD_INFO \"${SYCL_BUILD_INFO}\"\n")
endif()

# Copy the file only if it has changed.
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${HEADER_FILE}.tmp" "${HEADER_FILE}")
Expand Down
Loading