marlin icon indicating copy to clipboard operation
marlin copied to clipboard

Question about the meaning of `slice_count` and `slice_idx` in global reduction condition

Open ZhengChen6 opened this issue 6 months ago • 0 comments

Hi, thanks a lot for your great work!

I have a question regarding the following piece of code:

if (slice_count > 1) { // only globally reduce if there is more than one block in a slice
    barrier_acquire(&locks[slice_col], slice_idx);
    global_reduce(slice_idx == 0, last);
    barrier_release(&locks[slice_col], last);
}

According to the comment, it seems that slice_count is meant to represent the number of blocks in a slice. However, from my understanding, slice_count actually refers to the number of slices in a column (i.e., how many slices there are in one column).
Could you please clarify what slice_count exactly represents here? Is it the number of blocks in a slice, or the number of slices in a column?

I also have a question about the variable slice_idx: does it indicate which slice (by index) this is within the current column?

Thanks in advance for your time and clarification!

ZhengChen6 avatar Jul 24 '25 09:07 ZhengChen6