From 26c51914ee83be238056fdf8d3b63cf51b2cf5ef Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Wed, 17 Aug 2022 16:00:27 +0800 Subject: [PATCH] Move `backend` to `GPUArraysCore.jl` (#420) --- Project.toml | 4 ++-- lib/GPUArraysCore/Project.toml | 2 +- lib/GPUArraysCore/src/GPUArraysCore.jl | 8 ++++++++ lib/JLArrays/Project.toml | 4 ++-- src/device/execution.jl | 9 +-------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Project.toml b/Project.toml index 28f980e1..c8f7aeb0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GPUArrays" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.4.2" +version = "8.4.3" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" @@ -15,7 +15,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] Adapt = "2.0, 3.0" -GPUArraysCore = "= 0.1.1" +GPUArraysCore = "= 0.1.2" LLVM = "3.9, 4" Reexport = "1" julia = "1.6" diff --git a/lib/GPUArraysCore/Project.toml b/lib/GPUArraysCore/Project.toml index 80b926e8..e27744d4 100644 --- a/lib/GPUArraysCore/Project.toml +++ b/lib/GPUArraysCore/Project.toml @@ -1,7 +1,7 @@ name = "GPUArraysCore" uuid = "46192b85-c4d5-4398-a991-12ede77f4527" authors = ["Tim Besard "] -version = "0.1.1" +version = "0.1.2" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/lib/GPUArraysCore/src/GPUArraysCore.jl b/lib/GPUArraysCore/src/GPUArraysCore.jl index 7b988b94..d55d16f9 100644 --- a/lib/GPUArraysCore/src/GPUArraysCore.jl +++ b/lib/GPUArraysCore/src/GPUArraysCore.jl @@ -111,5 +111,13 @@ macro allowscalar(ex) end end +""" + backend(T::Type) + backend(x) + +Gets the GPUArrays back-end responsible for managing arrays of type `T`. +""" +backend(::Type) = error("This object is not a GPU array") # COV_EXCL_LINE +backend(x) = backend(typeof(x)) end # module GPUArraysCore diff --git a/lib/JLArrays/Project.toml b/lib/JLArrays/Project.toml index 4f9fb40c..a99b6b36 100644 --- a/lib/JLArrays/Project.toml +++ b/lib/JLArrays/Project.toml @@ -1,7 +1,7 @@ name = "JLArrays" uuid = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" authors = ["Tim Besard "] -version = "0.1.0" +version = "0.1.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" @@ -10,5 +10,5 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] Adapt = "2.0, 3.0" -GPUArrays = "8.4.1" +GPUArrays = "~8.4.1" julia = "1.6" diff --git a/src/device/execution.jl b/src/device/execution.jl index e6a22204..41285bc3 100644 --- a/src/device/execution.jl +++ b/src/device/execution.jl @@ -6,14 +6,7 @@ abstract type AbstractGPUBackend end abstract type AbstractKernelContext end -""" - backend(T::Type) - backend(x) - -Gets the GPUArrays back-end responsible for managing arrays of type `T`. -""" -backend(::Type) = error("This object is not a GPU array") # COV_EXCL_LINE -backend(x) = backend(typeof(x)) +import GPUArraysCore: backend """ gpu_call(kernel::Function, arg0, args...; kwargs...)