Skip to content

Commit

Permalink
Cherrypick adaptive fix from #688 PR (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsandham authored Dec 22, 2023
1 parent 456a62e commit 7f62842
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/src/level2/csrmv_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,10 @@ ROCSPARSE_DEVICE_ILF void csrmvn_adaptive_device(bool conj,
// For every other workgroup, wg_flags[first_wg_in_row] holds the value they wait on.
// If your flag == first_wg's flag, you spin loop.
// The first workgroup will eventually flip this flag, and you can move forward.
__syncthreads();
__threadfence();
while(gid != first_wg_in_row && lid == 0
&& ((rocsparse_atomic_max(&wg_flags[first_wg_in_row], 0U)) == compare_value))
;
__syncthreads();

// After you've passed the barrier, update your local flag to make sure that
// the next time through, you know what to wait on.
Expand Down

0 comments on commit 7f62842

Please sign in to comment.