Skip to content

Commit 088edc8

Browse files
authored
change type parameter range for AbstractStridedPointer (#49)
* change type parameter range for AbstractStridedPointer * fix ambiguity error
1 parent c79e5d4 commit 088edc8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/strided_pointers/stridedpointers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ R: rank of strides
5656
X: strides
5757
O: offsets
5858
"""
59-
abstract type AbstractStridedPointer{T<:NativeTypes,N,C,B,R,X<:Tuple{Vararg{Any,N}},O<:Tuple{Vararg{Any,N}}} end
59+
abstract type AbstractStridedPointer{T,N,C,B,R,X<:Tuple{Vararg{Any,N}},O<:Tuple{Vararg{Any,N}}} end
6060

6161
@inline ArrayInterface.contiguous_axis(::Type{A}) where {T,N,C,A<:AbstractStridedPointer{T,N,C}} = StaticInt{C}()
6262
@inline ArrayInterface.contiguous_batch_size(::Type{A}) where {T,N,C,B,A<:AbstractStridedPointer{T,N,C,B}} = StaticInt{B}()
@@ -118,7 +118,7 @@ Base.unsafe_convert(::Type{Ptr{T}}, ptr::AbstractStridedPointer{T}) where {T} =
118118
# end
119119

120120
@inline vload(ptr::AbstractStridedPointer) = vload(pointer(ptr))
121-
@inline vstore!(ptr::AbstractStridedPointer{T}, v::T) where {T} = vstore!(pointer(ptr), v)
121+
@inline vstore!(ptr::AbstractStridedPointer{T}, v::T) where {T<:Number} = vstore!(pointer(ptr), v)
122122

123123
@generated function nopromote_axis_indicator(::AbstractStridedPointer{<:Any,N}) where {N}
124124
t = Expr(:tuple); foreach(n -> push!(t.args, True()), 1:N)

0 commit comments

Comments
 (0)