You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/12/16 09:08:18 UTC

[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4527: [VTA] Fixed a crash issue in TSIM driver

liangfu commented on a change in pull request #4527: [VTA] Fixed a crash issue in TSIM driver
URL: https://github.com/apache/incubator-tvm/pull/4527#discussion_r358116691
 
 

 ##########
 File path: vta/src/tsim/tsim_driver.cc
 ##########
 @@ -188,25 +188,23 @@ TVM_REGISTER_GLOBAL("vta.tsim.profiler_status")
 }  // namespace vta
 
 void* VTAMemAlloc(size_t size, int cached) {
-  void * addr = vta::vmem::VirtualMemoryManager::Global()->Alloc(size);
-  return reinterpret_cast<void*>(vta::vmem::VirtualMemoryManager::Global()->GetPhyAddr(addr));
+  return vta::vmem::VirtualMemoryManager::Global()->Alloc(size);
 }
 
 void VTAMemFree(void* buf) {
-  void * addr = vta::vmem::VirtualMemoryManager::Global()->GetAddr(reinterpret_cast<uint64_t>(buf));
-  vta::vmem::VirtualMemoryManager::Global()->Free(addr);
+  vta::vmem::VirtualMemoryManager::Global()->Free(buf);
 }
 
 vta_phy_addr_t VTAMemGetPhyAddr(void* buf) {
-  return reinterpret_cast<uint64_t>(reinterpret_cast<uint64_t*>(buf));
+  return vta::vmem::VirtualMemoryManager::Global()->GetPhyAddr(buf);
 }
 
 void VTAMemCopyFromHost(void* dst, const void* src, size_t size) {
-  vta::vmem::VirtualMemoryManager::Global()->MemCopyFromHost(dst, src, size);
+  memcpy(dst, src, size);
 
 Review comment:
   In my observation, some part of the code reach to virtual addresses for data accessing.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services