Skip to content

Commit 68707b3

Browse files
Proper traced type inner of subarray (#946)
* Proper traced type inner of subarray * no bool * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6ef8f83 commit 68707b3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Tracing.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,20 @@ Base.@nospecializeinfer function traced_type_inner(
551551
end
552552
end
553553

554+
Base.@nospecializeinfer function Reactant.traced_type_inner(
555+
@nospecialize(OA::Type{SubArray{T,N,P,I,L}}),
556+
seen,
557+
mode::Reactant.TraceMode,
558+
@nospecialize(track_numbers::Type),
559+
@nospecialize(sharding),
560+
@nospecialize(runtime)
561+
) where {T,N,P,I,L}
562+
P2 = Reactant.traced_type_inner(P, seen, mode, track_numbers, sharding, runtime)
563+
I2 = Reactant.traced_type_inner(I, seen, mode, track_numbers, sharding, runtime)
564+
T2 = eltype(P2)
565+
return SubArray{T2,N,P2,I2,L}
566+
end
567+
554568
for P in (Ptr, Core.LLVMPtr, Base.RefValue)
555569
@eval Base.@nospecializeinfer function traced_type_inner(
556570
@nospecialize(PT::Type{$P}),

0 commit comments

Comments
 (0)