MLIR 24.0.0git
ACCKernelLaunchPatterns.cpp File Reference

Go to the source code of this file.

Functions

static bool isDevicePtrMapping (Value operand)
static bool isDataEntryInsideEnvironment (KernelEnvironmentOp environment, Value operand)
static MapFlags getKernelDataClauseMapFlags (Operation *entryOp)
 The flags of a data clause operation that maps a kernel argument.
static MapFlags getKernelArgMapFlags (Value operand, bool alreadyMapped, const ACCRuntimeCallConfig &config)
 The flags a kernel argument is passed with.
static FailureOr< Value > getKernelArgDescriptor (Location loc, Value operand, Value converted, bool alreadyMapped, OpenACCSupport &accSupport, ConversionPatternRewriter &rewriter)
 The descriptor of a kernel argument.
static FailureOr< ACCDataRuntimeArgs > emitKernelRuntimeArgs (gpu::LaunchFuncOp launch, gpu::LaunchFuncOpAdaptor adaptor, ValueRange alreadyMappedOperands, ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config)
 Emits the argument arrays of the kernel launched by launch, one entry per kernel operand.
static FailureOr< Value > createKernelArgumentStruct (gpu::LaunchFuncOp launch, gpu::LaunchFuncOpAdaptor adaptor, ValueRange alreadyMappedOperands, ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config)
static FailureOr< Value > getKernelPointer (gpu::LaunchFuncOp launch, ConversionPatternRewriter &rewriter, Region &globalSymbolRegion, SymbolTable &symbolTable)
static void declareLibc (SymbolTable &symbolTable, Region &globalSymbolRegion, Location loc, StringRef name, Type result, ArrayRef< Type > arguments)
static void emitHostFallbackNotImplemented (Location loc, Value status, ConversionPatternRewriter &rewriter, Region &globalSymbolRegion, SymbolTable &symbolTable)
 The kernel entry point reports a status other than success when the kernel could not run on the device.
static LogicalResult emitKernelCall (gpu::LaunchFuncOp launch, gpu::LaunchFuncOpAdaptor adaptor, Value asyncQueue, ValueRange alreadyMappedOperands, ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config)

Function Documentation

◆ createKernelArgumentStruct()

◆ declareLibc()

void declareLibc ( SymbolTable & symbolTable,
Region & globalSymbolRegion,
Location loc,
StringRef name,
Type result,
ArrayRef< Type > arguments )
static

◆ emitHostFallbackNotImplemented()

void emitHostFallbackNotImplemented ( Location loc,
Value status,
ConversionPatternRewriter & rewriter,
Region & globalSymbolRegion,
SymbolTable & symbolTable )
static

The kernel entry point reports a status other than success when the kernel could not run on the device.

The program is then meant to run the region on the host, which is not implemented, so the failure is reported and the program stops.

Definition at line 279 of file ACCKernelLaunchPatterns.cpp.

References declareLibc(), mlir::acc::getInternalGlobalName(), mlir::acc::getOrCreateGlobalString(), mlir::Block::getParent(), mlir::acc::Success, and success().

Referenced by emitKernelCall().

◆ emitKernelCall()

◆ emitKernelRuntimeArgs()

FailureOr< ACCDataRuntimeArgs > emitKernelRuntimeArgs ( gpu::LaunchFuncOp launch,
gpu::LaunchFuncOpAdaptor adaptor,
ValueRange alreadyMappedOperands,
ConversionPatternRewriter & rewriter,
OpenACCSupport & accSupport,
Region & globalSymbolRegion,
SymbolTable & symbolTable,
const ACCRuntimeCallConfig & config )
static

◆ getKernelArgDescriptor()

FailureOr< Value > getKernelArgDescriptor ( Location loc,
Value operand,
Value converted,
bool alreadyMapped,
OpenACCSupport & accSupport,
ConversionPatternRewriter & rewriter )
static

The descriptor of a kernel argument.

The device address the environment returned is passed as is, since the runtime would map an address that carries a descriptor again.

Definition at line 95 of file ACCKernelLaunchPatterns.cpp.

References mlir::acc::constantI64(), mlir::createACCArgumentDescriptor(), mlir::createACCMemRefDescriptorWrapperArg(), mlir::acc::OpenACCSupport::emitNYI(), mlir::Value::getDefiningOp(), mlir::Value::getType(), mlir::acc::getTypeSizeAndAlignment(), and mlir::acc::isDataEntryOp().

Referenced by emitKernelRuntimeArgs().

◆ getKernelArgMapFlags()

MapFlags getKernelArgMapFlags ( Value operand,
bool alreadyMapped,
const ACCRuntimeCallConfig & config )
static

The flags a kernel argument is passed with.

An operand the environment already mapped is passed as the device address its entry call returned. An operand that no clause maps is passed by value.

Definition at line 72 of file ACCKernelLaunchPatterns.cpp.

References mlir::Value::getDefiningOp(), mlir::acc::getImplicitFlag(), getKernelDataClauseMapFlags(), mlir::acc::isDataEntryOp(), and mlir::acc::ACCRuntimeCallConfig::postProcessMapFlags().

Referenced by emitKernelRuntimeArgs().

◆ getKernelDataClauseMapFlags()

MapFlags getKernelDataClauseMapFlags ( Operation * entryOp)
static

The flags of a data clause operation that maps a kernel argument.

A kernel argument only looks up the mapping its clause established, so the clauses that establish or tear down something else contribute no flag for it.

Definition at line 57 of file ACCKernelLaunchPatterns.cpp.

References mlir::acc::computeDataClauseMapFlags(), mlir::acc::getDataClause(), and mlir::acc::hasAttachPoint().

Referenced by getKernelArgMapFlags().

◆ getKernelPointer()

FailureOr< Value > getKernelPointer ( gpu::LaunchFuncOp launch,
ConversionPatternRewriter & rewriter,
Region & globalSymbolRegion,
SymbolTable & symbolTable )
static

◆ isDataEntryInsideEnvironment()

bool isDataEntryInsideEnvironment ( KernelEnvironmentOp environment,
Value operand )
static

◆ isDevicePtrMapping()

bool isDevicePtrMapping ( Value operand)
static