Skip to content

Commit

Permalink
Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 30, 2024
1 parent 1bcd90a commit 4952b70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/Reactant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ include("utils.jl")

abstract type RArray{ElType,Shape,N} <: AbstractArray{ElType,N} end

@inline Base.eltype(::RArray{ElType,Shape}) where {ElType, Shape} = ElType
@inline Base.size(::RArray{ElType,Shape}) where {ElType, Shape} = Shape
@inline Base.size(::Type{<:RArray{ElType,Shape}}) where {ElType, Shape} = Shape
@inline Base.ndims(::RArray{ElType,Shape, N}) where {ElType, Shape, N} = N
@inline Base.ndims(::Type{<:RArray{ElType,Shape, N}}) where {ElType, Shape, N} = N
@inline Base.eltype(::RArray{ElType,Shape}) where {ElType,Shape} = ElType
@inline Base.size(::RArray{ElType,Shape}) where {ElType,Shape} = Shape
@inline Base.size(::Type{<:RArray{ElType,Shape}}) where {ElType,Shape} = Shape
@inline Base.ndims(::RArray{ElType,Shape,N}) where {ElType,Shape,N} = N
@inline Base.ndims(::Type{<:RArray{ElType,Shape,N}}) where {ElType,Shape,N} = N

@inline mlir_type(::RArray{ElType,Shape,N}) where {ElType,Shape,N} =
MLIR.IR.TensorType(Shape, MLIR.IR.Type(ElType))
Expand Down Expand Up @@ -168,7 +168,7 @@ end
seen[prev] = res
return res
end

attr = fill(MLIR.IR.Attribute(eltype(RT)(0)), mlir_type(prev))
cst = MLIR.IR.result(MLIR.Dialects.stablehlo.constant(; value=attr), 1)
res = RT((), cst)
Expand All @@ -195,8 +195,8 @@ include("overloads.jl")

using Enzyme

@inline val_value(::Val{T}) where T = T
@inline val_value(::Type{Val{T}}) where T = T
@inline val_value(::Val{T}) where {T} = T
@inline val_value(::Type{Val{T}}) where {T} = T

@enum TraceMode begin
ConcreteToTraced = 1
Expand Down Expand Up @@ -827,7 +827,7 @@ function generate_jlfunc(
return nothing
end

error("cannot copy $T")
return error("cannot copy $T")
end

create_result(concrete_result, :result, ())
Expand Down
5 changes: 3 additions & 2 deletions src/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ Cassette.overdub(context::TraceCtx, f::typeof(Base.materialize!), args...) = f(a

@inline Base.copyto!(dest::TracedRArray, bc::Broadcasted{Nothing}) = _copyto!(dest, bc) # Keep it for ArrayConflict

@inline function Base.copyto!(dest::TracedRArray{ElType, Shape, N},
src::TracedRArray{ElType, Shape, N}) where {ElType, Shape, N}
@inline function Base.copyto!(
dest::TracedRArray{ElType,Shape,N}, src::TracedRArray{ElType,Shape,N}
) where {ElType,Shape,N}
dest.mlir_data = src.mlir_data
return dest
end
Expand Down

0 comments on commit 4952b70

Please sign in to comment.