|
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. | |
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 |
Configuration for OpenACC to LLVM runtime lowering.
Device types and map flags use the OpenACC dialect encodings by default.
Definition at line 83 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 138 of file OpenACCRuntimeUtils.h.
| using mlir::acc::ACCRuntimeCallConfig::FunctionDisplayNameFn = std::function<std::string(StringRef)> |
Definition at line 85 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 116 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 195 of file OpenACCRuntimeUtils.cpp.
References mlir::Builder::getContext().
| 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 163 of file OpenACCRuntimeUtils.cpp.
References getMapFlagsRuntimeValue().
Referenced by mlir::emitACCDataRuntimeArgs().
| int64_t ACCRuntimeCallConfig::getAsyncNoValueRuntimeValue | ( | ) | const |
Definition at line 186 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::getAsyncQueue().
| int64_t ACCRuntimeCallConfig::getAsyncSyncRuntimeValue | ( | ) | const |
Definition at line 178 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::getAsyncQueue(), and getDeclareAsyncQueue().
| int64_t ACCRuntimeCallConfig::getDeviceTypeRuntimeValue | ( | DeviceType | type | ) | const |
Definition at line 122 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs(), and mlir::acc::emitWaitCall().
| std::string ACCRuntimeCallConfig::getFunctionDisplayName | ( | StringRef | mangledOrSymbol | ) | const |
Definition at line 111 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::createIdent().
| int64_t ACCRuntimeCallConfig::getMapFlagsRuntimeValue | ( | MapFlags | flags | ) | const |
Definition at line 136 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs(), mlir::acc::emitGetDevicePtrCall(), and formatMapFlags().
| StringRef ACCRuntimeCallConfig::getName | ( | RuntimeFunction | fn | ) | const |
Definition at line 100 of file OpenACCRuntimeUtils.cpp.
References mlir::acc::getRuntimeFunctionName().
Referenced by mlir::acc::createRuntimeCall().
| MapFlags ACCRuntimeCallConfig::postProcessMapFlags | ( | Operation * | mapOp, |
| MapFlags | flags ) const |
Definition at line 156 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::emitACCDataRuntimeArgs().
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 182 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 174 of file OpenACCRuntimeUtils.cpp.
| void ACCRuntimeCallConfig::setDeclareBinaryDescriptorFn | ( | DeclareBinaryDescriptorFn | fn | ) |
Definition at line 190 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 117 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::populateDialectIdentityDeviceTypeMapping().
| void ACCRuntimeCallConfig::setFunctionDisplayNameFn | ( | FunctionDisplayNameFn | fn | ) |
Definition at line 106 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 131 of file OpenACCRuntimeUtils.cpp.
Referenced by mlir::acc::populateDialectIdentityMapFlagsMapping().
| void ACCRuntimeCallConfig::setMapFlagsPostProcessFn | ( | MapFlagsPostProcessFn | fn | ) |
Definition at line 152 of file OpenACCRuntimeUtils.cpp.
| void ACCRuntimeCallConfig::setName | ( | RuntimeFunction | fn, |
| StringRef | name ) |
Definition at line 96 of file OpenACCRuntimeUtils.cpp.