Skip to content

Commit a89c07c

Browse files
committed
add deprecation notes
1 parent 4f2acee commit a89c07c

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "KernelAbstractions"
22
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
33
authors = ["Valentin Churavy <[email protected]> and contributors"]
4-
version = "0.9.34"
4+
version = "0.10.0-dev"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/KernelAbstractions.jl

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ This allows for two different configurations:
6565
6666
!!! warn
6767
This is an experimental feature.
68+
69+
!!! note
70+
`cpu={true, false}` is deprecated for KernelAbstractions 1.0
6871
"""
6972
macro kernel(ex...)
7073
if length(ex) == 1
@@ -248,6 +251,9 @@ For storage that only persists between `@synchronize` statements, an `MArray` ca
248251
instead.
249252
250253
See also [`@uniform`](@ref).
254+
255+
!!! note
256+
`@private` is deprecated for KernelAbstractions 1.0
251257
"""
252258
macro private(T, dims)
253259
if dims isa Integer
@@ -263,6 +269,9 @@ end
263269
264270
Creates a private local of `mem` per item in the workgroup. This can be safely used
265271
across [`@synchronize`](@ref) statements.
272+
273+
!!! note
274+
`@private` is deprecated for KernelAbstractions 1.0
266275
"""
267276
macro private(expr)
268277
return esc(expr)
@@ -273,6 +282,9 @@ end
273282
274283
`expr` is evaluated outside the workitem scope. This is useful for variable declarations
275284
that span workitems, or are reused across `@synchronize` statements.
285+
286+
!!! note
287+
`@uniform` is deprecated for KernelAbstractions 1.0
276288
"""
277289
macro uniform(value)
278290
return esc(value)
@@ -324,6 +336,8 @@ Access the hidden context object used by KernelAbstractions.
324336
!!! warn
325337
Only valid to be used from a kernel with `cpu=false`.
326338
339+
!!! note
340+
`@context` will be supported on all backends in KernelAbstractions 1.0
327341
```
328342
function f(@context, a)
329343
I = @index(Global, Linear)
@@ -472,6 +486,9 @@ Abstract type for all GPU based KernelAbstractions backends.
472486
473487
!!! note
474488
New backend implementations **must** sub-type this abstract type.
489+
490+
!!! note
491+
`GPU` will be removed in KernelAbstractions v1.0
475492
"""
476493
abstract type GPU <: Backend end
477494

@@ -483,6 +500,9 @@ Instantiate a CPU (multi-threaded) backend.
483500
## Options:
484501
- `static`: Uses a static thread assignment, this can be beneficial for NUMA aware code.
485502
Defaults to false.
503+
504+
!!! note
505+
`CPU` will be aliased to `POCLBackend()` on KernelAbstractions v1.0
486506
"""
487507
struct CPU <: Backend
488508
static::Bool
@@ -493,6 +513,9 @@ end
493513
isgpu(::Backend)::Bool
494514
495515
Returns true for all [`GPU`](@ref) backends.
516+
517+
!!! note
518+
`isgpu` will be removed in KernelAbstractions v1.0
496519
"""
497520
isgpu(::GPU) = true
498521
isgpu(::CPU) = false
@@ -512,8 +535,6 @@ function get_backend end
512535
# Should cover SubArray, ReshapedArray, ReinterpretArray, Hermitian, AbstractTriangular, etc.:
513536
get_backend(A::AbstractArray) = get_backend(parent(A))
514537

515-
get_backend(::Array) = CPU()
516-
517538
# Define:
518539
# adapt_storage(::Backend, a::Array) = adapt(BackendArray, a)
519540
# adapt_storage(::Backend, a::BackendArray) = a

src/pocl/pocl.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,9 @@ include("backend.jl")
6666
import .POCLKernels: POCLBackend
6767
export POCLBackend
6868

69+
import KernelAbstractions as KA
70+
KA.get_backend(::Array) = POCLBackend()
71+
72+
Adapt.adapt_storage(::POCLBackend, a::Array) = a
73+
6974
end

0 commit comments

Comments
 (0)