MLIR  17.0.0git
Namespaces | Functions
IndexingUtils.h File Reference
#include "mlir/IR/Builders.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>
+ Include dependency graph for IndexingUtils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 Include the generated interface declarations.


int64_t mlir::linearize (ArrayRef< int64_t > offsets, ArrayRef< int64_t > basis)
 Computes and returns the linearized index of 'offsets' w.r.t. 'basis'. More...
SmallVector< int64_t > mlir::delinearize (ArrayRef< int64_t > strides, int64_t linearIndex)
 Given the strides together with a linear index in the dimension space, returns the vector-space offsets in each dimension for a de-linearized index. More...
SmallVector< int64_t > mlir::computeStrides (ArrayRef< int64_t > sizes)
 Given a set of sizes, compute and return the strides (i.e. More...
SmallVector< int64_t > mlir::computeElementwiseMul (ArrayRef< int64_t > v1, ArrayRef< int64_t > v2)
 Return a vector containing llvm::zip of v1 and v2 multiplied elementwise. More...
std::optional< SmallVector< int64_t > > mlir::computeShapeRatio (ArrayRef< int64_t > shape, ArrayRef< int64_t > subShape)
 Compute and return the multi-dimensional integral ratio of subShape to the trailing dimensions of shape. More...
int64_t mlir::computeMaxLinearIndex (ArrayRef< int64_t > basis)
 Return the number of elements of basis (i.e. More...
template<typename T , unsigned N>
void mlir::applyPermutationToVector (SmallVector< T, N > &inVec, ArrayRef< int64_t > permutation)
 Apply the permutation defined by permutation to inVec. More...
SmallVector< int64_t > mlir::invertPermutationVector (ArrayRef< int64_t > permutation)
 Helper method to apply to inverse a permutation. More...
bool mlir::isPermutationVector (ArrayRef< int64_t > interchange)
 Method to check if an interchange vector is a permutation. More...
SmallVector< int64_t > mlir::getI64SubArray (ArrayAttr arrayAttr, unsigned dropFront=0, unsigned dropBack=0)
 Helper that returns a subset of arrayAttr as a vector of int64_t. More...
mlir::AffineExpr mlir::getLinearAffineExpr (ArrayRef< int64_t > basis, mlir::Builder &b)
 Computes and returns linearized affine expression w.r.t. basis. More...
SmallVector< mlir::AffineExprmlir::getDelinearizedAffineExpr (ArrayRef< int64_t > strides, mlir::Builder &b)
 Given the strides in the dimension space, returns the affine expressions for vector-space offsets in each dimension for a de-linearized index. More...