Skip to content

Commit

Permalink
refactor: rename union type to ConcreteRScalar
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 29, 2024
1 parent 0daba07 commit abb4207
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ConcreteRArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ConcreteRArray(
return ConcreteRArray(fill(data); client, idx)
end

const ConcreteRNumberType{T} = Union{ConcreteRArray{T,0},ConcreteRNumber{T}}
const ConcreteRScalar{T} = Union{ConcreteRArray{T,0},ConcreteRNumber{T}}

Adapt.adapt_storage(::Type{T}, x::AbstractArray) where {T<:ConcreteRArray} = T(x)

Expand Down Expand Up @@ -83,7 +83,7 @@ end
# return ConcreteRArray{T,N}(x.data)
# end

function to_number(X::ConcreteRNumberType{T}) where {T}
function to_number(X::ConcreteRScalar{T}) where {T}
data = Ref{T}()
XLA.await(X.data)
buf = X.data.buffer
Expand All @@ -93,7 +93,7 @@ function to_number(X::ConcreteRNumberType{T}) where {T}
return data[]
end

Base.convert(::Type{T}, x::ConcreteRNumberType{T}) where {T} = to_number(x)
Base.convert(::Type{T}, x::ConcreteRScalar{T}) where {T} = to_number(x)

for jlop in (
:(Base.isless),
Expand Down Expand Up @@ -129,7 +129,7 @@ for T in (ConcreteRNumber, ConcreteRArray{<:Any,0})
end
end

function Base.show(io::IO, X::ConcreteRNumberType{T}) where {T}
function Base.show(io::IO, X::ConcreteRScalar{T}) where {T}
if X.data == XLA.AsyncEmptyBuffer
println(io, "<Empty buffer>")
return nothing
Expand Down

0 comments on commit abb4207

Please sign in to comment.