-
Notifications
You must be signed in to change notification settings - Fork 773
[SYCL] Enable builds on macOS host #6706
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
Changes from all commits
1d8195f
ebba710
74b1b54
a2a2ba3
2f58e00
75cd185
e626c32
fe28b85
600b013
e246618
d278617
71a55cb
f2082ac
804b3d0
a65b4d4
4905ff1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
bader marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
bader marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- 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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,12 +67,20 @@ bool trace(TraceLevel level); | |
#define __SYCL_CUDA_PLUGIN_NAME "pi_cuda.dll" | ||
#define __SYCL_ESIMD_EMULATOR_PLUGIN_NAME "pi_esimd_emulator.dll" | ||
#define __SYCL_HIP_PLUGIN_NAME "libpi_hip.dll" | ||
#else | ||
#elif defined(__SYCL_RT_OS_LINUX) | ||
#define __SYCL_OPENCL_PLUGIN_NAME "libpi_opencl.so" | ||
#define __SYCL_LEVEL_ZERO_PLUGIN_NAME "libpi_level_zero.so" | ||
#define __SYCL_CUDA_PLUGIN_NAME "libpi_cuda.so" | ||
#define __SYCL_ESIMD_EMULATOR_PLUGIN_NAME "libpi_esimd_emulator.so" | ||
#define __SYCL_HIP_PLUGIN_NAME "libpi_hip.so" | ||
#elif defined(__SYCL_RT_OS_DARWIN) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I wonder if we simply need to define a suffix (like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The right way to do this is to autogenerate these names from CMake, but that'd be outside of the scope of this patch. |
||
#define __SYCL_OPENCL_PLUGIN_NAME "libpi_opencl.dylib" | ||
#define __SYCL_LEVEL_ZERO_PLUGIN_NAME "libpi_level_zero.dylib" | ||
#define __SYCL_CUDA_PLUGIN_NAME "libpi_cuda.dylib" | ||
#define __SYCL_ESIMD_EMULATOR_PLUGIN_NAME "libpi_esimd_emulator.dylib" | ||
#define __SYCL_HIP_PLUGIN_NAME "libpi_hip.dylib" | ||
#else | ||
#error "Unsupported OS" | ||
#endif | ||
|
||
// Report error and no return (keeps compiler happy about no return statements). | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ list(APPEND SYCL_TEST_DEPS | |
sycl-toolchain | ||
FileCheck | ||
not | ||
get_device_count_by_type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it dead? I thought we use it in either in-tree LIT or llvm-test-suite tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought so, too. Turns out, there's not a single mention of this tool, other than these, that I'd removed. It was dead for a long time now. LLVM Test Suite does not check for devices at all, fully relying on user input, and device-dependent tests have been removed from this repo. |
||
llvm-config | ||
llvm-cxxdump | ||
llvm-dis | ||
|
Uh oh!
There was an error while loading. Please reload this page.