rocfile: Untangle rocFileIo(...) and Fallback backend tests.#88
Merged
Conversation
When a client issues an IO with an unregistered buffer, a temporary buffer object is created. This test ensures the correct error value is returned if the creation of the temporary buffer object throws a Hip::RuntimeError.
Ensure that rocFileIo returns the correct return value if a client issues an IO with an unregistered buffer with an unsupported memory type.
RocFileFallbackValidation::fallback_io_throws_on_bounce_buffer_allocation_failure ensures a Sys::RuntimeError is thrown on mmap failure. RocFileWrite::fallback_write_throws_on_pwrite_exception ensures Fallback::io throws on pwrite error. RocFileRead::fallback_read_throws_on_pread_exception ensures Fallback::io throws on pread error.
If the Fallback backend is the only backend available ensure that zero sized IOs are passed through to pread/pwrite.
Backends should test for invalid arguments and throw std::invalid_argument.
RocFileWrite::fallback_write_throws_on_hipmemcpy_failure, RocFileWrite::fallback_write_throws_on_hipstreamsynchronize_error, and RocFileRead::fallback_read_throws_on_hipmemcpy_failure ensure Fallback::io throws Hip::RuntimeError if the coresponding HIP call throws.
Moving these tests to test/rocfile.cpp as test/io.cpp will be moved to test/fallback.cpp in a future commit.
This test is covered by FallbackWrite::fallback_write_overwite_entire_file.
c6bf2b8 to
22b8518
Compare
derobins
reviewed
Nov 25, 2025
riley-dixon
approved these changes
Nov 25, 2025
Collaborator
riley-dixon
left a comment
There was a problem hiding this comment.
Looks good. Only thing I could comment on is whether we should update the test names in rocfile/test/fallback.cpp from snake_case to UpperCamelCase to align with GTest recommendations, but not really a huge deal.
jordan-turbofish
approved these changes
Nov 25, 2025
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.
No description provided.