Skip to content

Commit ffe3514

Browse files
Merge pull request #366 from SciML/add-cpu-backend-testing
Add CPU backend testing support via KernelAbstractions
2 parents a50735a + 02f04e1 commit ffe3514

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

.github/workflows/CI.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
continue-on-error: ${{ matrix.group == 'Downstream' }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
group:
17+
- CPU
18+
version:
19+
- 'lts'
20+
- '1'
21+
- 'pre'
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: julia-actions/setup-julia@v2
25+
with:
26+
version: ${{ matrix.version }}
27+
- uses: actions/cache@v4
28+
env:
29+
cache-name: cache-artifacts
30+
with:
31+
path: ~/.julia/artifacts
32+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
33+
restore-keys: |
34+
${{ runner.os }}-test-${{ env.cache-name }}-
35+
${{ runner.os }}-test-
36+
${{ runner.os }}-
37+
- uses: julia-actions/julia-runtest@v1
38+
with:
39+
coverage: false
40+
check_bounds: auto
41+
env:
42+
GROUP: ${{ matrix.group }}
43+
- uses: julia-actions/julia-processcoverage@v1
44+
- uses: codecov/codecov-action@v5
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
file: lcov.info
48+
fail_ci_if_error: false
49+
if: matrix.group == 'CPU'
50+
with:
51+
files: lcov.info
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
fail_ci_if_error: false

.github/workflows/Downgrade.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
matrix:
1818
downgrade_mode: ['alldeps']
1919
julia-version: ['1.10']
20+
group: ['CPU']
2021
steps:
2122
- uses: actions/checkout@v4
2223
- uses: julia-actions/setup-julia@v2
@@ -28,4 +29,6 @@ jobs:
2829
- uses: julia-actions/julia-buildpkg@v1
2930
- uses: julia-actions/julia-runtest@v1
3031
with:
31-
ALLOW_RERESOLVE: false
32+
ALLOW_RERESOLVE: false
33+
env:
34+
GROUP: ${{ matrix.group }}

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
1010
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1111
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1212
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
13+
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
1314
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
1415
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1516
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
@@ -44,6 +45,7 @@ ChainRulesCore = "1"
4445
DiffEqBase = "6.122"
4546
DocStringExtensions = "0.8, 0.9"
4647
ForwardDiff = "0.10, 1"
48+
GPUArraysCore = "0.1, 0.2"
4749
KernelAbstractions = "0.9"
4850
LinearSolve = "1.15, 2, 3"
4951
Metal = "0.5, 1"
@@ -62,5 +64,7 @@ oneAPI = "1.2, 2"
6264
[extras]
6365
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
6466
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
67+
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
6568
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
6669
oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"
70+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ elseif GROUP == "oneAPI"
1111
elseif GROUP == "Metal"
1212
using Metal
1313
Metal.MetalBackend()
14+
elseif GROUP == "CPU"
15+
using KernelAbstractions
16+
KernelAbstractions.CPU()
1417
end
1518

1619
import GPUArraysCore

0 commit comments

Comments
 (0)