-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Enable builds on macOS host (#6706)
This patch contains minimal changes to make compiler toolchain builds succeed on macOS: - Add stubs for platform-dependent functions - Disable level zero plugin for macOS exclusively - Fix platform-dependent library names - Remove get_device_count_by_type tool (which is unused, and rather than fixing it, removal is much simpler) - Add minimal CI in post-commit to prevent build breakages in future The above changes are far from fully working SYCL on Darwin targets, this patch only fixes toolchain builds, and does not attempt to make the toolchain itself functional. Fixes #258 Fixes #982
- Loading branch information
1 parent
1d8a6d6
commit 60c634c
Showing
15 changed files
with
165 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Reusable SYCL macOS build and test workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
build_ref: | ||
type: string | ||
required: false | ||
build_cache_suffix: | ||
type: string | ||
required: false | ||
default: "default" | ||
build_cache_size: | ||
type: string | ||
required: false | ||
default: 2G | ||
build_configure_extra_args: | ||
type: string | ||
required: false | ||
default: "" | ||
build_artifact_suffix: | ||
type: string | ||
required: false | ||
default: "default" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: macos-12 | ||
steps: | ||
- name: Install dependencies | ||
run: brew install ccache ninja | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.build_ref }} | ||
path: src | ||
- uses: actions/cache@v3 | ||
with: | ||
path: build_cache_${{ inputs.build_cache_suffix }} | ||
key: sycl-${{ runner.os }}-${{ inputs.build_cache_suffix }}-${{ github.sha }} | ||
restore-keys: sycl-${{ runner.os }}-${{ inputs.build_cache_suffix }}- | ||
- name: Configure | ||
env: | ||
CACHE_SUFFIX: ${{ inputs.build_cache_suffix }} | ||
CACHE_SIZE: ${{ inputs.build_cache_size }} | ||
ARGS: ${{ inputs.build_configure_extra_args }} | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/build_cache_$CACHE_SUFFIX | ||
mkdir -p $GITHUB_WORKSPACE/build | ||
cd $GITHUB_WORKSPACE/build | ||
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ | ||
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \ | ||
--ci-defaults $ARGS \ | ||
--cmake-opt="-DLLVM_CCACHE_BUILD=ON" \ | ||
--cmake-opt="-DLLVM_CCACHE_DIR=$GITHUB_WORKSPACE/build_cache_$CACHE_SUFFIX" \ | ||
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" \ | ||
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \ | ||
--cmake-opt="-DSYCL_PI_TESTS=OFF" | ||
- name: Compile | ||
id: build | ||
run: cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain | ||
- name: Install | ||
run: | | ||
cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain | ||
- name: Pack toolchain | ||
run: tar -cJf llvm_sycl.tar.xz -C $GITHUB_WORKSPACE/build/install . | ||
- name: Upload toolchain | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: sycl_macos_${{ inputs.build_artifact_suffix }} | ||
path: llvm_sycl.tar.xz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.