diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 707013355aa70..1bad2765f4cb5 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -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 - name: check-llvm if: always() && !cancelled() && contains(inputs.changes, 'llvm') env: diff --git a/.github/workflows/sycl-nightly.yml b/.github/workflows/sycl-nightly.yml index 7647533a8c68c..21ff0a2bcb181 100644 --- a/.github/workflows/sycl-nightly.yml +++ b/.github/workflows/sycl-nightly.yml @@ -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 @@ -183,6 +192,7 @@ jobs: toolchain_decompress_command: ${{ needs.ubuntu2404_oneapi_build.outputs.toolchain_decompress_command }} build-win: + needs: get_date uses: ./.github/workflows/sycl-windows-build.yml if: github.repository == 'intel/llvm' with: @@ -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: diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index f44c2837eae3c..b2381a6cdcb7c 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -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 diff --git a/clang/include/clang/Basic/Version.h b/clang/include/clang/Basic/Version.h index eb2c56f33c66b..a7708497b3dc4 100644 --- a/clang/include/clang/Basic/Version.h +++ b/clang/include/clang/Basic/Version.h @@ -66,6 +66,9 @@ namespace clang { /// the CL_SYCL_LANGUAGE_VERSION and SYCL_LANGUAGE_VERSION macros. llvm::SmallVector, 2> getSYCLVersionMacros(const LangOptions &LangOpts); + + /// Retrieves a string representing the Intel SYCL compiler build info. + std::string getSYCLBuildInfo(); } #endif // LLVM_CLANG_BASIC_VERSION_H diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt index f8749327805fd..2ade68c825e32 100644 --- a/clang/lib/Basic/CMakeLists.txt +++ b/clang/lib/Basic/CMakeLists.txt @@ -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. diff --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp index 84be9bb1d992d..42c7ab3a8353f 100644 --- a/clang/lib/Basic/Version.cpp +++ b/clang/lib/Basic/Version.cpp @@ -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); diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 73e3cc556c0fd..0702b78437bd5 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -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"; if (IsFlangMode()) { OS << getClangToolFullVersion("flang") << '\n'; } else { diff --git a/llvm/cmake/modules/GenerateVersionFromVCS.cmake b/llvm/cmake/modules/GenerateVersionFromVCS.cmake index 1b3b2946e62b2..b4a16d1b640c8 100644 --- a/llvm/cmake/modules/GenerateVersionFromVCS.cmake +++ b/llvm/cmake/modules/GenerateVersionFromVCS.cmake @@ -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}")