MLIR 24.0.0git
mlir::acc::ACCRuntimeCallConfig Class Reference

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

Detailed Description

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.

Member Typedef Documentation

◆ DeclareBinaryDescriptorFn

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.

◆ FunctionDisplayNameFn

using mlir::acc::ACCRuntimeCallConfig::FunctionDisplayNameFn = std::function<std::string(StringRef)>

Definition at line 85 of file OpenACCRuntimeUtils.h.

◆ MapFlagsPostProcessFn

Initial value:
std::function<MapFlags(Operation *mapOp, MapFlags flags)>
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87

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.

Constructor & Destructor Documentation

◆ ACCRuntimeCallConfig()

ACCRuntimeCallConfig::ACCRuntimeCallConfig ( )

Member Function Documentation

◆ createDeclareBinaryDescriptor()

Value ACCRuntimeCallConfig::createDeclareBinaryDescriptor ( Location loc,
OpBuilder & builder ) const

Definition at line 195 of file OpenACCRuntimeUtils.cpp.

References mlir::Builder::getContext().

◆ formatMapFlags()

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().

◆ getAsyncNoValueRuntimeValue()

int64_t ACCRuntimeCallConfig::getAsyncNoValueRuntimeValue ( ) const

Definition at line 186 of file OpenACCRuntimeUtils.cpp.

Referenced by mlir::acc::getAsyncQueue().

◆ getAsyncSyncRuntimeValue()

int64_t ACCRuntimeCallConfig::getAsyncSyncRuntimeValue ( ) const

Definition at line 178 of file OpenACCRuntimeUtils.cpp.

Referenced by mlir::acc::getAsyncQueue(), and getDeclareAsyncQueue().

◆ getDeviceTypeRuntimeValue()

int64_t ACCRuntimeCallConfig::getDeviceTypeRuntimeValue ( DeviceType type) const

◆ getFunctionDisplayName()

std::string ACCRuntimeCallConfig::getFunctionDisplayName ( StringRef mangledOrSymbol) const

Definition at line 111 of file OpenACCRuntimeUtils.cpp.

Referenced by mlir::acc::createIdent().

◆ getMapFlagsRuntimeValue()

int64_t ACCRuntimeCallConfig::getMapFlagsRuntimeValue ( MapFlags flags) const

◆ getName()

StringRef ACCRuntimeCallConfig::getName ( RuntimeFunction fn) const

◆ postProcessMapFlags()

MapFlags ACCRuntimeCallConfig::postProcessMapFlags ( Operation * mapOp,
MapFlags flags ) const

Definition at line 156 of file OpenACCRuntimeUtils.cpp.

Referenced by mlir::emitACCDataRuntimeArgs().

◆ setAsyncNoValueRuntimeValue()

void ACCRuntimeCallConfig::setAsyncNoValueRuntimeValue ( int64_t runtimeValue)

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.

◆ setAsyncSyncRuntimeValue()

void ACCRuntimeCallConfig::setAsyncSyncRuntimeValue ( int64_t runtimeValue)

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.

◆ setDeclareBinaryDescriptorFn()

void ACCRuntimeCallConfig::setDeclareBinaryDescriptorFn ( DeclareBinaryDescriptorFn fn)

Definition at line 190 of file OpenACCRuntimeUtils.cpp.

◆ setDeviceTypeRuntimeValue()

void ACCRuntimeCallConfig::setDeviceTypeRuntimeValue ( DeviceType type,
int64_t runtimeValue )

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().

◆ setFunctionDisplayNameFn()

void ACCRuntimeCallConfig::setFunctionDisplayNameFn ( FunctionDisplayNameFn fn)

Definition at line 106 of file OpenACCRuntimeUtils.cpp.

◆ setMapFlagRuntimeValue()

void ACCRuntimeCallConfig::setMapFlagRuntimeValue ( MapFlags flag,
int64_t runtimeValue )

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().

◆ setMapFlagsPostProcessFn()

void ACCRuntimeCallConfig::setMapFlagsPostProcessFn ( MapFlagsPostProcessFn fn)

Definition at line 152 of file OpenACCRuntimeUtils.cpp.

◆ setName()

void ACCRuntimeCallConfig::setName ( RuntimeFunction fn,
StringRef name )

Definition at line 96 of file OpenACCRuntimeUtils.cpp.


The documentation for this class was generated from the following files: