MLIR 24.0.0git
OpenACCUtilsCG.h File Reference
#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "mlir/Dialect/OpenACC/OpenACCParMapping.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/DataLayoutInterfaces.h"
#include "mlir/Support/LogicalResult.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>

Go to the source code of this file.

Classes

class  mlir::acc::SharedMemoryBudget
 Tracks aligned byte consumption against a configurable shared memory cap. More...

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::acc

Functions

std::optional< DataLayoutmlir::acc::getDataLayout (Operation *op, bool allowDefault=true)
 Get the data layout for an operation.
ComputeRegionOp mlir::acc::buildComputeRegion (Location loc, ValueRange launchArgs, ValueRange inputArgs, llvm::StringRef origin, Region &regionToClone, RewriterBase &rewriter, IRMapping &mapping, ValueRange output={}, FlatSymbolRefAttr kernelFuncName={}, FlatSymbolRefAttr kernelModuleName={}, Value stream={}, ValueRange inputArgsToMap={})
 Build an acc.compute_region operation by cloning a source region.
void mlir::acc::insertParDim (llvm::SmallVector< GPUParallelDimAttr > &parDims, GPUParallelDimAttr parDim)
 Insert parDim into parDims while preserving dimension ordering.
void mlir::acc::removeParDim (llvm::SmallVector< GPUParallelDimAttr > &parDims, GPUParallelDimAttr parDim)
 Remove parDim from parDims if present.
GPUParallelDimsAttr mlir::acc::getParDimsAttr (Operation *op)
 Obtain the parallel dimensions carried by op, if any.
bool mlir::acc::hasParDimsAttr (Operation *op)
 Return whether op carries parallel dimensions.
bool mlir::acc::hasSeqParDims (Operation *op)
 Return whether op carries sequential parallel dimensions.
void mlir::acc::setParDimsAttr (Operation *op, GPUParallelDimsAttr attr)
 Set parallel dimensions on op.
void mlir::acc::updateParDimsAttr (Operation *op, GPUParallelDimsAttr attr)
 Update parallel dimensions on op.
void mlir::acc::copyParDimsAttr (Operation *from, Operation *to)
 Copy parallel dimensions from from to to.
bool mlir::acc::hasGPUBlockRedundantAttr (Operation *op)
 Return whether op is marked with the acc.gpu_block_redundant attribute, i.e.
void mlir::acc::setGPUBlockRedundantAttr (Operation *op)
 Mark op with the acc.gpu_block_redundant attribute.
GPUParallelDimsAttr mlir::acc::getGangDim1ParDimsAttr (MLIRContext *ctx, ACCToGPUMappingPolicy &policy)
 Create a gang dim 1 GPUParallelDimsAttr based on the mapping policy.
GPUParallelDimsAttr mlir::acc::getSeqParDimsAttr (MLIRContext *ctx, ACCToGPUMappingPolicy &policy)
 Create a sequential GPUParallelDimsAttr based on the mapping policy.
int64_t mlir::acc::sumExistingSharedMemoryBytes (Region &region)
 Sum aligned static_upper_bound_bytes for all acc.gpu_shared_memory in region.
PrivatizeOp mlir::acc::getPrivatizeOp (PrivateLocalOp privateLocal, ComputeRegionOp computeRegion)
 Resolve the acc.privatize operation associated with a private local.
MemRefType mlir::acc::getPrivateBaseMemRefType (Type baseTy, ModuleOp module)
 Returns the ranked MemRef type used to allocate privatized storage.
SmallVector< GPUParallelDimAttr > mlir::acc::collectPrivateLocalParDims (PrivateLocalOp privateLocal, ComputeRegionOp computeRegion)
 Collect parallel dimensions that govern privatization of privateLocal.
FailureOr< boolmlir::acc::isPrivateLocalSharedMemoryCandidate (PrivateLocalOp privateLocal, ComputeRegionOp computeRegion, ModuleOp module, const ACCToGPUMappingPolicy &policy, OpenACCSupport *support=nullptr)
 True when privateLocal may be placed in shared memory.
std::optional< int64_tmlir::acc::getPrivateLocalSharedMemoryUpperBoundBytes (PrivateLocalOp privateLocal, ComputeRegionOp computeRegion, ModuleOp module, const ACCToGPUMappingPolicy &policy, OpenACCSupport *support=nullptr)
 Upper-bound byte size for a shared-memory private_local candidate, or std::nullopt when not eligible or not statically computable.