|
MLIR 24.0.0git
|
#include "mlir/Conversion/OpenACCToLLVM/ACCDataRuntime.h"#include "mlir/Conversion/OpenACCToLLVM/ACCToLLVM.h"#include "mlir/Conversion/OpenACCToLLVM/ACCToLLVMUtils.h"#include "mlir/Conversion/LLVMCommon/Pattern.h"#include "mlir/Dialect/Func/IR/FuncOps.h"#include "mlir/Dialect/GPU/IR/GPUDialect.h"#include "mlir/Dialect/LLVMIR/LLVMDialect.h"#include "mlir/Dialect/OpenACC/Analysis/OpenACCSupport.h"#include "mlir/Dialect/OpenACC/OpenACC.h"#include "mlir/Dialect/OpenACC/OpenACCUtilsCG.h"#include "mlir/Dialect/OpenACC/OpenACCUtilsType.h"#include "mlir/IR/BuiltinOps.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/STLExtras.h"#include "llvm/Support/raw_ostream.h"#include <array>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) |
|
static |
Definition at line 170 of file ACCKernelLaunchPatterns.cpp.
References mlir::ACCDataRuntimeArgs::argBasePtrs, mlir::ACCDataRuntimeArgs::argDescs, mlir::ACCDataRuntimeArgs::argMappers, mlir::ACCDataRuntimeArgs::argNames, mlir::ACCDataRuntimeArgs::argNum, mlir::ACCDataRuntimeArgs::argPtrs, mlir::ACCDataRuntimeArgs::argSizes, mlir::ACCDataRuntimeArgs::argTypes, mlir::acc::castToI64(), mlir::acc::constantI64(), emitKernelRuntimeArgs(), mlir::acc::getKernelArgumentFieldIndex(), and mlir::acc::getKernelArgumentType().
Referenced by emitKernelCall().
|
static |
Definition at line 264 of file ACCKernelLaunchPatterns.cpp.
References mlir::OpBuilder::atBlockEnd(), mlir::Region::front(), mlir::SymbolTable::insert(), mlir::SymbolTable::lookup(), and result.
Referenced by emitHostFallbackNotImplemented().
|
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().
|
static |
Definition at line 324 of file ACCKernelLaunchPatterns.cpp.
References mlir::acc::constantI64(), mlir::acc::createIdent(), createKernelArgumentStruct(), mlir::acc::ACCRuntimeCallConfig::createKernelBinaryDescriptor(), mlir::acc::createRuntimeCall(), emitHostFallbackNotImplemented(), mlir::acc::OpenACCSupport::emitNYI(), mlir::acc::ACCRuntimeCallConfig::getDeviceTypeRuntimeValue(), mlir::acc::getInternalGlobalName(), getKernelPointer(), mlir::acc::getOrCreateGlobalString(), mlir::acc::getParentFunctionName(), mlir::None, and success().
|
static |
Emits the argument arrays of the kernel launched by launch, one entry per kernel operand.
Each operand is one parameter of the kernel.
Definition at line 128 of file ACCKernelLaunchPatterns.cpp.
References mlir::ACCMappedObjectArgs::base, mlir::acc::constantI64(), mlir::createACCMappedObjectArrays(), mlir::createACCMappedObjectBase(), mlir::createACCMappedObjectName(), mlir::createACCMappedObjectPointer(), mlir::createACCMappedObjectSize(), mlir::ACCMappedObjectArgs::descriptor, getKernelArgDescriptor(), getKernelArgMapFlags(), mlir::acc::ACCRuntimeCallConfig::getMapFlagsRuntimeValue(), mlir::acc::isDataEntryOp(), mlir::ACCMappedObjectArgs::name, mlir::ACCMappedObjectArgs::pointer, mlir::ACCMappedObjectArgs::size, and mlir::ACCMappedObjectArgs::type.
Referenced by createKernelArgumentStruct().
|
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().
|
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().
|
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().
|
static |
Definition at line 232 of file ACCKernelLaunchPatterns.cpp.
References mlir::Region::front(), mlir::SymbolTable::insert(), mlir::SymbolTable::lookup(), and mlir::SymbolTable::lookupNearestSymbolFrom().
Referenced by emitKernelCall().
Definition at line 48 of file ACCKernelLaunchPatterns.cpp.
References mlir::Value::getDefiningOp(), and mlir::acc::isDataEntryOp().
Definition at line 37 of file ACCKernelLaunchPatterns.cpp.
References mlir::acc::getDataClause(), mlir::Value::getDefiningOp(), and mlir::acc::getMapFlags().