Skip to content

Commit c5899b0

Browse files
nsajkovchuravy
andauthored
inline the AbstractArray change, the other are not necessary
Co-authored-by: Valentin Churavy <[email protected]>
1 parent e86a332 commit c5899b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/KernelAbstractions.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,13 @@ function get_backend_recur(f::F, x) where {F}
520520
end
521521

522522
# Should cover SubArray, ReshapedArray, ReinterpretArray, Hermitian, AbstractTriangular, etc.:
523-
get_backend(A::AbstractArray) = get_backend_recur(parent, A)
523+
function get_backend(A::AbstractArray)
524+
P = parent(A)
525+
if P isa typeof(A)
526+
throw(ArgumentError("Implement `KernelAbstractions.get_backend(::$(typeof(A)))`"))
527+
end
528+
return get_backend(P)
529+
end
524530

525531
# Define:
526532
# adapt_storage(::Backend, a::Array) = adapt(BackendArray, a)

0 commit comments

Comments
 (0)