diff --git a/include/tvm/runtime/memory/memory_manager.h b/include/tvm/runtime/memory/memory_manager.h index aa02ee87e178b..d759f765b6c8d 100644 --- a/include/tvm/runtime/memory/memory_manager.h +++ b/include/tvm/runtime/memory/memory_manager.h @@ -139,7 +139,8 @@ class StorageObj : public Object { /*! \brief The index into the VM function table. */ Buffer buffer; - /* \brief Common function to create an NDArray container with the provided offset, shape and dtype */ + /* \brief Common function to create an NDArray container with the provided offset, shape and dtype + */ NDArray::Container* CreateNDArrayContainer(int64_t offset, ShapeTuple shape, DLDataType dtype); /*! \brief Allocate an NDArray from a given piece of storage. */ diff --git a/src/runtime/hexagon/hexagon_device_api.cc b/src/runtime/hexagon/hexagon_device_api.cc index fbcf8ee62a700..daaa32b71bd5d 100644 --- a/src/runtime/hexagon/hexagon_device_api.cc +++ b/src/runtime/hexagon/hexagon_device_api.cc @@ -169,9 +169,7 @@ void HexagonDeviceAPI::FreeWorkspace(Device dev, void* data) { dmlc::ThreadLocalStore::Get()->FreeWorkspace(dev, data); } -void* get_data_start(DLTensor* tensor) { - return (reinterpret_cast(tensor->data)); -} +void* get_data_start(DLTensor* tensor) { return (reinterpret_cast(tensor->data)); } void HexagonDeviceAPI::CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle stream) { CHECK_EQ(from->byte_offset, 0); diff --git a/src/runtime/memory/memory_manager.cc b/src/runtime/memory/memory_manager.cc index 554aa743ee537..aadf227a027f5 100644 --- a/src/runtime/memory/memory_manager.cc +++ b/src/runtime/memory/memory_manager.cc @@ -83,7 +83,8 @@ inline size_t GetDataAlignment(const DLTensor& arr) { return align; } -NDArray::Container* StorageObj::CreateNDArrayContainer(int64_t offset, ShapeTuple shape, DLDataType dtype) { +NDArray::Container* StorageObj::CreateNDArrayContainer(int64_t offset, ShapeTuple shape, + DLDataType dtype) { VerifyDataType(dtype); // crtical zone: allocate header, cannot throw diff --git a/src/runtime/relax_vm/hexagon/builtin.cc b/src/runtime/relax_vm/hexagon/builtin.cc index 8bff4338f2272..60728e5ee4ac8 100644 --- a/src/runtime/relax_vm/hexagon/builtin.cc +++ b/src/runtime/relax_vm/hexagon/builtin.cc @@ -58,16 +58,16 @@ TVM_REGISTER_GLOBAL("vm.builtin.hexagon.dma_wait") tvm::runtime::hexagon::HexagonDeviceAPI::Global()->UserDMA()->Wait(queue_id, inflight_dma); }); -NDArray AllocNDArrayFromOffsets(TVMArgValue vm_ptr, Storage storage, uint64_t offset, Storage data_storage, - ShapeTuple data_storage_offsets, - ShapeTuple logical_shape, ShapeTuple shape_2d, - DLDataType dtype) { +NDArray AllocNDArrayFromOffsets(TVMArgValue vm_ptr, Storage storage, uint64_t offset, + Storage data_storage, ShapeTuple data_storage_offsets, + ShapeTuple logical_shape, ShapeTuple shape_2d, DLDataType dtype) { auto* storageObj = storage.operator->(); auto* container = storageObj->CreateNDArrayContainer(offset, logical_shape, dtype); size_t needed_size = sizeof(void*) * shape_2d[0]; - auto offset_ptr = reinterpret_cast(storageObj->buffer.data) + static_cast(offset); + auto offset_ptr = + reinterpret_cast(storageObj->buffer.data) + static_cast(offset); auto cast_offset_ptr = reinterpret_cast(offset_ptr); uint8_t* data_base = reinterpret_cast(data_storage->buffer.data); size_t indx = 0;