Skip to content

Commit 7b12f4d

Browse files
jpsamaroovchuravy
andauthored
Add ROCKernels backend (#209)
* Approx compare in gamma/erf/erfc tests Co-authored-by: Valentin Churavy <[email protected]>
1 parent e499979 commit 7b12f4d

File tree

14 files changed

+517
-40
lines changed

14 files changed

+517
-40
lines changed

.buildkite/pipeline.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
steps:
2-
- label: "Julia v1"
2+
- label: "CUDA Julia v1"
33
plugins:
44
- JuliaCI/julia#v1:
55
version: "1"
@@ -19,10 +19,10 @@ steps:
1919
KERNELABSTRACTIONS_TEST_BACKEND: "CUDA"
2020
timeout_in_minutes: 60
2121

22-
- label: "Julia 1.6-nightly"
22+
- label: "CUDA Julia 1.6"
2323
plugins:
2424
- JuliaCI/julia#v1:
25-
version: "1.6-nightly"
25+
version: "1.6"
2626
- JuliaCI/julia-coverage#v1:
2727
codecov: true
2828
dirs:
@@ -39,7 +39,7 @@ steps:
3939
KERNELABSTRACTIONS_TEST_BACKEND: "CUDA"
4040
timeout_in_minutes: 60
4141

42-
- label: "Julia nightly"
42+
- label: "CUDA Julia nightly"
4343
plugins:
4444
- JuliaCI/julia#v1:
4545
version: "nightly"
@@ -59,6 +59,25 @@ steps:
5959
KERNELABSTRACTIONS_TEST_BACKEND: "CUDA"
6060
timeout_in_minutes: 60
6161

62+
- label: "ROCm Julia 1.6"
63+
plugins:
64+
- JuliaCI/julia#v1:
65+
version: "1.6"
66+
- JuliaCI/julia-coverage#v1:
67+
codecov: true
68+
dirs:
69+
- src
70+
- lib
71+
commands:
72+
- julia .ci/develop.jl
73+
- julia .ci/test.jl
74+
agents:
75+
queue: "juliagpu"
76+
rocm: "*"
77+
env:
78+
KERNELABSTRACTIONS_TEST_BACKEND: "ROCM"
79+
timeout_in_minutes: 60
80+
6281
env:
6382
JULIA_PKG_SERVER: "" # it often struggles with our large artifacts
6483
SECRET_CODECOV_TOKEN: "c5pjPUwULD2L8ss0gRtjCPiagRlTQ11TdbZP6gIhTPeA/gN5w5/7JvDCg36UpKER6FXnQDeBGGkQafHiLdBaH/FWQ2B2VKErtBarIBJa2zWvKu8mYs9PJzw/qLGT2sMXI9kcao63H6/HAwbslJcY0a5Mg+SwM3M05XqSHgnrHMnbBXysKP6VzFEIX7uoyEKOnoWDj8rGJKFYLW2DBRtd6Yc23ESfFXPAqbS7sgXxwQHKzz20FMQBJUmbiDIzPlk3k2n2TvgAWQ0VNK0e4/UooMbULL3UjY4oaMOF0XpJAnWlmvGgy8gEnZKSVp3ieXy/Ubu7BWwH/BT59wDy6LuDxA==;U2FsdGVkX18Wil69f7qJYu6yU5iNx+Zq8akUcOp+McU1CR4Jw4QBsrUKIF4W4uK+/752FQo40BwFsfnIC8CJ/Q=="

.ci/develop.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import Pkg
22

3+
Pkg.update()
4+
35
root_directory = dirname(@__DIR__)
46

57
kernelabstractions = Pkg.PackageSpec(path = root_directory)
68
cudakernels = Pkg.PackageSpec(path = joinpath(root_directory, "lib", "CUDAKernels"))
79

810
Pkg.develop(kernelabstractions)
911
Pkg.develop(cudakernels)
10-
12+
if !(VERSION < v"1.6-")
13+
rockernels = Pkg.PackageSpec(path = joinpath(root_directory, "lib", "ROCKernels"))
14+
Pkg.develop(rockernels)
15+
end
16+
Pkg.build()
1117
Pkg.precompile()

.ci/test.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ pkgs = [
44
"KernelAbstractions",
55
"CUDAKernels",
66
]
7+
if !(VERSION < v"1.6-")
8+
push!(pkgs, "ROCKernels")
9+
end
710

811
Pkg.test(pkgs; coverage = true)

lib/CUDAKernels/Project.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,3 @@ Cassette = "0.3.3"
1818
KernelAbstractions = "0.6"
1919
SpecialFunctions = "0.10, 1.0"
2020
StaticArrays = "0.12, 1.0"
21-
22-
[extras]
23-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24-
25-
[targets]
26-
test = ["Test"]

lib/CUDAKernels/test/Project.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[deps]
2+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
3+
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
4+
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
5+
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
6+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
7+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
8+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

lib/CUDAKernels/test/runtests.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1+
using KernelAbstractions
2+
using CUDA
13
using CUDAKernels
24
using Test
5+
6+
include(joinpath(dirname(pathof(KernelAbstractions)), "..", "test", "testsuite.jl"))
7+
8+
if parse(Bool, get(ENV, "CI", "false"))
9+
default = "CPU"
10+
else
11+
default = "CUDA"
12+
end
13+
14+
backend = get(ENV, "KERNELABSTRACTIONS_TEST_BACKEND", default)
15+
16+
if backend != "CUDA"
17+
@info "CUDA backend not selected"
18+
exit()
19+
end
20+
21+
CUDA.versioninfo()
22+
if CUDA.functional(true)
23+
CUDA.allowscalar(false)
24+
Testsuite.testsuite(CUDADevice, backend, CUDA, CuArray, CUDA.CuDeviceArray)
25+
else
26+
error("No CUDA GPUs available!")
27+
end

lib/ROCKernels/Project.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name = "ROCKernels"
2+
uuid = "7eb9e9f0-4bd3-4c4c-8bef-26bd9629d9b9"
3+
authors = ["Valentin Churavy <[email protected]>", "Julian P Samaroo <[email protected]>"]
4+
version = "0.1.0"
5+
6+
[deps]
7+
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
8+
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
9+
Cassette = "7057c7e9-c182-5462-911a-8362d720325c"
10+
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
11+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
12+
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
13+
14+
[compat]
15+
AMDGPU = "0.2.5"
16+
Adapt = "0.4, 1.0, 2.0, 3.0"
17+
Cassette = "0.3.3"
18+
KernelAbstractions = "0.6"
19+
SpecialFunctions = "0.10, 1.0"
20+
StaticArrays = "0.12, 1.0"
21+
julia = "1.6"

0 commit comments

Comments
 (0)