Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][CI] Enable sccache on Windows #5589

Merged
merged 3 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[SYCL][CI] Enable sccache on Windows
  • Loading branch information
Alexander Batashev committed Feb 16, 2022
commit aac04321101103f3b1848940b47705985df1cd27
6 changes: 6 additions & 0 deletions .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ jobs:
build_artifact_suffix: "default"
build_cache_suffix: "default"
lts_config: "hip_amdgpu;ocl_x64;ocl_gen9;l0_gen9"

# TODO testing only, remove
windows_default:
name: Windows (experimental)
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_windows_build_and_test.yml
6 changes: 5 additions & 1 deletion .github/workflows/sycl_windows_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
run: |
choco install -y cuda --version 11.6.0.51123
choco install -y ninja
choco install -y sccache --version 0.2.15
refreshenv
echo CUDA_PATH=%CUDA_PATH%
echo CUDA_PATH=%CUDA_PATH% >> %GITHUB_ENV%
Expand Down Expand Up @@ -49,13 +50,16 @@ jobs:
--cmake-opt="-DCMAKE_C_COMPILER=cl" ^
--cmake-opt="-DCMAKE_CXX_COMPILER=cl" ^
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" ^
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=sccache" ^
--cuda
- name: Build
shell: cmd
env:
CUDA_PATH: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
CUDA_TOOLKIT_ROOT_DIR: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6'
run: |
cmake --build build --target sycl
cmake --build build --target sycl-toolchain
alexbatashev marked this conversation as resolved.
Show resolved Hide resolved
- name: Install
shell: cmd
Expand All @@ -64,4 +68,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: sycl_windows_default
path: install/**/*
path: install/**/*
18 changes: 17 additions & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,23 @@ if(MSVC)
include(LLVMCheckLinkerFlag)
llvm_check_linker_flag(CXX "/DEBUG" LINKER_SUPPORTS_DEBUG)
if(LINKER_SUPPORTS_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")
# sccache is not compatible with /Zi flag
if (CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "sccache")
# CMake may put /Zi by default
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Z7")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")
endif()
add_link_options("/DEBUG")

# Enable unreferenced removal and ICF in Release mode.
Expand Down