MLIR
20.0.0git
|
Owning MemRef type that abstracts over the runtime type for ranked strided memref. More...
#include "mlir/ExecutionEngine/MemRefUtils.h"
Public Types | |
using | DescriptorType = StridedMemRefType< T, Rank > |
using | FreeFunType = std::function< void(DescriptorType)> |
Public Member Functions | |
OwningMemRef (ArrayRef< int64_t > shape, ArrayRef< int64_t > shapeAlloc={}, ElementWiseVisitor< T > init={}, std::optional< uint64_t > alignment=std::optional< uint64_t >(), AllocFunType allocFun=&::malloc, std::function< void(StridedMemRefType< T, Rank >)> freeFun=[](StridedMemRefType< T, Rank > descriptor) { ::free(descriptor.data);}) | |
Allocate a new dense StridedMemrefRef with a given shape . More... | |
OwningMemRef (DescriptorType descriptor, FreeFunType freeFunc) | |
Take ownership of an existing descriptor with a custom deleter. More... | |
~OwningMemRef () | |
OwningMemRef (const OwningMemRef &)=delete | |
OwningMemRef & | operator= (const OwningMemRef &)=delete |
OwningMemRef & | operator= (const OwningMemRef &&other) |
OwningMemRef (OwningMemRef &&other) | |
DescriptorType & | operator* () |
DescriptorType * | operator-> () |
T & | operator[] (std::initializer_list< int64_t > indices) |
Owning MemRef type that abstracts over the runtime type for ranked strided memref.
Definition at line 135 of file MemRefUtils.h.
using mlir::OwningMemRef< T, Rank >::DescriptorType = StridedMemRefType<T, Rank> |
Definition at line 137 of file MemRefUtils.h.
using mlir::OwningMemRef< T, Rank >::FreeFunType = std::function<void(DescriptorType)> |
Definition at line 138 of file MemRefUtils.h.
|
inline |
Allocate a new dense StridedMemrefRef with a given shape
.
An optional shapeAlloc
array can be supplied to "pad" every dimension individually. If an ElementWiseVisitor is provided, it will be used to initialize the data, else the memory will be zero-initialized. The alloc and free method used to manage the data allocation can be optionally provided, and default to malloc/free.
Definition at line 146 of file MemRefUtils.h.
|
inline |
Take ownership of an existing descriptor with a custom deleter.
Definition at line 182 of file MemRefUtils.h.
|
inline |
Definition at line 184 of file MemRefUtils.h.
|
delete |
|
inline |
Definition at line 196 of file MemRefUtils.h.
|
inline |
Definition at line 198 of file MemRefUtils.h.
|
inline |
Definition at line 199 of file MemRefUtils.h.
|
inline |
Definition at line 190 of file MemRefUtils.h.
|
delete |
|
inline |
Definition at line 200 of file MemRefUtils.h.