Repository navigation
fix omp scan bug - #6560
fix omp scan bug#6560
Conversation
|
@charan-003 I added a few more tests. |
|
/ok to test ae2c2c7 |
This comment has been minimized.
This comment has been minimized.
|
/ok to test f549d50 |
This comment has been minimized.
This comment has been minimized.
|
/ok to test b0d8c74 |
This comment has been minimized.
This comment has been minimized.
|
/ok to test 9ea6902 |
This comment has been minimized.
This comment has been minimized.
|
@charan-003 I will review this next week. |
bernhardmgruber
left a comment
There was a problem hiding this comment.
This is looking good! A few nits, otherwise LGTM!
|
/ok to test a8df5c0 |
|
/ok to test 9a7675d |
This comment has been minimized.
This comment has been minimized.
|
Thank you so much for taking the time to push the fix through! |
|
@dkolsen-pgi please re-review and unblock. Thx! |
| { | ||
| ::cuda::std::exclusive_scan(block_sums.begin(), block_sums.end(), block_sums.begin(), accum_t{}, wrapped_binary_op); | ||
| // For no init inclusive scan: exclusive_scan starting at second element with first element as init | ||
| if (num_threads > 1) |
There was a problem hiding this comment.
You added the assertion as suggested, but forgot to remove this now unnecessary check for num_threads > 1.
There was a problem hiding this comment.
Right, thanks for bringing this up.
|
/ok to test 0b1e611 |
dkolsen-pgi
left a comment
There was a problem hiding this comment.
I only looked at scan.h, not at the tests. That file now looks good.
🥳 CI Workflow Results🟩 Finished in 1h 30m: Pass: 100%/84 | Total: 14h 28m | Max: 42m 40s | Hits: 88%/116157See results here. |
Co-authored-by: Bernhard Manfred Gruber <bernhardmgruber@gmail.com> (cherry picked from commit bb8a5b9)
|
Successfully created backport PR for |
…l#6560) (NVIDIA/cccl#6704) Upstream: NVIDIA/cccl@26c79ca HIP counterpart (system/hip): none (rocPRIM scan unaffected). Ported OMP scan fix in system/omp/detail/scan.h: blocks reduce with their first element as init (no accum_t{} identity assumption), no-init inclusive path seeds from block_sums[0] and thread 0 scans without prefix, serial fallback when n < max(threshold, num_threads); _CCCL_ASSERT dropped (not available locally; replaced by a comment). testing/scan.cu and testing/transform_scan.cu gain the new tests (THRUST_HOST_DEVICE spelling; kept local include guards, added <numeric>). test/ counterpart: mirrored in test/test_scan.cpp (Int with friend ops, TestScanWithUserDefinedTypeAndInit replacing TestInclusiveScanWithUserDefinedType, TestScanBug6317 using get_random_data, TestScanEdgeCases) and test/test_transform_scan.cpp (TransformInt, TestTransformScanEdgeCases). Not compiled, tests not run (per human) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) (NVIDIA/cccl#6704) Upstream: NVIDIA/cccl@26c79ca HIP counterpart (system/hip): none (rocPRIM scan unaffected). Ported OMP scan fix in system/omp/detail/scan.h: blocks reduce with their first element as init (no accum_t{} identity assumption), no-init inclusive path seeds from block_sums[0] and thread 0 scans without prefix, serial fallback when n < max(threshold, num_threads); _CCCL_ASSERT dropped (not available locally; replaced by a comment). testing/scan.cu and testing/transform_scan.cu gain the new tests (THRUST_HOST_DEVICE spelling; kept local include guards, added <numeric>). test/ counterpart: mirrored in test/test_scan.cpp (Int with friend ops, TestScanWithUserDefinedTypeAndInit replacing TestInclusiveScanWithUserDefinedType, TestScanBug6317 using get_random_data, TestScanEdgeCases) and test/test_transform_scan.cpp (TransformInt, TestTransformScanEdgeCases). Not compiled, tests not run (per human) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) (NVIDIA/cccl#6704) Upstream: NVIDIA/cccl@26c79ca HIP counterpart (system/hip): none (rocPRIM scan unaffected). Ported OMP scan fix in system/omp/detail/scan.h: blocks reduce with their first element as init (no accum_t{} identity assumption), no-init inclusive path seeds from block_sums[0] and thread 0 scans without prefix, serial fallback when n < max(threshold, num_threads); _CCCL_ASSERT dropped (not available locally; replaced by a comment). testing/scan.cu and testing/transform_scan.cu gain the new tests (THRUST_HOST_DEVICE spelling; kept local include guards, added <numeric>). test/ counterpart: mirrored in test/test_scan.cpp (Int with friend ops, TestScanWithUserDefinedTypeAndInit replacing TestInclusiveScanWithUserDefinedType, TestScanBug6317 using get_random_data, TestScanEdgeCases) and test/test_transform_scan.cpp (TransformInt, TestTransformScanEdgeCases). Not compiled, tests not run (per human) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) (NVIDIA/cccl#6704) Upstream: NVIDIA/cccl@26c79ca HIP counterpart (system/hip): none (rocPRIM scan unaffected). Ported OMP scan fix in system/omp/detail/scan.h: blocks reduce with their first element as init (no accum_t{} identity assumption), no-init inclusive path seeds from block_sums[0] and thread 0 scans without prefix, serial fallback when n < max(threshold, num_threads); _CCCL_ASSERT dropped (not available locally; replaced by a comment). testing/scan.cu and testing/transform_scan.cu gain the new tests (THRUST_HOST_DEVICE spelling; kept local include guards, added <numeric>). test/ counterpart: mirrored in test/test_scan.cpp (Int with friend ops, TestScanWithUserDefinedTypeAndInit replacing TestInclusiveScanWithUserDefinedType, TestScanBug6317 using get_random_data, TestScanEdgeCases) and test/test_transform_scan.cpp (TransformInt, TestTransformScanEdgeCases). Not compiled, tests not run (per human) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) (NVIDIA/cccl#6704) Upstream: NVIDIA/cccl@26c79ca HIP counterpart (system/hip): none (rocPRIM scan unaffected). Ported OMP scan fix in system/omp/detail/scan.h: blocks reduce with their first element as init (no accum_t{} identity assumption), no-init inclusive path seeds from block_sums[0] and thread 0 scans without prefix, serial fallback when n < max(threshold, num_threads); _CCCL_ASSERT dropped (not available locally; replaced by a comment). testing/scan.cu and testing/transform_scan.cu gain the new tests (THRUST_HOST_DEVICE spelling; kept local include guards, added <numeric>). test/ counterpart: mirrored in test/test_scan.cpp (Int with friend ops, TestScanWithUserDefinedTypeAndInit replacing TestInclusiveScanWithUserDefinedType, TestScanBug6317 using get_random_data, TestScanEdgeCases) and test/test_transform_scan.cpp (TransformInt, TestTransformScanEdgeCases). Not compiled, tests not run (per human) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) Upstream: NVIDIA/cccl@bb8a5b9 - already ported — identical to its `branch/3.2.x` backport 26c79caf60e (NVIDIA/cccl#6704; `+`/`-` lines compared, no difference), ported in ad694ae plus parity fix 5bdd5a9; `thrust/system/omp/detail/scan.h`, `testing/scan.cu` and `testing/transform_scan.cu` already match - HIP counterpart: none (no `thrust/system/cuda/` change) - test/ counterpart: `test/test_scan.cpp` / `test/test_transform_scan.cpp` handled when the backport was ported (ad694ae); no further change - Not compiled, tests not run (autonomous no-build mode) Co-Authored-By: Claude <noreply@anthropic.com>
…l#6560) Upstream: NVIDIA/cccl@bb8a5b9 - already ported — identical to its `branch/3.2.x` backport 26c79caf60e (NVIDIA/cccl#6704; `+`/`-` lines compared, no difference), ported in ad694ae plus parity fix 5bdd5a9; `thrust/system/omp/detail/scan.h`, `testing/scan.cu` and `testing/transform_scan.cu` already match - HIP counterpart: none (no `thrust/system/cuda/` change) - test/ counterpart: `test/test_scan.cpp` / `test/test_transform_scan.cpp` handled when the backport was ported (ad694ae); no further change - Not compiled, tests not run (autonomous no-build mode) Co-Authored-By: Claude <noreply@anthropic.com>
using the first element of each block as the init value
closes #6317