tvm
|
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types, used to specify the memory layout of the Tensor used in program input. More...
#include <buffer.h>
Public Member Functions | |
Buffer (Var ptr, DataType dtype, Array< PrimExpr > shape, Array< PrimExpr > strides, PrimExpr elem_offset, String name, int data_alignment, int offset_factor, BufferType buffer_type, Span span=Span()) | |
Buffer | MakeStrideView () const |
Return a new buffer that is equivalent with current one but always add stride field. More... | |
Buffer | MakeSlice (Array< PrimExpr > begins, Array< PrimExpr > extents) const |
Make a new symbolic buffer representing a slice of the buffer. More... | |
PrimExpr | access_ptr (int access_mask, DataType ptr_type=DataType::Handle(), int content_lanes=1, PrimExpr offset=IntImm(DataType::Int(32), 0)) const |
Get access ptr to the entire buffer. More... | |
PrimExpr | vload (Array< PrimExpr > begin, DataType dtype) const |
Create an Expr that does a vector load at begin index. More... | |
Stmt | vstore (Array< PrimExpr > begin, PrimExpr value) const |
Create a Stmt that does a vector store at begin index. More... | |
String | scope () const |
Return the storage scope associated with this buffer. More... | |
TVM_DEFINE_OBJECT_REF_METHODS (Buffer, ObjectRef, BufferNode) | |
TVM_DEFINE_OBJECT_REF_COW_METHOD (BufferNode) | |
![]() | |
ObjectRef ()=default | |
default constructor More... | |
ObjectRef (ObjectPtr< Object > data) | |
Constructor from existing object ptr. More... | |
bool | same_as (const ObjectRef &other) const |
Comparator. More... | |
bool | operator== (const ObjectRef &other) const |
Comparator. More... | |
bool | operator!= (const ObjectRef &other) const |
Comparator. More... | |
bool | operator< (const ObjectRef &other) const |
Comparator. More... | |
bool | defined () const |
const Object * | get () const |
const Object * | operator-> () const |
bool | unique () const |
int | use_count () const |
template<typename ObjectType > | |
const ObjectType * | as () const |
Try to downcast the internal Object to a raw pointer of a corresponding type. More... | |
Additional Inherited Members | |
![]() | |
using | ContainerType = Object |
type indicate the container type. More... | |
![]() | |
static constexpr bool | _type_is_nullable = true |
![]() | |
Object * | get_mutable () const |
![]() | |
template<typename T > | |
static T | DowncastNoCheck (ObjectRef ref) |
Internal helper function downcast a ref without check. More... | |
static void | FFIClearAfterMove (ObjectRef *ref) |
Clear the object ref data field without DecRef after we successfully moved the field. More... | |
template<typename ObjectType > | |
static ObjectPtr< ObjectType > | GetDataPtr (const ObjectRef &ref) |
Internal helper function get data_ as ObjectPtr of ObjectType. More... | |
![]() | |
ObjectPtr< Object > | data_ |
Internal pointer that backs the reference. More... | |
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types, used to specify the memory layout of the Tensor used in program input.
tvm::tir::Buffer::Buffer | ( | Var | ptr, |
DataType | dtype, | ||
Array< PrimExpr > | shape, | ||
Array< PrimExpr > | strides, | ||
PrimExpr | elem_offset, | ||
String | name, | ||
int | data_alignment, | ||
int | offset_factor, | ||
BufferType | buffer_type, | ||
Span | span = Span() |
||
) |
PrimExpr tvm::tir::Buffer::access_ptr | ( | int | access_mask, |
DataType | ptr_type = DataType::Handle() , |
||
int | content_lanes = 1 , |
||
PrimExpr | offset = IntImm(DataType::Int(32), 0) |
||
) | const |
Get access ptr to the entire buffer.
access_mask | The access mask |
ptr_type | The type of the pointer. |
content_lanes | The number of lanes for the (data) type. |
offset | The offset of ptr. |
Make a new symbolic buffer representing a slice of the buffer.
begins | The beginning position of each dimension. |
extents | The extent of each dimension. |
Buffer tvm::tir::Buffer::MakeStrideView | ( | ) | const |
Return a new buffer that is equivalent with current one but always add stride field.
String tvm::tir::Buffer::scope | ( | ) | const |
Return the storage scope associated with this buffer.
tvm::tir::Buffer::TVM_DEFINE_OBJECT_REF_COW_METHOD | ( | BufferNode | ) |
tvm::tir::Buffer::TVM_DEFINE_OBJECT_REF_METHODS | ( | Buffer | , |
ObjectRef | , | ||
BufferNode | |||
) |
Create an Expr that does a vector load at begin index.
begin | The beginning index |
dtype | The data type to be loaded. |
Create a Stmt that does a vector store at begin index.
begin | The beginning index |
value | The value to be stored. |