diff --git a/CHANGELOG.md b/CHANGELOG.md index e7a598f6..5c2fc4e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Full documentation for rocSPARSE is available at [rocsparse.readthedocs.io](http - Fixed bug in ellmv - Optimized bsr2csr routine - Fixed integer overflow bugs +- Fixes a bug in COO SpMV gridsize ## rocSPARSE 2.3.2 for ROCm 5.3.0 ### Added diff --git a/library/src/level2/rocsparse_coomv.cpp b/library/src/level2/rocsparse_coomv.cpp index 6604f8e5..c675b489 100644 --- a/library/src/level2/rocsparse_coomv.cpp +++ b/library/src/level2/rocsparse_coomv.cpp @@ -424,7 +424,7 @@ rocsparse_status rocsparse_coomv_segmented_dispatch(rocsparse_handle ha I minblocks = (nnz - 1) / COOMVN_DIM + 1; I nblocks = maxblocks < minblocks ? maxblocks : minblocks; - I nloops = (nnz / COOMVN_DIM + 1) / nblocks + 1; + I nloops = (nnz - 1) / (COOMVN_DIM * nblocks) + 1; // Buffer char* ptr = reinterpret_cast(handle->buffer); diff --git a/library/src/level2/rocsparse_coomv_aos.cpp b/library/src/level2/rocsparse_coomv_aos.cpp index 971602cc..ffbf7aff 100644 --- a/library/src/level2/rocsparse_coomv_aos.cpp +++ b/library/src/level2/rocsparse_coomv_aos.cpp @@ -272,7 +272,7 @@ rocsparse_status rocsparse_coomv_aos_segmented_dispatch(rocsparse_handle I minblocks = (nnz - 1) / COOMVN_DIM + 1; I nblocks = maxblocks < minblocks ? maxblocks : minblocks; - I nloops = (nnz / COOMVN_DIM + 1) / nblocks + 1; + I nloops = (nnz - 1) / (COOMVN_DIM * nblocks) + 1; // Buffer char* ptr = reinterpret_cast(handle->buffer);