Fix nodiscard hipError_t and a test predicate for ROCm 7.2#10
Open
jeffdaily wants to merge 1 commit into
Open
Conversation
ROCm 7.2's HIP runtime marks hipError_t [[nodiscard]]. Several call sites ignore the returned status and, because the affected translation units are compiled with -Werror, fail to build under ROCm 7.2 (they built cleanly on the older ROCm this branch targets, where hipError_t is not nodiscard). Wrap each ignored status in RAFT_CUDA_TRY so the result is checked, matching the surrounding idiom. One is a library header (sparse/convert/detail/ adj_to_csr.cuh, an occupancy query); the rest are in the gtest sources for core, label, linalg, and sparse. Separately, the ball_cover test predicate is_nonzero took a mutable reference and was non-const, so it could not bind to the const value produced by a thrust transform iterator under ROCm 7.2; make it operator()(const uint32_t&) const (a predicate must not mutate its argument). All changes are portable: a checked return and a const-correct predicate are equally correct on CUDA, so the NVIDIA build is unaffected. Test Plan Built the affected test executables for gfx1100 under ROCm 7.2.1 and ran them on an AMD Radeon Pro W7800: ``` cmake -DBUILD_TESTS=ON -DCMAKE_HIP_ARCHITECTURES=gfx1100 . cmake --build . --target CORE_TEST LABEL_TEST LINALG_TEST SPARSE_TEST NEIGHBORS_TEST -j16 HIP_VISIBLE_DEVICES=<idle gpu> ctest ``` All previously-uncompilable executables now build and pass: CORE 269 (+1 skip), LABEL 14/14, LINALG 2070/2070, SPARSE 405 (+56 skip), NEIGHBORS 75/75. This work was authored with the assistance of Claude, an AI assistant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to #11 (gfx1100 / RDNA3 wave32 enablement), whose full test suite needs these fixes to build on ROCm 7.2.
ROCm 7.2 marks
hipError_t[[nodiscard]]. Several call sites ignore the returned status and, because the affected translation units are compiled with-Werror, fail to build under ROCm 7.2 (they built cleanly on the older ROCm this branch targets, wherehipError_tis not nodiscard).Each ignored status is wrapped in
RAFT_CUDA_TRYso the result is checked, matching the surrounding idiom. One is a library header (sparse/convert/detail/adj_to_csr.cuh, an occupancy query); the rest are in the gtest sources for core, label, linalg, and sparse. Separately, theball_covertest predicateis_nonzerotook a mutable, non-const reference and so could not bind to the const value produced by a thrust transform iterator under ROCm 7.2; it is nowoperator()(const uint32_t&) const(a predicate must not mutate its argument). All changes are portable: a checked return and a const-correct predicate are equally correct on CUDA, so the NVIDIA build is unaffected.Validation
Built the affected test executables for gfx1100 under ROCm 7.2.1 on an AMD Radeon Pro W7800:
All previously-uncompilable executables now build and pass: CORE 269 (+1 skip), LABEL 14/14, LINALG 2070/2070, SPARSE 405 (+56 skip), NEIGHBORS 75/75.
This work was authored with the assistance of Claude, an AI assistant.