You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@inlinefunction_unsafe_view_impl(IFwd::NTuple{M,Base.Slice}, A::UnsafeArray{T,N}, i::DenseIdx, I::Integer...) where {T,M,N}
@assert IFwd ==ntuple(i ->axes(A)[i], Val{M}())
I_all = (IFwd..., i, I...)
@boundscheckcheckbounds(A, I_all...)
iflength(A) ==0
p =pointer(A)
else
startidxs =map(first, (IFwd..., i, I...))
sub_s =_sub_size(I_all...)
p =pointer(A, LinearIndices(size(A))[startidxs...])
endUnsafeArray(p, sub_s)
end
but I wonder if that branch would have negative performance impacts in code that's taking a lot of views (e.g. blocking SIMD), so I wonder if there's a non-branching way to do this.
The text was updated successfully, but these errors were encountered:
Discovered in MasonProtter/Bumper.jl#43, here's a MWE:
Compare
against
Offending code is https://github.com/JuliaArrays/UnsafeArrays.jl/blob/main/src/unsafe_array.jl#L89-L97
I guess the easiest would be to do something like
but I wonder if that branch would have negative performance impacts in code that's taking a lot of views (e.g. blocking SIMD), so I wonder if there's a non-branching way to do this.
The text was updated successfully, but these errors were encountered: