Skip to content

Commit 8864fe0

Browse files
committed
Make is_column_major(::AbstractRange) return False()
1 parent f306a4e commit 8864fe0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/stridelayout.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ Returns `Val{true}` if elements of `A` are stored in column major order. Otherwi
222222
is_column_major(A) = is_column_major(stride_rank(A), contiguous_batch_size(A))
223223
is_column_major(sr::Nothing, cbs) = False()
224224
is_column_major(sr::R, cbs) where {R} = _is_column_major(sr, cbs)
225+
is_column_major(::AbstractRange) = False()
225226

226227
# cbs > 0
227228
_is_column_major(sr::R, cbs::StaticInt) where {R} = False()

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ using OffsetArrays
412412
@test @inferred(ArrayInterface.is_column_major(@SArray(zeros(2,2,2)))) === True()
413413
@test @inferred(ArrayInterface.is_column_major(A)) === True()
414414
@test @inferred(ArrayInterface.is_column_major(B)) === True()
415-
@test @inferred(ArrayInterface.is_column_major(-4:7)) === True()
415+
@test @inferred(ArrayInterface.is_column_major(-4:7)) === False()
416416
@test @inferred(ArrayInterface.is_column_major(PermutedDimsArray(A,(3,1,2)))) === False()
417417
@test @inferred(ArrayInterface.is_column_major(@view(PermutedDimsArray(A,(3,1,2))[2,1:2,:]))) === True()
418418
@test @inferred(ArrayInterface.is_column_major(@view(PermutedDimsArray(A,(3,1,2))[2,1:2,:])')) === False()

0 commit comments

Comments
 (0)