You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2020/06/23 16:10:34 UTC

[incubator-tvm] branch v0.6 updated: [BACKPORT-0.6][Bugfix][VTA] Fixed a crash issue in TSIM driver (#5894)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch v0.6
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/v0.6 by this push:
     new 06352b7  [BACKPORT-0.6][Bugfix][VTA] Fixed a crash issue in TSIM driver (#5894)
06352b7 is described below

commit 06352b7d15ec370215b9e6aacd7edba3ddef63fe
Author: Liangfu Chen <li...@icloud.com>
AuthorDate: Wed Jun 24 00:10:22 2020 +0800

    [BACKPORT-0.6][Bugfix][VTA] Fixed a crash issue in TSIM driver (#5894)
---
 vta/src/tsim/tsim_driver.cc | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/vta/src/tsim/tsim_driver.cc b/vta/src/tsim/tsim_driver.cc
index 94e5858..646dbe1 100644
--- a/vta/src/tsim/tsim_driver.cc
+++ b/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);
 }
 
 void VTAMemCopyToHost(void* dst, const void* src, size_t size) {
-  vta::vmem::VirtualMemoryManager::Global()->MemCopyToHost(dst, src, size);
+  memcpy(dst, src, size);
 }
 
 void VTAFlushCache(void* vir_addr, vta_phy_addr_t phy_addr, int size) {