Skip to content

Commit

Permalink
Changes due to rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalda committed Feb 22, 2022
1 parent 8f5b9d4 commit 3e4de50
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,16 @@ def replace_npu_address_range_with_address(npu_addr_range):
assert isinstance(npu_addr_range.address, tvm.tir.Load)
buffer = npu_addr_range.address.buffer_var
if buffer in scratch_region_map.keys():
# Check whether the Load itself has an offset
tensor_idx = int(npu_addr_range.address.index.value)
return vapi.NpuAddressRange(
scratch_region_map[buffer].region,
scratch_region_map[buffer].offset,
scratch_region_map[buffer].offset + tensor_idx,
npu_addr_range.length,
)
assert buffer in buffer_addresses.keys(), f"searching for buffer : {buffer}, but not found"
address, buffer_type = buffer_addresses[buffer]
address = address + npu_addr_range.address.index.value
address = address + int(npu_addr_range.address.index.value)
return vapi.NpuAddressRange(_get_region(buffer_type), address, npu_addr_range.length)

def replace_tir_loads(npu_object):
Expand Down

0 comments on commit 3e4de50

Please sign in to comment.