Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ steps:
matrix:
setup:
version:
- "1.10"
- "1.11"
- "1.12"
test_args:
Expand All @@ -84,6 +83,32 @@ steps:
(build.message =~ /\[only [^\]]*(tests|julia)/ ||
build.message !~ /\[only / && !build.pull_request.draft)

# XXX: KernelInterface 0.3 isn't registered yet, and Julia 1.10 ignores [sources]: develop
# it from a clone before instantiating, which the julia-test plugin would do first
- <<: *julia
matrix:
setup:
version:
- "1.10"
test_args:
- "--verbose"
plugins:
- JuliaCI/julia#v1:
version: "{{matrix.version}}"
- JuliaCI/julia-coverage#v1:
codecov: true
command: |
git clone --depth 1 --branch tb/ki-0.3 https://github.com/JuliaGPU/KernelAbstractions.jl ka
julia --project -e '
using Pkg
Pkg.develop(path="ka/lib/KernelInterface")
Pkg.instantiate()
Pkg.test(; coverage=true, test_args=`{{matrix.test_args}}`)'
if: |
build.message !~ /\[skip [^\]]*(tests|julia)/ &&
(build.message =~ /\[only [^\]]*(tests|julia)/ ||
build.message !~ /\[only / && !build.pull_request.draft)

- <<: *julia
matrix:
setup:
Expand Down Expand Up @@ -127,10 +152,14 @@ steps:
plugins:
- JuliaCI/julia#v1:
version: "1.10"
- JuliaCI/julia-test#v1:
run_tests: false
# XXX: KernelInterface 0.3 isn't registered yet, and Julia 1.10 ignores [sources]
command: |
git clone --depth 1 --branch tb/ki-0.3 https://github.com/JuliaGPU/KernelAbstractions.jl ka
julia --project -e '
using Pkg
Pkg.develop(path="ka/lib/KernelInterface")
Pkg.instantiate()

using AMDGPU
@assert !AMDGPU.functional()'
agents:
Expand Down
5 changes: 5 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
GPUToolbox = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
KernelInterface = "4ee993da-d684-4d17-a7dd-4e58e78d92bf"
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
LLVMDowngrader_jll = "f52de702-fb25-5922-94ba-81dd59b07444"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Expand Down Expand Up @@ -48,6 +49,9 @@ AMDGPUEnzymeCoreExt = "EnzymeCore"
AMDGPUSparseMatricesCSRExt = "SparseMatricesCSR"
AMDGPUSpecialFunctionsExt = "SpecialFunctions"

[sources]
KernelInterface = {url = "https://github.com/JuliaGPU/KernelAbstractions.jl", rev = "tb/ki-0.3", subdir = "lib/KernelInterface"}

[compat]
AMDGPU_LLVM_Backend_jll = "23"
AbstractFFTs = "1.0"
Expand All @@ -63,6 +67,7 @@ GPUArrays = "11.5.14"
GPUCompiler = "2.9"
GPUToolbox = "3"
KernelAbstractions = "0.9.2"
KernelInterface = "0.3"
LLVM = "9"
LLVMDowngrader_jll = "0.11"
Libdl = "1"
Expand Down
1 change: 1 addition & 0 deletions docs/src/api/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ AMDGPU.device_id!
AMDGPU.HIP.name
AMDGPU.HIP.wavefrontsize
AMDGPU.HIP.gcn_arch
AMDGPU.HIP.max_workgroup_dims
AMDGPU.HIP.device_id
AMDGPU.HIP.properties
```
1 change: 1 addition & 0 deletions docs/src/api/intrinsics.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ AMDGPU.Device.blockDim

```@docs
AMDGPU.sync_workgroup
AMDGPU.sync_wavefront
AMDGPU.sync_workgroup_count
AMDGPU.sync_workgroup_and
AMDGPU.sync_workgroup_or
Expand Down
11 changes: 9 additions & 2 deletions src/AMDGPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ include("discovery/discovery.jl")
using .ROCmDiscovery
using .ROCmDiscovery: AMDGPU_LLVM_Backend_jll, LLVMDowngrader_jll

using KernelInterface
include("utils.jl")

include("hsa/HSA.jl")
Expand All @@ -82,6 +83,7 @@ Base.Experimental.@MethodTable(method_table)
#needs to be before Device since sync uses this
const syncscope_agent = UnsafeAtomics.Internal.LLVMSyncScope{:agent}()
const syncscope_workgroup = UnsafeAtomics.Internal.LLVMSyncScope{:workgroup}()
const syncscope_wavefront = UnsafeAtomics.Internal.LLVMSyncScope{:wavefront}()

# Referenced by the generated `kernel_state()`, and generators run in the world they are
# defined in, so this has to precede the device code.
Expand All @@ -102,7 +104,7 @@ import .Device: ROCDeviceArray, AS, HostCall, HostCallHolder, hostcall!
import .Device: @ROCDynamicLocalArray, @ROCStaticLocalArray
import .Device: workitemIdx, workgroupIdx, workgroupDim, gridItemDim, gridGroupDim
import .Device: threadIdx, blockIdx, blockDim
import .Device: sync_workgroup, sync_workgroup_count, sync_workgroup_and, sync_workgroup_or
import .Device: sync_workgroup, sync_wavefront, sync_workgroup_count, sync_workgroup_and, sync_workgroup_or
import .Device: @rocprint, @rocprintln, @rocprintf

export ROCDeviceArray, @ROCDynamicLocalArray, @ROCStaticLocalArray
Expand Down Expand Up @@ -147,10 +149,15 @@ function Atomix.modify!(ref::ROCIndexableRef, op::OP, x, ord) where OP <: Union{
GC.@preserve root UnsafeAtomics.modify!(ptr, op, x, ord, syncscope_agent)
end

include("ROCKernels.jl")
# KernelAbstractions
include("ROCKernelsOld.jl")
import .ROCKernels: ROCBackend
export ROCBackend

# KernelInterface
include("ROCKernels.jl")
import .ROCInterface

include("precompile.jl")

function __init__()
Expand Down
Loading
Loading