|
MLIR 24.0.0git
|
Configuration for OpenACC to LLVM runtime lowering. More...
#include "mlir/Dialect/OpenACC/OpenACCRuntimeUtils.h"
Public Types | |
| using | FunctionDisplayNameFn = std::function<std::string(StringRef)> |
| using | MapFlagsPostProcessFn |
| Adjust the flags of a mapping before they are encoded. | |
| using | DeclareBinaryDescriptorFn = std::function<Value(Location, OpBuilder &)> |
| Materialize the target-specific binary descriptor passed to __tgt_acc_declare. | |
| using | KernelBinaryDescriptorFn = std::function<Value(Location, OpBuilder &)> |
| Materialize the target-specific binary descriptor passed to __tgt_acc_kernel. | |
Public Member Functions | |
| ACCRuntimeCallConfig () | |
| void | setName (RuntimeFunction fn, StringRef name) |
| StringRef | getName (RuntimeFunction fn) const |
| void | setFunctionDisplayNameFn (FunctionDisplayNameFn fn) |
| std::string | getFunctionDisplayName (StringRef mangledOrSymbol) const |
| void | setDeviceTypeRuntimeValue (DeviceType type, int64_t runtimeValue) |
Map an OpenACC dialect DeviceType to the integer encoding expected by the target runtime. | |
| int64_t | getDeviceTypeRuntimeValue (DeviceType type) const |
| void | setMapFlagRuntimeValue (MapFlags flag, int64_t runtimeValue) |
Map a single OpenACC dialect MapFlags bit to the bit the target runtime gives the same meaning. | |
| int64_t | getMapFlagsRuntimeValue (MapFlags flags) const |
| void | setMapFlagsPostProcessFn (MapFlagsPostProcessFn fn) |
| MapFlags | postProcessMapFlags (Operation *mapOp, MapFlags flags) const |
| std::string | formatMapFlags (MapFlags flags) const |
Renders flags for a diagnostic as the names of the set bits and the decimal and hexadecimal encoding the runtime reads. | |
| void | setAsyncSyncRuntimeValue (int64_t runtimeValue) |
| Runtime encoding of acc_async_sync, used when an operation carries no async clause. | |
| int64_t | getAsyncSyncRuntimeValue () const |
| void | setAsyncNoValueRuntimeValue (int64_t runtimeValue) |
| Runtime encoding of acc_async_noval, used for an async clause without an argument. | |
| int64_t | getAsyncNoValueRuntimeValue () const |
| void | setDeclareBinaryDescriptorFn (DeclareBinaryDescriptorFn fn) |
| Value | createDeclareBinaryDescriptor (Location loc, OpBuilder &builder) const |
| void | setKernelBinaryDescriptorFn (KernelBinaryDescriptorFn fn) |
| Value | createKernelBinaryDescriptor (Location loc, OpBuilder &builder) const |
Configuration for OpenACC to LLVM runtime lowering.
Device types and map flags use the OpenACC dialect encodings by default.
Definition at line 105 of file OpenACCRuntimeUtils.h.
| using mlir::acc::ACCRuntimeCallConfig::DeclareBinaryDescriptorFn = std::function<Value(Location, OpBuilder &)> |
Materialize the target-specific binary descriptor passed to __tgt_acc_declare.
The default is a null pointer.
Definition at line 160 of file OpenACCRuntimeUtils.h.
| using mlir::acc::ACCRuntimeCallConfig::FunctionDisplayNameFn = std::function<std::string(StringRef)> |
Definition at line 107 of file OpenACCRuntimeUtils.h.
| using mlir::acc::ACCRuntimeCallConfig::KernelBinaryDescriptorFn = std::function<Value(Location, OpBuilder &)> |
Materialize the target-specific binary descriptor passed to __tgt_acc_kernel.
The default is a null pointer.
Definition at line 166 of file OpenACCRuntimeUtils.h.
Adjust the flags of a mapping before they are encoded.
The hook is keyed on the operation that states the mapping and is applied to every mapped object before anything is derived from the flags. The flags are used as computed when no hook is installed.
Definition at line 138 of file OpenACCRuntimeUtils.h.
| ACCRuntimeCallConfig::ACCRuntimeCallConfig | ( | ) |
Definition at line 20 of file OpenACCRuntimeUtils.cpp.
References mlir::acc::populateDialectIdentityDeviceTypeMapping(), and mlir::acc::populateDialectIdentityMapFlagsMapping().
| Value ACCRuntimeCallConfig::createDeclareBinaryDescriptor | ( | Location | loc, |
| OpBuilder & | builder ) const |
Definition at line 206 of file OpenACCRuntimeUtils.cpp.
References mlir::Builder::getContext().
| Value ACCRuntimeCallConfig::createKernelBinaryDescriptor | ( | Location | loc, |
| OpBuilder & | builder ) const |
Definition at line 219 of file OpenACCRuntimeUtils.cpp.
References mlir::Builder::getContext().
Referenced by emitKernelCall().
| std::string ACCRuntimeCallConfig::formatMapFlags | ( | MapFlags | flags | ) | const |
Renders flags for a diagnostic as the names of the set bits and the decimal and hexadecimal encoding the runtime reads.
Definition at line 174 of file OpenACCRuntimeUtils.cpp.
References getMapFlagsRuntimeValue().
Referenced by mlir::emitACCDataRuntimeArgs().
| int64_t ACCRuntimeCallConfig::getAsyncNoValueRuntimeValue | ( | ) | const |
Definition at line 197 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::getAsyncQueue().
| int64_t ACCRuntimeCallConfig::getAsyncSyncRuntimeValue | ( | ) | const |
Definition at line 189 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::getAsyncQueue(), and getDeclareAsyncQueue().
| int64_t ACCRuntimeCallConfig::getDeviceTypeRuntimeValue | ( | DeviceType | type | ) | const |
Definition at line 133 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs(), emitKernelCall(), and mlir::acc::emitWaitCall().
| std::string ACCRuntimeCallConfig::getFunctionDisplayName | ( | StringRef | mangledOrSymbol | ) | const |
Definition at line 122 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::createIdent().
| int64_t ACCRuntimeCallConfig::getMapFlagsRuntimeValue | ( | MapFlags | flags | ) | const |
Definition at line 147 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs(), mlir::acc::emitGetDevicePtrCall(), emitKernelRuntimeArgs(), and formatMapFlags().
| StringRef ACCRuntimeCallConfig::getName | ( | RuntimeFunction | fn | ) | const |
Definition at line 111 of file OpenACCRuntimeUtils.cpp.
References mlir::acc::getRuntimeFunctionName().
Referenced by mlir::acc::createRuntimeCall().
| MapFlags ACCRuntimeCallConfig::postProcessMapFlags | ( | Operation * | mapOp, |
| MapFlags | flags ) const |
Definition at line 167 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs(), and getKernelArgMapFlags().
Runtime encoding of acc_async_noval, used for an async clause without an argument.
As with acc_async_sync, the value is implementation-defined
Definition at line 193 of file OpenACCRuntimeUtils.cpp.
Runtime encoding of acc_async_sync, used when an operation carries no async clause.
OpenACC defines the name of this queue but leaves its value to the implementation, so it is part of the runtime ABI.
Definition at line 185 of file OpenACCRuntimeUtils.cpp.
| void ACCRuntimeCallConfig::setDeclareBinaryDescriptorFn | ( | DeclareBinaryDescriptorFn | fn | ) |
Definition at line 201 of file OpenACCRuntimeUtils.cpp.
Map an OpenACC dialect DeviceType to the integer encoding expected by the target runtime.
Dialect ordinals and runtime ABI values are not required to match. A target whose ABI differs from the default dialect encoding must install its mapping here. Querying an unmapped type is an error.
Definition at line 128 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::populateDialectIdentityDeviceTypeMapping().
| void ACCRuntimeCallConfig::setFunctionDisplayNameFn | ( | FunctionDisplayNameFn | fn | ) |
Definition at line 117 of file OpenACCRuntimeUtils.cpp.
| void ACCRuntimeCallConfig::setKernelBinaryDescriptorFn | ( | KernelBinaryDescriptorFn | fn | ) |
Definition at line 214 of file OpenACCRuntimeUtils.cpp.
Map a single OpenACC dialect MapFlags bit to the bit the target runtime gives the same meaning.
getMapFlagsRuntimeValue combines the bits of a set of flags into the encoding the runtime reads from an argument-type slot. As with device types, dialect and runtime encodings are not required to match. A target whose ABI differs from the default dialect encoding must install its mapping here, and a set bit with no mapping is an error.
Definition at line 142 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::populateDialectIdentityMapFlagsMapping().
| void ACCRuntimeCallConfig::setMapFlagsPostProcessFn | ( | MapFlagsPostProcessFn | fn | ) |
Definition at line 163 of file OpenACCRuntimeUtils.cpp.
| void ACCRuntimeCallConfig::setName | ( | RuntimeFunction | fn, |
| StringRef | name ) |
Definition at line 107 of file OpenACCRuntimeUtils.cpp.