Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()),
PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3
echo "--- :julia: Developing CUDA"
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/CUDA.jl vc/ki-subgroup-ops \
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/CUDA.jl main \
CUDACore CUDATools lib/cusolver lib/curand lib/cublas lib/cufft lib/cusparse lib/cupti lib/nvml lib/custatevec lib/cudnn lib/cutensor lib/cutensornet || exit 3

julia -e 'println("+++ :julia: Running tests")
Expand Down Expand Up @@ -64,7 +64,7 @@ steps:
Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()),
PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3
echo "--- :julia: Developing Metal"
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/Metal.jl vc/ki-subgroup-ops || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/Metal.jl main || exit 3
julia -e 'println("+++ :julia: Running tests")
using Pkg
check = joinpath(pwd(), ".buildkite", "check_sources.jl")
Expand Down Expand Up @@ -102,7 +102,7 @@ steps:
julia -e 'println("--- :julia: Developing oneAPI")
using Pkg
Pkg.add(url="https://github.com/JuliaGPU/AcceleratedKernels.jl", rev="main")' || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/oneAPI.jl tb/ki-subgroup-ops || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/oneAPI.jl main || exit 3

julia -e 'println("+++ :julia: Running tests")
using Pkg
Expand Down Expand Up @@ -142,7 +142,7 @@ steps:
julia -e 'println("--- :julia: Developing AMDGPU")
using Pkg
Pkg.add(url="https://github.com/JuliaGPU/AcceleratedKernels.jl", rev="main")' || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/AMDGPU.jl vc/ki-subgroup-ops || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/AMDGPU.jl main || exit 3

julia -e 'println("+++ :julia: Running tests")
using Pkg
Expand Down Expand Up @@ -180,7 +180,7 @@ steps:
Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()),
PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3
echo "--- :julia: Developing OpenCL"
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/OpenCL.jl tb/ki-subgroup-ops lib/intrinsics || exit 3
julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/OpenCL.jl main lib/intrinsics || exit 3

julia -e 'println("+++ :julia: Running tests")
using Pkg
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
TagBot-KernelInterface:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
subdir: lib/KernelInterface
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ StaticArraysExt = "StaticArrays"
Adapt = "0.4, 1.0, 2.0, 3.0, 4"
Atomix = "1.5"
GPUCompiler = "2.13"
GPUToolbox = "3.3.2"
GPUToolbox = "3.3.3"
KernelInterface = "0.4"
LLVM = "10"
LinearAlgebra = "1.6"
Expand Down
20 changes: 13 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ end
the CPU backend became an OpenCL backend meant every backend. Use
`KernelAbstractions.@device_code_llvm` and `KernelAbstractions.@device_code_typed` instead,
which report on the code a backend actually generates; see [Reflection](@ref).
- `KernelAbstractions.GPU` is deprecated: and backends should now subtype `KernelAbstractions.Backend` directly. `GPU` is now an alias of `Backend` and will be removed in a future release. Code dispatching on `::GPU` should dispatch on `::Backend`, on concrete
backend types, or on a capability such as `KernelAbstractions.supports_float64`.
- `KernelAbstractions.GPU` is deprecated, and backends should subtype
`KernelAbstractions.Backend` directly. `GPU` is now an alias of `Backend` and will be
removed in a future release. Code dispatching on `::GPU` should dispatch on `::Backend`, on
concrete backend types, or on a capability such as `KernelAbstractions.supports_float64`.
- An exception thrown in a kernel on the `CPU` backend is reported as a
`KernelAbstractions.POCL.KernelException` when the kernel has completed, like on GPU
backends, and no longer as the original exception (e.g., a `BoundsError`). Depending on
Expand Down Expand Up @@ -203,11 +205,15 @@ end
than with 0.9.
- `foreach_index(f, A)` runs `f` once per index of the array `A` without writing a kernel out,
and `foreach_index(f, backend, indices)` once per index in a range or `CartesianIndices`.
- KernelInterface 0.4 adds sub-groups: ids, shuffles, votes, reductions and scans, also
- KernelInterface 0.4 extends its sub-groups beyond the ids, `sub_group_barrier` and
`shfl_down` of 0.3: `shfl`, `shfl_up` and `shfl_xor` of any `isbits` value, the votes
`sub_group_any`, `sub_group_all` and `sub_group_ballot`, and reductions and scans, also
within segments of a sub-group. They are the low-level API for backends, for kernels
written against KernelInterface and for kernel languages built on it; capability queries
say how a backend forms its sub-groups, whether they may diverge, and which types it can
shuffle. See [Sub-groups](@ref ki_subgroups).
written against KernelInterface and for kernel languages built on it. KernelInterface no
longer promises how work-items form sub-groups: `supports_linear_subgroups` says whether
they are consecutive work-items, and `supports_independent_subgroups` and
`supports_partitionable_subgroups` whether sub-groups and their segments may diverge. See
[Sub-groups](@ref ki_subgroups).
- [`@groupreduce`](@ref) and [`@groupscan`](@ref) reduce and scan a value over the
workgroup, on every backend. `@groupreduce` uses sub-groups internally where the backend
can shuffle the values. See [Reductions and scans](@ref group_collectives).
Expand All @@ -218,7 +224,7 @@ end

1. The kernels are automatically bounds-checked against either the dynamic or statically
provided `ndrange`.
2. Kernels implictly return `nothing`
2. Kernels implicitly return `nothing`

## Contributing
Please file any bug reports through Github issues or fixes through a pull
Expand Down
8 changes: 4 additions & 4 deletions src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ using KernelInterface: KernelInterface, Backend, get_backend, functional, synchr
import KernelInterface as KI
export KernelInterface

# `GPU` is deprecated in 0.10: and backends ends now subtype `Backend` directly. Keep the name working for code written
# against 0.9, both `x::GPU` and `struct MyBackend <: GPU`.
# `GPU` is deprecated in 0.10, and backends now subtype `Backend` directly. Keep the name
# working for code written against 0.9, both `x::GPU` and `struct MyBackend <: GPU`.
Base.@deprecate_binding GPU Backend

"""
Expand Down Expand Up @@ -85,7 +85,7 @@ end

This allows for the following configurations:

1. `cpu={true, false}`: **Deprecated** in KernelAbstractions 0.11; this option is ignored.
1. `cpu={true, false}`: **Deprecated** in KernelAbstractions 0.10; this option is ignored.
2. `inbounds={false, true}`: Enables a forced `@inbounds` macro around the function definition in the case the user is using too many `@inbounds` already in their kernel. Note that this can lead to incorrect results, crashes, etc and is fundamentally unsafe. Be careful!
3. `unsafe_indices={false, true}`: Disables the implicit validation of indices, users must avoid `@index(Global)`.
4. `generated={false, true}`: Turns the kernel into a [generated function](https://docs.julialang.org/en/v1/manual/metaprogramming/#Generated-functions), see *Generated* below.
Expand Down Expand Up @@ -750,7 +750,7 @@ end

# CPU backend
include("pocl/pocl.jl")
using .POCL
using .POCL: POCL, POCLBackend
export POCLBackend

"""
Expand Down
5 changes: 4 additions & 1 deletion src/pocl/pocl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ function queue()
end

using GPUCompiler
using LLVM, LLVM.IR, LLVM.Build, LLVM.Interop
using LLVM, LLVM.Build, LLVM.Interop
# not all of LLVM.IR, whose `context` would clash with ours
using LLVM.IR: BasicBlock, ConstantArray, ConstantInt, DILocation, GlobalVariable, LLVMType,
MDNode, MD_invariant_load, MD_tbaa, MemoryEffects, StringAttribute, Value
using SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll
using Adapt

Expand Down
Loading