From d06c6de57410eaaef78605b38bdb885cc98c1840 Mon Sep 17 00:00:00 2001 From: Janet Schneider Date: Mon, 2 Jan 2023 16:49:24 -0800 Subject: [PATCH] Remove temporary VTCM workspace APIs --- src/runtime/hexagon/hexagon_device_api.cc | 18 ++---------------- src/runtime/hexagon/hexagon_device_api.h | 14 -------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/runtime/hexagon/hexagon_device_api.cc b/src/runtime/hexagon/hexagon_device_api.cc index a1d55db42f28..ee2a826b02ea 100644 --- a/src/runtime/hexagon/hexagon_device_api.cc +++ b/src/runtime/hexagon/hexagon_device_api.cc @@ -157,20 +157,6 @@ void HexagonDeviceAPI::FreeWorkspace(Device dev, void* data) { dmlc::ThreadLocalStore::Get()->FreeWorkspace(dev, data); } -void* HexagonDeviceAPI::AllocVtcmWorkspace(Device dev, int ndim, const int64_t* shape, - DLDataType dtype, Optional mem_scope) { - // must be Hexagon device (not CPU) - CHECK(dev.device_type == kDLHexagon) << "dev.device_type: " << dev.device_type; - CHECK((ndim == 1 || ndim == 2) && "Hexagon Device API supports only 1d and 2d allocations"); - return AllocDataSpace(dev, ndim, shape, dtype, mem_scope); -} - -void HexagonDeviceAPI::FreeVtcmWorkspace(Device dev, void* ptr) { - // must be Hexagon device (not CPU) - CHECK(dev.device_type == kDLHexagon) << "dev.device_type: " << dev.device_type; - FreeDataSpace(dev, ptr); -} - void HexagonDeviceAPI::CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle stream) { CHECK_EQ(from->byte_offset, 0); CHECK_EQ(to->byte_offset, 0); @@ -268,7 +254,7 @@ TVM_REGISTER_GLOBAL("device_api.hexagon.alloc_nd").set_body([](TVMArgs args, TVM type_hint.lanes = 1; HexagonDeviceAPI* hexapi = HexagonDeviceAPI::Global(); - *rv = hexapi->AllocVtcmWorkspace(dev, ndim, shape, type_hint, String(scope)); + *rv = hexapi->AllocDataSpace(dev, ndim, shape, type_hint, String(scope)); }); TVM_REGISTER_GLOBAL("device_api.hexagon.free_nd").set_body([](TVMArgs args, TVMRetValue* rv) { @@ -283,7 +269,7 @@ TVM_REGISTER_GLOBAL("device_api.hexagon.free_nd").set_body([](TVMArgs args, TVMR dev.device_id = device_id; HexagonDeviceAPI* hexapi = HexagonDeviceAPI::Global(); - hexapi->FreeVtcmWorkspace(dev, ptr); + hexapi->FreeDataSpace(dev, ptr); *rv = static_cast(0); }); diff --git a/src/runtime/hexagon/hexagon_device_api.h b/src/runtime/hexagon/hexagon_device_api.h index e3adaf65548d..c4e87a957ade 100644 --- a/src/runtime/hexagon/hexagon_device_api.h +++ b/src/runtime/hexagon/hexagon_device_api.h @@ -138,20 +138,6 @@ class HexagonDeviceAPI final : public DeviceAPI { void* AllocDataSpace(Device dev, int ndim, const int64_t* shape, DLDataType dtype, Optional mem_scope) final; - /*! - * \brief Allocate an Nd VTCM workspace. - * \param dev The device to perform the operation. - * \param ndim The number of dimensions of allocated tensor. - * \param shape The shape of allocated tensor. - * \param dtype The element type. - * \return The allocated HexagonBuffer pointer. - */ - void* AllocVtcmWorkspace(Device dev, int ndim, const int64_t* shape, DLDataType dtype, - Optional mem_scope); - - //! \brief Free the allocated Nd VTCM workspace. - void FreeVtcmWorkspace(Device dev, void* ptr); - /*! * \brief Copy data from one storage to another. * \note This API is designed to support special memory with shape dependent layout.