Commit 26720576 authored by rocking's avatar rocking
Browse files

Fix bug of welford count

parent 35cffc47
......@@ -216,12 +216,16 @@ struct GridwiseNormalizationSplitK1st
});
}
int welford_count = 0;
static_for<0, MThreadSliceSize, 1>{}([&](auto I) {
if constexpr(I > 0)
block_sync_lds();
int count = threadwise_welford.cur_count_;
BlockwiseWelford::Run(mean_thread_buf(I), var_thread_buf(I), count);
if constexpr(I == MThreadSliceSize - 1)
welford_count = count;
});
if(thread_k_cluster_id == 0)
......@@ -239,7 +243,7 @@ struct GridwiseNormalizationSplitK1st
var_global_val_buf);
if(block_m_cluster_id == 0 && thread_m_cluster_id == 0)
p_welford_count_global[block_k_cluster_id] = threadwise_welford.cur_count_;
p_welford_count_global[block_k_cluster_id] = welford_count;
}
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment