Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/runtime/hexagon/hexagon_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void HexagonDeviceAPI::GetAttr(Device dev, DeviceAttrKind kind, TVMRetValue* rv)
// DataSpace: static allocations for Hexagon
void* HexagonDeviceAPI::AllocDataSpace(Device dev, int ndim, const int64_t* shape, DLDataType dtype,
Optional<String> mem_scope) {
CHECK(shape) << "shape array is null";
CHECK(shape || ndim == 0) << "shape array is null for a non-scalar tensor, ndim = " << ndim;
CHECK(IsValidDevice(dev)) << "dev.device_type: " << dev.device_type;

// IMPORTANT NOTE!
Expand Down
3 changes: 3 additions & 0 deletions tests/cpp-runtime/hexagon/hexagon_device_api_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ TEST_F(HexagonDeviceAPITest, alloc_scalar) {

void* hexscalar = hexapi->AllocDataSpace(hex_dev, 0, new int64_t, int8, global_vtcm_scope);
CHECK(hexscalar != nullptr);

hexscalar = hexapi->AllocDataSpace(hex_dev, 0, nullptr, int8, global_vtcm_scope);
CHECK(hexscalar != nullptr);
}

// alloc and free of the same buffer on different devices should throw
Expand Down