hipfile/fastpath: Ensure (buffer_address + buffer_offset) is aligned#175
hipfile/fastpath: Ensure (buffer_address + buffer_offset) is aligned#175kurtmcmillan wants to merge 12 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes alignment validation in the fastpath implementation by ensuring that the combined buffer_address + buffer_offset is properly aligned, rather than checking only buffer_offset in isolation.
Changes:
- Updated alignment checks to validate
buffer_address + buffer_offsetinstead of justbuffer_offset - Added comprehensive test coverage including a new
TestDefaultstest andScoreRejectsBufferAddressPlusBufferOffsetIsUnalignedtest - Expanded parameterized test cases with additional edge cases and conditional compilation guards
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/amd_detail/backend/fastpath.cpp | Modified alignment validation logic to check combined buffer address and offset |
| test/amd_detail/fastpath.cpp | Added new tests, updated default test values for proper alignment, and added EXPECT_CALL for getBuffer() across all tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1250c5b to
288426a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
288426a to
2904af6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2904af6 to
3b23b45
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Ensure DEFAULT_MEM_ALIGN and DEFAULT_OFFSET_ALIGN are powers of 2 (> 1) - Ensure DEFAULT_BUFFER_ADDR is DEFAULT_MEM_ALIGN aligned - Ensure DEFAULT_BUFFER_OFFSET is DEFAULT_MEM_ALIGN aligned - Ensure DEFAULT_FILE_OFFSET is DEFAULT_OFFSET_ALIGN aligned - Ensure DEFAULT_IO_SIZE is DEFAULT_OFFSET_ALIGN aligned
FastpathAlignedIoSizesParam should only be instantiated with size_t values. -DEFAULT_OFFSET_ALIGN became 4294966784 in the test.
FastpathUnalignedIoSizesParam should only be instantiated with size_t values. (-DEFAULT_OFFSET_ALIGN + 1) became 4294966785 in the test.
Cast DEFAULT_OFFSET_ALIGN to hoff_t before negating to ensure the test is
instantiated with the expected value.
-DEFAULT_OFFSET_ALIGN -> 4294966784
-static_cast<hoff_t>(DEFAULT_OFFSET_ALIGN) -> -512
…Param
Cast DEFAULT_OFFSET_ALIGN to hoff_t before negating to ensure the test is
instantiated with the expected value.
-DEFAULT_OFFSET_ALIGN -> 4294966784
-static_cast<hoff_t>(DEFAULT_OFFSET_ALIGN) -> -512
…fsetsParam We should be passing in a file offset value not a buffer offset value.
…Param
Cast DEFAULT_OFFSET_ALIGN to hoff_t before negating to ensure the test is
instantiated with the expected value.
-DEFAULT_MEM_ALIGN -> 4294967292
-static_cast<hoff_t>(DEFAULT_MEM_ALIGN) -> -4
…tsParam
Cast DEFAULT_OFFSET_ALIGN to hoff_t before negating to ensure the test is
instantiated with the expected value.
-DEFAULT_MEM_ALIGN -> 4294967292
-static_cast<hoff_t>(DEFAULT_MEM_ALIGN) -> -4
Removes alignment check duplication.
3b23b45 to
af88d42
Compare
No description provided.