Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
quic-sanirudh committed Feb 12, 2024
1 parent 37683e4 commit bb61e41
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion include/tvm/runtime/memory/memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
4 changes: 1 addition & 3 deletions src/runtime/hexagon/hexagon_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ void HexagonDeviceAPI::FreeWorkspace(Device dev, void* data) {
dmlc::ThreadLocalStore<HexagonWorkspacePool>::Get()->FreeWorkspace(dev, data);
}

void* get_data_start(DLTensor* tensor) {
return (reinterpret_cast<uint8_t*>(tensor->data));
}
void* get_data_start(DLTensor* tensor) { return (reinterpret_cast<uint8_t*>(tensor->data)); }

void HexagonDeviceAPI::CopyDataFromTo(DLTensor* from, DLTensor* to, TVMStreamHandle stream) {
CHECK_EQ(from->byte_offset, 0);
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/memory/memory_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/runtime/relax_vm/hexagon/builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t*>(storageObj->buffer.data) + static_cast<size_t>(offset);
auto offset_ptr =
reinterpret_cast<uint8_t*>(storageObj->buffer.data) + static_cast<size_t>(offset);
auto cast_offset_ptr = reinterpret_cast<uint8_t**>(offset_ptr);
uint8_t* data_base = reinterpret_cast<uint8_t*>(data_storage->buffer.data);
size_t indx = 0;
Expand Down

0 comments on commit bb61e41

Please sign in to comment.