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
6 changes: 2 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,8 @@ 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` has been removed: it didn't mean GPU hardware (the `CPU` backend
was a subtype), and backends now subtype `KernelAbstractions.Backend` directly. 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 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`.
- 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
4 changes: 4 additions & 0 deletions src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ 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`.
Base.@deprecate_binding GPU Backend

"""
@kernel function f(args) end

Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,9 @@ struct NewBackend <: KernelAbstractions.Backend end

@test KernelAbstractions.functional(backend) === missing
end

@testset "Deprecated GPU alias" begin
@test KernelAbstractions.GPU === KernelAbstractions.Backend
@test CPU() isa KernelAbstractions.GPU
@test NewBackend <: KernelAbstractions.GPU
end
Loading