Skip to content

Commit

Permalink
random other changes without thinking hard
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Jan 30, 2024
1 parent 5de3ac1 commit e07dd87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/TransmuteDims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ Base.axes(A::TransmutedDimsArray{T,N,P}) where {T,N,P} =

Base.similar(A::TransmutedDimsArray, T::Type, dims::Base.Dims) = similar(parent(A), T, dims)

# This was needed on Julia 1.8 or so, but isn't used on 1.11
# Base.unsafe_convert(::Type{Ptr{T}}, A::TransmutedDimsArray{T}) where {T} =
# Base.unsafe_convert(Ptr{T}, parent(A))
Base.unsafe_convert(::Type{Ptr{T}}, A::TransmutedDimsArray{T}) where {T} =
Base.unsafe_convert(Ptr{T}, parent(A))
pointer(parent(A))

# It's OK to return a pointer to the first element, and indeed quite
# useful for wrapping C routines that require a different storage
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ JLArrays.allowscalar(false)
# eager
@test transmutedims(jm, (0,1,2)) isa JLArray
@test transmutedims(jm, (2,1)) isa JLArray
@test_broken transmutedims(jm, (2,0,1)) isa JLArray # permutedims!(dest::Base.ReshapedArray{Float64, 2, JLArray{Float64, 3}, Tuple{}}, src::JLArray{Float64, 2}, perm::Tuple{Int64, Int64})
@test transmutedims(jm, (2,0,1)) isa JLArray # permutedims!(dest::Base.ReshapedArray{Float64, 2, JLArray{Float64, 3}, Tuple{}}, src::JLArray{Float64, 2}, perm::Tuple{Int64, Int64})

end

Expand Down

0 comments on commit e07dd87

Please sign in to comment.