MLIR  19.0.0git
Classes | Namespaces | Typedefs | Functions
MemRefUtils.h File Reference
#include "mlir/ExecutionEngine/CRunnerUtils.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <functional>
#include <initializer_list>
#include <memory>
#include <optional>

Go to the source code of this file.

Classes

class  mlir::OwningMemRef< T, Rank >
 Owning MemRef type that abstracts over the runtime type for ranked strided memref. More...
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::detail
 Detect if any of the given parameter types has a sub-element handler.
 

Typedefs

using mlir::AllocFunType = llvm::function_ref< void *(size_t)>
 
template<typename T >
using mlir::ElementWiseVisitor = llvm::function_ref< void(T &ptr, ArrayRef< int64_t >)>
 Convenient callback to "visit" a memref element by element. More...
 

Functions

template<size_t N>
std::array< int64_t, N > mlir::detail::makeStrides (ArrayRef< int64_t > shape)
 Given a shape with sizes greater than 0 along all dimensions, returns the distance, in number of elements, between a slice in a dimension and the next slice in the same dimension. More...
 
template<int N, typename T >
std::enable_if<(N >=1), StridedMemRefType< T, N > >::type mlir::detail::makeStridedMemRefDescriptor (T *ptr, T *alignedPtr, ArrayRef< int64_t > shape, ArrayRef< int64_t > shapeAlloc)
 Build a StridedMemRefDescriptor<T, N> that matches the MLIR ABI. More...
 
template<int N, typename T >
std::enable_if<(N==0), StridedMemRefType< T, 0 > >::type mlir::detail::makeStridedMemRefDescriptor (T *ptr, T *alignedPtr, ArrayRef< int64_t > shape={}, ArrayRef< int64_t > shapeAlloc={})
 Build a StridedMemRefDescriptor<T, 0> that matches the MLIR ABI. More...
 
template<typename T >
std::pair< T *, T * > mlir::detail::allocAligned (size_t nElements, AllocFunType allocFun=&::malloc, std::optional< uint64_t > alignment=std::optional< uint64_t >())
 Align nElements of type T with an optional alignment. More...