Skip to content
Closed
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
3 changes: 3 additions & 0 deletions python/tvm/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def vstore(self, begin, value):
begin = (begin,) if isinstance(begin, (int, _expr.Expr)) else begin
return _api_internal._BufferVStore(self, begin, value)

def make_stride_view(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document this function

return _api_internal._BufferMakeStrideView(self)


@register_node
class Split(NodeBase):
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/tensor_intrin.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def decl_tensor_intrin(op,
buf = (binds[t] if t in binds else
_api.decl_buffer(t.shape, t.dtype, t.op.name,
data_alignment=cfg.data_alignment,
offset_factor=cfg.offset_factor))
offset_factor=cfg.offset_factor).make_stride_view())
binds_list.append(buf)

body = fcompute(binds_list[:len(inputs)], binds_list[len(inputs):])
Expand Down
6 changes: 6 additions & 0 deletions src/api/api_lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ TVM_REGISTER_API("_BufferVStore")
.vstore(args[1], args[2]);
});

TVM_REGISTER_API("_BufferMakeStrideView")
.set_body([](TVMArgs args, TVMRetValue* ret) {
*ret = args[0].operator Buffer()
.MakeStrideView();
});

TVM_REGISTER_API("_Tensor")
.set_body([](TVMArgs args, TVMRetValue* ret) {
*ret = TensorNode::make(args[0],
Expand Down