MLIR 24.0.0git
OpenACCUtilsCG.h File Reference
#include "mlir/Dialect/OpenACC/OpenACC.h"
#include "mlir/Dialect/OpenACC/OpenACCParMapping.h"
#include "mlir/IR/Builders.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.
ActiveParDimsAttr mlir::acc::getActiveParDimsAttr (Operation *op)
 Obtain the active parallel dimensions carried by op, if any.
bool mlir::acc::hasActiveParDimsAttr (Operation *op)
 Return whether op carries active parallel dimensions.
void mlir::acc::setActiveParDimsAttr (Operation *op, ActiveParDimsAttr attr)
 Set active parallel dimensions on op.
void mlir::acc::setActiveParDimsAttr (Operation *op, ArrayRef< GPUParallelDimAttr > dims)
 Set active parallel dimensions on op from a dimension list.
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.
bool mlir::acc::hasAttachPoint (Operation *mapEntryOp)
 Returns true when mapEntryOp carries an attach point (varPtrPtr).
DataDescKind mlir::acc::getDataDescKind (Operation *mapEntryOp)
 Returns descriptor kind from acc.map_info, or none for other ops.
Value mlir::acc::getDesc (Operation *mapEntryOp)
 Returns descriptor value from acc.map_info.
std::optional< int64_tmlir::acc::getMapElementSize (Operation *mapEntryOp)
 Returns element size in bytes from acc.map_info, if present.
Value mlir::acc::getMapSize (Operation *mapEntryOp)
 Returns the optional size operand from acc.map_info, or null.
std::optional< MapFlags > mlir::acc::getMapFlags (Operation *mapEntryOp)
 Returns offload map-type flags from acc.map_info, if present.
MapFlags mlir::acc::computePrivatizeMapFlags (PrivatizeOp privatizeOp, const ACCToGPUMappingPolicy &policy)
 Compute the private and parallel-level map flags for privatized storage.
MapFlags mlir::acc::computeDataClauseMapFlags (Operation *entryOp, bool ptrAndObj)
 Fold enter (+ paired exit) data-clause semantics into offload map flags.
bool mlir::acc::hasCopyOutSibling (Operation *entryOp)
 True when another data clause of the same construct maps the same variable with a copy-back and no copy-in.
SmallVector< Operation * > mlir::acc::getPairedDataExitOps (Value entryResult)
 Returns the data exit operations paired with the data entry result entryResult, which take it as their accVar.
int64_t mlir::acc::computeMapInfoSizeBytes (Value var, Type varType, DataDescKind descKind, ValueRange bounds, const DataLayout &dataLayout, OpenACCSupport *support=nullptr)
 Compute total mapped byte size for acc.map_info.
void mlir::acc::populateSourceExtents (ValueRange bounds, ArrayRef< int64_t > shape, OpBuilder &builder)
 Record known extents of the source array on bounds that may describe a section.