Skip to content

Commit 48ef3a2

Browse files
authored
[Hexagon] Remove temporary VTCM workspace APIs (#13681)
1 parent 49ed544 commit 48ef3a2

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

src/runtime/hexagon/hexagon_device_api.cc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,6 @@ void HexagonDeviceAPI::FreeWorkspace(Device dev, void* data) {
157157
dmlc::ThreadLocalStore<HexagonWorkspacePool>::Get()->FreeWorkspace(dev, data);
158158
}
159159

160-
void* HexagonDeviceAPI::AllocVtcmWorkspace(Device dev, int ndim, const int64_t* shape,
161-
DLDataType dtype, Optional<String> mem_scope) {
162-
// must be Hexagon device (not CPU)
163-
CHECK(dev.device_type == kDLHexagon) << "dev.device_type: " << dev.device_type;
164-
CHECK((ndim == 1 || ndim == 2) && "Hexagon Device API supports only 1d and 2d allocations");
165-
return AllocDataSpace(dev, ndim, shape, dtype, mem_scope);
166-
}
167-
168-
void HexagonDeviceAPI::FreeVtcmWorkspace(Device dev, void* ptr) {
169-
// must be Hexagon device (not CPU)
170-
CHECK(dev.device_type == kDLHexagon) << "dev.device_type: " << dev.device_type;
171-
FreeDataSpace(dev, ptr);
172-
}
173-
174160
void HexagonDeviceAPI::CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle stream) {
175161
CHECK_EQ(from->byte_offset, 0);
176162
CHECK_EQ(to->byte_offset, 0);
@@ -268,7 +254,7 @@ TVM_REGISTER_GLOBAL("device_api.hexagon.alloc_nd").set_body([](TVMArgs args, TVM
268254
type_hint.lanes = 1;
269255

270256
HexagonDeviceAPI* hexapi = HexagonDeviceAPI::Global();
271-
*rv = hexapi->AllocVtcmWorkspace(dev, ndim, shape, type_hint, String(scope));
257+
*rv = hexapi->AllocDataSpace(dev, ndim, shape, type_hint, String(scope));
272258
});
273259

274260
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
283269
dev.device_id = device_id;
284270

285271
HexagonDeviceAPI* hexapi = HexagonDeviceAPI::Global();
286-
hexapi->FreeVtcmWorkspace(dev, ptr);
272+
hexapi->FreeDataSpace(dev, ptr);
287273
*rv = static_cast<int32_t>(0);
288274
});
289275

src/runtime/hexagon/hexagon_device_api.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,6 @@ class HexagonDeviceAPI final : public DeviceAPI {
138138
void* AllocDataSpace(Device dev, int ndim, const int64_t* shape, DLDataType dtype,
139139
Optional<String> mem_scope) final;
140140

141-
/*!
142-
* \brief Allocate an Nd VTCM workspace.
143-
* \param dev The device to perform the operation.
144-
* \param ndim The number of dimensions of allocated tensor.
145-
* \param shape The shape of allocated tensor.
146-
* \param dtype The element type.
147-
* \return The allocated HexagonBuffer pointer.
148-
*/
149-
void* AllocVtcmWorkspace(Device dev, int ndim, const int64_t* shape, DLDataType dtype,
150-
Optional<String> mem_scope);
151-
152-
//! \brief Free the allocated Nd VTCM workspace.
153-
void FreeVtcmWorkspace(Device dev, void* ptr);
154-
155141
/*!
156142
* \brief Copy data from one storage to another.
157143
* \note This API is designed to support special memory with shape dependent layout.

0 commit comments

Comments
 (0)