Skip to content

Commit fa961c5

Browse files
committed
fixup! datadeps: Validate ManyMemorySpan inner span lengths
1 parent ea87a2e commit fa961c5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/datadeps/remainders.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ function compute_remainder_for_arg!(state::DataDepsState,
164164
end
165165

166166
# Create our remainder as an interval tree over all target ainfos
167+
VERIFY_SPAN_CURRENT_OBJECT[] = arg_w.arg
167168
remainder = IntervalTree{ManyMemorySpan{N}}(ManyMemorySpan{N}(ntuple(i -> target_ainfos[i][j], N)) for j in 1:nspans)
168169

169170
# Create our tracker
@@ -227,6 +228,7 @@ function compute_remainder_for_arg!(state::DataDepsState,
227228
get_read_deps!(state, other_space, other_ainfo, write_num, tracker_other_space[2])
228229
end
229230
end
231+
VERIFY_SPAN_CURRENT_OBJECT[] = nothing
230232

231233
if isempty(tracker) || all(tracked->isempty(tracked[1]), values(tracker))
232234
return NoAliasing(), 0

src/utils/memory-span.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ function span_diff(span1::ManyMemorySpan{N}, span2::ManyMemorySpan{N}) where N
9393
verify_span(span)
9494
return span
9595
end
96+
const VERIFY_SPAN_CURRENT_OBJECT = TaskLocalValue{Any}(()->nothing)
9697
function verify_span(span::ManyMemorySpan{N}) where N
97-
@assert allequal(span_len, span.spans) "All spans must be the same: $(map(span_len, span.spans))"
98+
@assert allequal(span_len, span.spans) "All spans must be the same: $(map(span_len, span.spans))\nWhile processing $(typeof(VERIFY_SPAN_CURRENT_OBJECT[]))"
9899
end
99100

100101
struct ManyPair{N} <: Unsigned

0 commit comments

Comments
 (0)