areusch commented on pull request #7415:
URL: https://github.com/apache/tvm/pull/7415#issuecomment-775363561


   @manupa-arm @grant-arm it seems to me that this change is replacing pointer 
dereferences to `**strm` with `memcpy`. this is the correct thing to do, so now 
we just need to test it. the issue now is that it compiles fine, but at runtime 
would trigger an unaligned load. this issue should be present across platforms. 
I think we could write a test that intentionally calls `TVMNDArray_Load` with 
unaligned `strm`. i'm not suggesting we need to test every single case of 
mis-alignment, but a single test that calls TVMNDArray_Load with unaligned 
`strm` should be sufficient to trigger the failure without this patch.
   
   now as to producing unaligned `strm`: I'm suggesting we malloc a block 
larger than we need, add `n` bytes to the pointer (`n` = 7 - ((uintptr_t) ptr) 
& 0x7), and fill that location with valid `strm`. then pass to 
`TVMNDArray_Load`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to