Skip to content

Commit 9bb3da8

Browse files
committed
KA 0.10 support
1 parent e641c28 commit 9bb3da8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AcceleratedKernels"
22
uuid = "6a4ca0a5-0e36-4168-a932-d9be78d558f1"
33
authors = ["Andrei-Leonard Nicusan <[email protected]> and contributors"]
4-
version = "0.4.3"
4+
version = "0.4.4"
55

66
[deps]
77
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
@@ -19,7 +19,7 @@ AcceleratedKernelsoneAPIExt = "oneAPI"
1919
[compat]
2020
ArgCheck = "2"
2121
GPUArraysCore = "0.2.0"
22-
KernelAbstractions = "0.9.34"
22+
KernelAbstractions = "0.9.34, 0.10"
2323
Markdown = "1"
2424
UnsafeAtomics = "0.3.0"
2525
julia = "1.10"

test/runtests.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ global prefer_threads::Bool = !(IS_CPU_BACKEND && "--cpuKA" in ARGS)
5656

5757
array_from_host(h_arr::AbstractArray, dtype=nothing) = array_from_host(BACKEND, h_arr, dtype)
5858
function array_from_host(backend, h_arr::AbstractArray, dtype=nothing)
59-
d_arr = KernelAbstractions.zeros(backend, isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr))
59+
d_arr = if IS_CPU_BACKEND && prefer_threads # Don't use KA zeros if not using KA algorithms
60+
zeros(isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr))
61+
else
62+
KernelAbstractions.zeros(backend, isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr))
63+
end
6064
copyto!(d_arr, h_arr isa Array ? h_arr : Array(h_arr)) # Allow unmaterialised types, e.g. ranges
6165
d_arr
6266
end

0 commit comments

Comments
 (0)