Skip to content

Commit df08dd5

Browse files
committed
Revert an upstream change to work around bad codegen.
1 parent 5ce89c3 commit df08dd5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/device/quirks.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ end
3636
# trig.jl
3737
@device_override @noinline Base.Math.sincos_domain_error(x) =
3838
@print_and_throw "sincos(x) is only defined for finite x."
39+
40+
# multidimensional.jl
41+
if VERSION >= v"1.7-"
42+
# XXX: the boundscheck change in JuliaLang/julia#42119 has exposed additional issues
43+
# with bad code generation by ptxas, so revert that changen for now.
44+
@device_override Base.@propagate_inbounds function Base.getindex(iter::CartesianIndices{N,R},
45+
I::Vararg{Int, N}) where {N,R}
46+
CartesianIndex(getindex.(iter.indices, I))
47+
end
48+
end

0 commit comments

Comments
 (0)