This is an automated email from the ASF dual-hosted git repository.
wuwei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 5d07423a20 [Fix][TIR] Fix outdated call to create extern buffer in
make_extern (#17138)
5d07423a20 is described below
commit 5d07423a201ba194b837c80882c9c8939e5e4f35
Author: Hussein Taher <[email protected]>
AuthorDate: Thu Jul 11 01:02:14 2024 +0200
[Fix][TIR] Fix outdated call to create extern buffer in make_extern (#17138)
Fix outdated call to DeclExternBuffer in make_extern
---
include/tvm/topi/detail/extern.h | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/include/tvm/topi/detail/extern.h b/include/tvm/topi/detail/extern.h
index e6a98162d3..87fa2c06fe 100644
--- a/include/tvm/topi/detail/extern.h
+++ b/include/tvm/topi/detail/extern.h
@@ -36,21 +36,6 @@ namespace detail {
using namespace tvm::te;
-/*!
- * \brief Construct a buffer to pass to an external function
- *
- * \param shape The shape of the buffer
- * \param dtype The type of the buffer elements
- * \param name The name of the buffer
- *
- * \return The Buffer object
- */
-inline Buffer DeclExternBuffer(Array<PrimExpr> shape, DataType dtype,
std::string name) {
- auto data = var(name, DataType::Handle());
- auto elem_offset = PrimExpr();
- return Buffer(data, dtype, shape, Array<PrimExpr>(), elem_offset, name, -1,
0, kDefault);
-}
-
/*!
* \brief A function which constructs an Expr representing the invocation of
an external
* function. The function expects two arguments: an array of Buffers holding
the input
@@ -84,11 +69,11 @@ inline Array<Tensor> make_extern(const
Array<Array<PrimExpr>>& out_shapes,
Array<Buffer> input_placeholders;
for (auto t : inputs) {
- input_placeholders.push_back(DeclExternBuffer(t->shape, t->dtype,
t->op->name));
+ input_placeholders.push_back(tvm::tir::decl_buffer(t->shape, t->dtype,
t->op->name));
}
Array<Buffer> output_placeholders;
for (size_t i = 0; i < out_shapes.size(); ++i) {
- output_placeholders.push_back(DeclExternBuffer(out_shapes[i],
out_types[i], name));
+ output_placeholders.push_back(tvm::tir::decl_buffer(out_shapes[i],
out_types[i], name));
}
auto body = fextern(input_placeholders, output_placeholders);