diff --git a/Project.toml b/Project.toml index 2fccea8..cfa086b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AcceleratedKernels" uuid = "6a4ca0a5-0e36-4168-a932-d9be78d558f1" authors = ["Andrei-Leonard Nicusan and contributors"] -version = "0.4.3" +version = "0.4.4" [deps] ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" @@ -19,7 +19,7 @@ AcceleratedKernelsoneAPIExt = "oneAPI" [compat] ArgCheck = "2" GPUArraysCore = "0.2.0" -KernelAbstractions = "0.9.34" +KernelAbstractions = "0.9.34, 0.10" Markdown = "1" UnsafeAtomics = "0.3.0" julia = "1.10" diff --git a/test/runtests.jl b/test/runtests.jl index 716fd8e..a8927fe 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -56,7 +56,11 @@ global prefer_threads::Bool = !(IS_CPU_BACKEND && "--cpuKA" in ARGS) array_from_host(h_arr::AbstractArray, dtype=nothing) = array_from_host(BACKEND, h_arr, dtype) function array_from_host(backend, h_arr::AbstractArray, dtype=nothing) - d_arr = KernelAbstractions.zeros(backend, isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr)) + d_arr = if IS_CPU_BACKEND && prefer_threads # Don't use KA zeros if not using KA algorithms + zeros(isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr)) + else + KernelAbstractions.zeros(backend, isnothing(dtype) ? eltype(h_arr) : dtype, size(h_arr)) + end copyto!(d_arr, h_arr isa Array ? h_arr : Array(h_arr)) # Allow unmaterialised types, e.g. ranges d_arr end