adstraw commented on code in PR #13381:
URL: https://github.com/apache/tvm/pull/13381#discussion_r1023111163
##########
src/runtime/hexagon/hexagon_buffer.cc:
##########
@@ -237,8 +236,15 @@ void hexagon_buffer_copy_across_regions(const BufferSet&
dest, const BufferSet&
// Finally, do the memory copies.
for (const auto& copy : macro_copies) {
- int error_code = hexagon_user_dma_1d_sync(copy.dest, copy.src,
copy.num_bytes);
- CHECK_EQ(error_code, 0);
+ qurt_mem_cache_clean(reinterpret_cast<qurt_addr_t>(copy.dest),
copy.num_bytes,
+ QURT_MEM_CACHE_INVALIDATE, QURT_MEM_DCACHE);
+ qurt_mem_cache_clean(reinterpret_cast<qurt_addr_t>(copy.src),
copy.num_bytes,
+ QURT_MEM_CACHE_INVALIDATE, QURT_MEM_DCACHE);
+ memcpy(copy.dest, copy.src, copy.num_bytes);
+ qurt_mem_cache_clean(reinterpret_cast<qurt_addr_t>(copy.dest),
copy.num_bytes,
+ QURT_MEM_CACHE_INVALIDATE, QURT_MEM_DCACHE);
+ qurt_mem_cache_clean(reinterpret_cast<qurt_addr_t>(copy.src),
copy.num_bytes,
+ QURT_MEM_CACHE_INVALIDATE, QURT_MEM_DCACHE);
Review Comment:
That is, unless ION buffers are managed differently w.r.t. their
cacheability that would alleviate the need for the invalidation. Will make
note of all this in the TODO.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]