Skip to content

Commit

Permalink
test case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
srkreddy1238 committed Jan 4, 2025
1 parent cf875bb commit 56d0739
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions python/tvm/runtime/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ def copyto(self, target, mem_scope=None):
return self._copyto(res)
raise ValueError(f"Unsupported target type {type(target)}")

def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset: int = 0):
def _create_view(
self,
shape,
dtype: Optional[str] = None,
relative_byte_offset: int = 0,
scope: str = "global",
):
"""Create a view into an existing array.
The view shares the same allocation and datatype as the
Expand Down Expand Up @@ -325,6 +331,9 @@ def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset:
start of the backing allocation, while the `relative_byte_offset`
is relative to the start of `self`.
scope: str
Memory scope of the requesting view
"""

if not isinstance(shape, tvm.runtime.ShapeTuple):
Expand All @@ -333,7 +342,7 @@ def _create_view(self, shape, dtype: Optional[str] = None, relative_byte_offset:
if dtype is None:
dtype = self.dtype

return _ffi_api.TVMArrayCreateView(self, shape, dtype, relative_byte_offset)
return _ffi_api.TVMArrayCreateView(self, shape, dtype, relative_byte_offset, scope)


def device(dev_type, dev_id=0):
Expand Down

0 comments on commit 56d0739

Please sign in to comment.