Skip to content

Commit b027bdd

Browse files
anicusanvchuravy
andauthored
Refactored CUDA and Metal backends into extensions. (#42)
Co-authored-by: Valentin Churavy <[email protected]>
1 parent 25d9da2 commit b027bdd

38 files changed

+333
-466
lines changed

.buildkite/pipeline.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ steps:
77
julia -e 'using Pkg
88
99
println("--- :julia: Instantiating environment")
10-
Pkg.activate("lib/AtomixCUDA")
10+
Pkg.add("CUDA")
1111
Pkg.develop(PackageSpec(name="Atomix", path="."))
1212
1313
println("+++ :julia: Running tests")
14-
Pkg.test()'
14+
Pkg.test("Atomix", test_args=["--CUDA"])'
1515
agents:
1616
queue: "juliagpu"
1717
cuda: "*"
@@ -26,14 +26,15 @@ steps:
2626
julia -e 'using Pkg
2727
2828
println("--- :julia: Instantiating environment")
29-
Pkg.activate("lib/AtomixMetal")
29+
Pkg.add("Metal")
3030
Pkg.develop(PackageSpec(name="Atomix", path="."))
3131
3232
println("+++ :julia: Running tests")
33-
Pkg.test()'
33+
Pkg.test("Atomix", test_args=["--Metal"])'
3434
agents:
3535
queue: "juliaecosystem"
3636
os: "macos"
3737
arch: "aarch64"
3838
if: build.message !~ /\[skip tests\]/
3939
timeout_in_minutes: 15
40+

.github/workflows/ci.yml

+3-27
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
matrix:
1515
julia-version:
1616
- '1'
17-
- '1.6'
17+
- 'lts'
18+
- 'pre'
1819
fail-fast: false
1920
name: Test Julia ${{ matrix.julia-version }}
2021
steps:
@@ -33,24 +34,6 @@ jobs:
3334
flags: Pkg.test
3435
name: codecov-umbrella
3536

36-
aqua:
37-
runs-on: ubuntu-latest
38-
strategy:
39-
matrix:
40-
julia-version:
41-
- '1'
42-
- '1.6'
43-
fail-fast: false
44-
steps:
45-
- uses: actions/checkout@v4
46-
47-
- uses: julia-actions/setup-julia@v2
48-
with:
49-
version: ${{ matrix.julia-version }}
50-
- uses: julia-actions/cache@v2
51-
52-
- uses: tkf/julia-aqua@v1
53-
5437
documenter:
5538
runs-on: ubuntu-latest
5639
steps:
@@ -78,17 +61,10 @@ jobs:
7861
if: steps.build-and-deploy.outcome == 'skipped'
7962
run: julia -e 'using Run; Run.docs()'
8063

81-
# https://github.com/tkf/julia-code-style-suggesters
82-
code-style:
83-
if: always() && github.event.pull_request
84-
runs-on: ubuntu-latest
85-
steps:
86-
- uses: tkf/julia-code-style-suggesters@v1
87-
8864
# A job that succeeds if and only if all jobs succeed.
8965
all-success:
9066
if: always() && github.event.pull_request
91-
needs: [test, aqua, documenter, code-style]
67+
needs: [test, documenter]
9268
runs-on: ubuntu-latest
9369
steps:
9470
# https://github.com/tkf/merge-conclusions-action

Project.toml

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
name = "Atomix"
22
uuid = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
33
authors = ["Takafumi Arakaki <[email protected]> and contributors"]
4-
version = "1.0"
4+
version = "0.2.0"
55

66
[deps]
77
UnsafeAtomics = "013be700-e6cd-48c3-b4a1-df204f14c38f"
88

99
[compat]
10+
CUDA = "5"
11+
Metal = "1"
1012
UnsafeAtomics = "0.1, 0.2"
11-
julia = "1.6"
13+
julia = "1.10"
14+
15+
[extensions]
16+
AtomixCUDAExt = "CUDA"
17+
AtomixMetalExt = "Metal"
18+
19+
[weakdeps]
20+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
21+
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"

docs/Project.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
2+
Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
34

45
[compat]
5-
Documenter = "1.7"
6+
Documenter = "1"

docs/make.jl

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
using Documenter
22
using Atomix
33

4-
makedocs(
5-
sitename = "Atomix",
6-
modules = [Atomix],
7-
warnonly = :missing_docs
4+
makedocs(;
5+
sitename="Atomix",
6+
modules=[Atomix],
7+
format=Documenter.HTML(;
8+
# Only create web pretty-URLs on the CI
9+
prettyurls=get(ENV, "CI", nothing) == "true",
10+
),
11+
warnonly=:missing_docs,
812
)
913

1014
deploydocs(
11-
repo = "github.com/JuliaConcurrent/Atomix.jl",
12-
devbranch = "main",
13-
push_preview = true,
15+
repo="github.com/JuliaConcurrent/Atomix.jl",
16+
devbranch="main",
17+
push_preview=true,
1418
)

docs/make_local.jl

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Activate docs environment and use ("develop") local library
2+
using Pkg
3+
Pkg.activate(@__DIR__)
4+
Pkg.develop(path=joinpath(@__DIR__, ".."))
5+
include("make.jl")

lib/AtomixCUDA/src/AtomixCUDA.jl ext/AtomixCUDAExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: respect ordering
2-
module AtomixCUDA
2+
module AtomixCUDAExt
33

44
using Atomix: Atomix, IndexableRef
55
using CUDA: CUDA, CuDeviceArray
@@ -55,4 +55,4 @@ end
5555
return old => op(old, x)
5656
end
5757

58-
end # module AtomixCUDA
58+
end # module AtomixCUDAExt

lib/AtomixMetal/src/AtomixMetal.jl ext/AtomixMetalExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: respect ordering
2-
module AtomixMetal
2+
module AtomixMetalExt
33

44
using Atomix: Atomix, IndexableRef
55
using Metal: Metal, MtlDeviceArray
@@ -55,4 +55,4 @@ end
5555
return old => op(old, x)
5656
end
5757

58-
end # module AtomixMetal
58+
end # module AtomixMetalExt

lib/AtomixCUDA/.gitignore

-2
This file was deleted.

lib/AtomixCUDA/LICENSE

-21
This file was deleted.

lib/AtomixCUDA/Project.toml

-13
This file was deleted.

lib/AtomixCUDA/README.md

-1
This file was deleted.

lib/AtomixCUDA/test/AtomixCUDATests/Project.toml

-13
This file was deleted.

lib/AtomixCUDA/test/AtomixCUDATests/src/AtomixCUDATests.jl

-7
This file was deleted.

lib/AtomixCUDA/test/AtomixCUDATests/src/test_sugar.jl

-36
This file was deleted.

lib/AtomixCUDA/test/AtomixCUDATests/src/utils.jl

-13
This file was deleted.

lib/AtomixCUDA/test/Project.toml

-6
This file was deleted.

lib/AtomixCUDA/test/runtests.jl

-2
This file was deleted.

lib/AtomixMetal/LICENSE

-21
This file was deleted.

lib/AtomixMetal/Project.toml

-13
This file was deleted.

lib/AtomixMetal/README.md

-1
This file was deleted.

lib/AtomixMetal/test/AtomixMetalTests/Project.toml

-13
This file was deleted.

lib/AtomixMetal/test/AtomixMetalTests/src/AtomixMetalTests.jl

-7
This file was deleted.

lib/AtomixMetal/test/AtomixMetalTests/src/test_sugar.jl

-36
This file was deleted.

0 commit comments

Comments
 (0)