Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -183,6 +183,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')
run: |
Expand Down
28 changes: 26 additions & 2 deletions .github/workflows/sycl-rel-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,40 @@ name: SYCL Release Branch Nightly

on:
workflow_dispatch:
inputs:
sycl_build_info:
Copy link
Contributor

Choose a reason for hiding this comment

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

should we set type and required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are string and false accordingly by-default

Copy link
Contributor

Choose a reason for hiding this comment

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

cool didnt know that

description: |
Compiler build info, e.g. "X.Y.Z release"


permissions: read-all

jobs:
get_build_info:
runs-on: ubuntu-latest
outputs:
info: ${{ steps.get_info.outputs.info }}
steps:
# TODO: version detection can be automated, e.g. by using branch name.
- id: get_info
run: |
if [ -n "${{ inputs.sycl_build_info }}" ]; then
echo "info=${{ inputs.sycl_build_info }}" >> $GITHUB_OUTPUT
else
date=$(date +'%Y-%m-%d')
version="6.3.0"
info="Nightly $date $version pre-release"
echo "info=$info" >> $GITHUB_OUTPUT
fi

ubuntu2204_build:
needs: get_build_info
uses: ./.github/workflows/sycl-linux-build.yml
secrets: inherit
with:
build_cache_root: "/__w/"
build_artifact_suffix: default
build_configure_extra_args: '-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_LIBDIR=lib --disable-jit --no-assertions --add_security_flags=sanitize --hip --cuda'
build_configure_extra_args: '-DSYCL_BUILD_INFO="${{ needs.get_build_info.outputs.info }}" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_LIBDIR=lib --disable-jit --no-assertions --add_security_flags=sanitize --hip --cuda'
build_image: ghcr.io/intel/llvm/release_build:latest
pack_release: 'true'

Expand Down Expand Up @@ -78,9 +101,10 @@ jobs:
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}

build-win:
needs: get_build_info
uses: ./.github/workflows/sycl-windows-build.yml
with:
build_configure_extra_args: '-DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off -DCMAKE_POSITION_INDEPENDENT_CODE=ON --disable-jit --no-assertions --add_security_flags=sanitize'
build_configure_extra_args: '-DSYCL_BUILD_INFO="${{ needs.get_build_info.outputs.info }}" -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off -DCMAKE_POSITION_INDEPENDENT_CODE=ON --disable-jit --no-assertions --add_security_flags=sanitize'
pack_release: 'true'

# We upload both Linux/Windows build via Github's "Releases"
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 @@ -153,6 +153,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 @@ -2825,6 +2825,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 {
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Driver/sycl-build-info.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// RUN: %clang --version 2>&1 | FileCheck %s

// CHECK: Intel SYCL compiler{{.*}}based on:
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