Skip to content

Commit 5d26167

Browse files
authored
Move AbstractGPUArrayStyle to GPUArraysCore? (#417)
1 parent 1e43d05 commit 5d26167

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "GPUArrays"
22
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
3-
version = "8.4.1"
3+
version = "8.4.2"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -15,7 +15,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1515

1616
[compat]
1717
Adapt = "2.0, 3.0"
18-
GPUArraysCore = "0.1"
18+
GPUArraysCore = "= 0.1.1"
1919
LLVM = "3.9, 4"
2020
Reexport = "1"
2121
julia = "1.6"

lib/GPUArraysCore/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GPUArraysCore"
22
uuid = "46192b85-c4d5-4398-a991-12ede77f4527"
33
authors = ["Tim Besard <tim.besard@gmail.com>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

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

lib/GPUArraysCore/src/GPUArraysCore.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Adapt
66
## essential types
77

88
export AbstractGPUArray, AbstractGPUVector, AbstractGPUMatrix, AbstractGPUVecOrMat,
9-
WrappedGPUArray, AnyGPUArray
9+
WrappedGPUArray, AnyGPUArray, AbstractGPUArrayStyle
1010

1111
"""
1212
AbstractGPUArray{T, N} <: DenseArray{T, N}
@@ -25,6 +25,15 @@ const AbstractGPUVecOrMat{T} = Union{AbstractGPUArray{T, 1}, AbstractGPUArray{T,
2525
const WrappedGPUArray{T,N} = WrappedArray{T,N,AbstractGPUArray,AbstractGPUArray{T,N}}
2626
const AnyGPUArray{T,N} = Union{AbstractGPUArray{T,N}, WrappedGPUArray{T,N}}
2727

28+
## broadcasting
29+
30+
"""
31+
Abstract supertype for GPU array styles. The `N` parameter is the dimensionality.
32+
33+
Downstream implementations should provide a concrete array style type that inherits from
34+
this supertype.
35+
"""
36+
abstract type AbstractGPUArrayStyle{N} <: Base.Broadcast.AbstractArrayStyle{N} end
2837

2938
## scalar iteration
3039

src/host/broadcast.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
# broadcasting operations
22

3-
export AbstractGPUArrayStyle
4-
53
using Base.Broadcast
64

75
import Base.Broadcast: BroadcastStyle, Broadcasted, AbstractArrayStyle, instantiate
86

97
const BroadcastGPUArray{T} = Union{AnyGPUArray{T},
108
Base.RefValue{<:AbstractGPUArray{T}}}
119

12-
"""
13-
Abstract supertype for GPU array styles. The `N` parameter is the dimensionality.
14-
15-
Downstream implementations should provide a concrete array style type that inherits from
16-
this supertype.
17-
"""
18-
abstract type AbstractGPUArrayStyle{N} <: AbstractArrayStyle{N} end
19-
2010
# Wrapper types otherwise forget that they are GPU compatible
2111
# NOTE: don't directly use GPUArrayStyle here not to lose downstream customizations.
2212
BroadcastStyle(W::Type{<:WrappedGPUArray})= BroadcastStyle(Adapt.parent(W){Adapt.eltype(W), Adapt.ndims(W)})

0 commit comments

Comments
 (0)