MLIR
20.0.0git
|
#include "mlir/Dialect/Linalg/TransformOps/GPUHeuristics.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cmath>
#include <numeric>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "linalg-transforms" |
#define | DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ") |
#define | LDBG(X) LLVM_DEBUG(DBGS() << X << "\n") |
Functions | |
static Attribute | linearId0 (MLIRContext *ctx) |
static Attribute | linearId1 (MLIRContext *ctx) |
static Attribute | linearId2 (MLIRContext *ctx) |
static SmallVector< int64_t > | getFactors (int64_t val) |
Get the list of all factors that divide val , not just the prime factors. More... | |
static int64_t | product (ArrayRef< int64_t > vals) |
static SmallVector< int64_t > | maximizeNumThreads (ArrayRef< int64_t > sizes, int64_t currentIndex, int64_t maxNumThreads) |
Extract result from sizes with the following constraints: More... | |
#define DBGS | ( | ) | (llvm::dbgs() << "[" DEBUG_TYPE "]: ") |
Definition at line 24 of file GPUHeuristics.cpp.
#define DEBUG_TYPE "linalg-transforms" |
Definition at line 23 of file GPUHeuristics.cpp.
#define LDBG | ( | X | ) | LLVM_DEBUG(DBGS() << X << "\n") |
Definition at line 25 of file GPUHeuristics.cpp.
|
static |
Get the list of all factors that divide val
, not just the prime factors.
Definition at line 104 of file GPUHeuristics.cpp.
Referenced by maximizeNumThreads().
|
static |
Definition at line 27 of file GPUHeuristics.cpp.
References mlir::get().
Referenced by mlir::transform::gpu::CopyMappingInfo::CopyMappingInfo().
|
static |
Definition at line 30 of file GPUHeuristics.cpp.
References mlir::get().
Referenced by mlir::transform::gpu::CopyMappingInfo::CopyMappingInfo().
|
static |
Definition at line 33 of file GPUHeuristics.cpp.
References mlir::get().
Referenced by mlir::transform::gpu::CopyMappingInfo::CopyMappingInfo().
|
static |
Extract result
from sizes
with the following constraints:
currentIndex
is sizes.size() - 1, then threadsPerDim[currentIndex] must be sizes[currentIndex]. This is used to greedily extract the maximum number of threads usable for mapping a copy of size sizes
, while being bounded by totalNumThreads
and ensuring coalesced access along the most minor dimension. Return the number of threads used in the range: threadsPerDim[currentIndex .. sizes.end()] Definition at line 137 of file GPUHeuristics.cpp.
References DBGS, getFactors(), LDBG, and product().
|
static |
Definition at line 116 of file GPUHeuristics.cpp.
Referenced by mlir::sparse_tensor::genReshapeDstShape(), getProductOfIntsOrIndexes(), maximizeNumThreads(), mlir::presburger::QuasiPolynomial::operator*(), and simplifyMul().