Skip to content

Commit 4fe1f5d

Browse files
committed
don't adapt Array{MArray}
1 parent b82370d commit 4fe1f5d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/auxiliary/containers.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,13 @@ function Adapt.adapt_storage(::TrixiAdaptor{Storage, Real},
388388
adapt(Storage{StaticArrays.similar_type(T, Real)}, x)
389389
end
390390

391+
# Our threaded cache contains MArray, it is unlikely that we would want to adapt those
392+
function Adapt.adapt_storage(::TrixiAdaptor{Storage, Real},
393+
x::Array{T}) where {Storage, Real,
394+
T <: StaticArrays.MArray}
395+
adapt(Array{StaticArrays.similar_type(T, Real)}, x)
396+
end
397+
391398
function Adapt.adapt_storage(::TrixiAdaptor{Storage, Real},
392399
x::AbstractArray) where {Storage, Real}
393400
adapt(Storage, x)

0 commit comments

Comments
 (0)