#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>
usingnamespacemlir;
#define DEBUG_TYPE …
#define DBGS() …
#define LDBG(X) …
static Attribute linearId0(MLIRContext *ctx) { … }
static Attribute linearId1(MLIRContext *ctx) { … }
static Attribute linearId2(MLIRContext *ctx) { … }
transform::gpu::CopyMappingInfo::CopyMappingInfo(MLIRContext *ctx,
int totalNumThreads,
int64_t desiredBitAlignment,
ArrayRef<int64_t> copySizes,
bool favorPredication,
int64_t elementalBitwidth) { … }
int64_t transform::gpu::CopyMappingInfo::maxContiguousElementsToTransfer(
int64_t desiredBitAlignment, int64_t numContiguousElements,
int64_t elementalBitwidth) { … }
static SmallVector<int64_t> getFactors(int64_t val) { … }
static int64_t product(ArrayRef<int64_t> vals) { … }
static SmallVector<int64_t> maximizeNumThreads(ArrayRef<int64_t> sizes,
int64_t currentIndex,
int64_t maxNumThreads) { … }
transform::gpu::CopyMappingInfo::Status
transform::gpu::CopyMappingInfo::inferNumThreads(int64_t totalNumThreads,
ArrayRef<int64_t> sizes,
int64_t desiredVectorSize,
bool favorPredication) { … }
transform::gpu::CopyMappingInfo::Status
transform::gpu::CopyMappingInfo::inferNumThreadsImpl(
int64_t totalNumThreads, ArrayRef<int64_t> sizes,
int64_t desiredVectorSize) { … }
void transform::gpu::CopyMappingInfo::print(llvm::raw_ostream &os) const { … }