Skip to content

Commit

Permalink
cpu: reorder: fix data race reported by clang tsan
Browse files Browse the repository at this point in the history
Adjust loop bounds when zeroing out compensation buffers to work for both
w/ and w/o oc tail
  • Loading branch information
bhavani-subramanian authored and tprimak committed Aug 19, 2021
1 parent 5bab17c commit 84b200f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpu/reorder/simple_reorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ struct simple_reorder_impl<SIMPLE_REORDER_TEMPL_CALL,
int32_t *zp = has_asymmetric_comp
? reinterpret_cast<int32_t *>(output + zp_offset)
: nullptr;
parallel_nd(G * NB_OC * ocblksize, [&](int i) {

parallel_nd(G * OC, [&](dim_t i) {
if (req_comp) cp[i] = 0;
if (has_asymmetric_comp) zp[i] = 0;
});
Expand Down

0 comments on commit 84b200f

Please sign in to comment.