Skip to content

Commit

Permalink
[TIR] Introduce BufferLoad/Store (#5205)
Browse files Browse the repository at this point in the history
Co-authored-by: Siyuan Feng <hzfengsy@sjtu.edu.cn>

This PR introduces BufferLoad/Store to TIR. The new nodes will replace
Provide and Call with Tensor arguments in the subsequent refactors.
  • Loading branch information
tqchen authored Apr 2, 2020
1 parent 4e5c584 commit 88d2f34
Show file tree
Hide file tree
Showing 15 changed files with 590 additions and 326 deletions.
14 changes: 8 additions & 6 deletions include/tvm/tir/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
#define TVM_TIR_BUFFER_H_

#include <tvm/node/container.h>
#include <tvm/tir/expr.h>
#include <tvm/tir/op.h>

#include <tvm/ir/expr.h>
#include <tvm/tir/var.h>
#include <string>


Expand All @@ -36,6 +35,9 @@ namespace tir {
// Internal node container Buffer
class BufferNode;

// forward declare Stmt
class Stmt;

/*! \brief buffer type */
enum BufferType : int {
kDefault = 1,
Expand Down Expand Up @@ -75,9 +77,9 @@ class Buffer : public ObjectRef {
* \param offset The offset of ptr.
*/
TVM_DLL PrimExpr access_ptr(int access_mask,
DataType ptr_type = DataType::Handle(),
int content_lanes = 1,
PrimExpr offset = make_const(DataType::Int(32), 0)) const;
DataType ptr_type = DataType::Handle(),
int content_lanes = 1,
PrimExpr offset = IntImm(DataType::Int(32), 0)) const;
/*!
* \brief Create an Expr that does a vector load at begin index.
* \param begin The beginning index
Expand Down
Loading

0 comments on commit 88d2f34

Please sign in to comment.