Skip to content

Commit 4f493ce

Browse files
committed
Move MacOS from Rosetta x64 to M1 Metal
1 parent 4450bee commit 4f493ce

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
julia-version: ['lts', '1']
1818
julia-arch: [x64]
19-
os: [ubuntu-latest,macos-latest,windows-latest]
19+
os: [ubuntu-latest,windows-latest]
2020
steps:
2121
- uses: actions/checkout@v2
2222
- uses: julia-actions/setup-julia@latest
@@ -36,6 +36,36 @@ jobs:
3636
with:
3737
files: lcov.info
3838

39+
mac:
40+
strategy:
41+
matrix:
42+
julia-version: ['lts', '1']
43+
julia-arch: [aarch64]
44+
os: [macos-latest]
45+
backend: ['metal']
46+
runs-on: ${{ matrix.os }}
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v2
50+
- name: Setup Julia
51+
uses: julia-actions/setup-julia@latest
52+
with:
53+
version: ${{ matrix.julia-version }}
54+
- name: Setup tests
55+
run: |
56+
julia --color=yes --project=./test -e '
57+
using Pkg
58+
Pkg.Registry.update()
59+
Pkg.develop(path=".")
60+
Pkg.instantiate()'
61+
- name: Add Metal.jl to test environment
62+
if: matrix.backend == 'metal'
63+
run: |
64+
julia --project=test -e 'using Pkg; Pkg.add("Metal")'
65+
- name: Run tests
66+
run: |
67+
julia --color=yes --project=./test -e 'include("test/runtests.jl")'
68+
3969
gpu:
4070
strategy:
4171
matrix:

test/backends.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ else
3030
@info "excluding oneAPI"
3131
end
3232

33+
const EXAMODELS_TEST_METAL = is_package_installed("Metal")
34+
if EXAMODELS_TEST_METAL
35+
@eval using Metal
36+
@eval push!(BACKENDS, MetalBackend())
37+
@info "including Metal"
38+
else
39+
@info "excluding Metal"
40+
end
41+
3342
const EXAMODELS_TEST_OPENCL = is_package_installed("OpenCL")
3443
if EXAMODELS_TEST_OPENCL
3544
@eval begin

0 commit comments

Comments
 (0)