Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed May 24, 2024
1 parent 2c64a3d commit 67563e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/array_conversions.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Base: Array

## Conversion of structs to CPU

@inline remove_parameters(::T) where {T} = Base.typename(T).wrapper

const JR_T = Union{
JustRelax.StokesArrays,
JustRelax.SymmetricTensor,
Expand All @@ -12,8 +8,12 @@ const JR_T = Union{
JustRelax.Residual,
}

Array(::CPUBackendTrait, x) = x
## Conversion of structs to CPU

@inline remove_parameters(::T) where {T} = Base.typename(T).wrapper

Array(x::T) where {T<:JR_T} = Array(backend(x), x)
Array(::CPUBackendTrait, x) = x

function Array(::GPUBackendTrait, x::T) where {T<:JR_T}
nfields = fieldcount(T)
Expand Down

0 comments on commit 67563e2

Please sign in to comment.