15#ifndef MLIR_CONVERSION_OPENACCTOLLVM_ACCDATARUNTIME_H
16#define MLIR_CONVERSION_OPENACCTOLLVM_ACCDATARUNTIME_H
20#include "llvm/ADT/SmallVector.h"
27class ConversionPatternRewriter;
126 acc::MapFlags mapFlags,
127 ConversionPatternRewriter &rewriter);
132 acc::MapFlags mapFlags,
133 ConversionPatternRewriter &rewriter);
140 acc::MapFlags mapFlags,
142 ConversionPatternRewriter &rewriter);
148 Region &globalSymbolRegion,
150 ConversionPatternRewriter &rewriter);
156 Type baseDescriptorType, uint32_t version,
158 ConversionPatternRewriter &rewriter);
166 Value convertedMemref,
168 ConversionPatternRewriter &rewriter);
174 ConversionPatternRewriter &rewriter);
186 ConversionPatternRewriter &rewriter,
Region &globalSymbolRegion,
189 SymbolTable *symbolTable =
nullptr);
196 ValueRange convertedOperands, ConversionPatternRewriter &rewriter,
197 acc::OpenACCSupport &accSupport, Region &globalSymbolRegion,
198 SymbolTable &symbolTable,
const acc::ACCRuntimeCallConfig &config,
199 ArrayRef<Value> trailingArguments,
const ACCDataCallOptions &
options = {});
static llvm::ManagedStatic< PassManagerOptions > options
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Operation is the basic unit of execution within MLIR.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
This class allows for representing and managing the symbol table used by operations with the 'SymbolT...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Configuration for OpenACC to LLVM runtime lowering.
RuntimeFunction
IDs for OpenACC compiler-to-runtime entry points (__tgt_acc_*).
Include the generated interface declarations.
Value createACCDataArray(Location loc, Type elementType, ArrayRef< Value > values, RewriterBase &rewriter)
Materialize values as a stack-allocated LLVM array.
Value createACCDataDescriptor(Location loc, Value baseDescriptor, Type baseDescriptorType, uint32_t version, ValueRange bounds, Value elementSize, ConversionPatternRewriter &rewriter)
Wrap baseDescriptor in the OpenACC overlay that carries bounds.
Value createACCMappedObjectName(Location loc, Value operand, acc::OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable *symbolTable, ConversionPatternRewriter &rewriter)
The name of operand for runtime diagnostics, or a null pointer when it has none.
void createACCMappedObjectArrays(Location loc, ArrayRef< ACCMappedObjectArgs > objects, ACCDataRuntimeArgs &runtimeArgs, RewriterBase &rewriter)
Materialize the argument arrays of objects into the argNum through argDescs fields of runtimeArgs.
LogicalResult emitACCDataRuntimeArgs(Location loc, ValueRange mappingOperands, ValueRange convertedOperands, ConversionPatternRewriter &rewriter, Region &globalSymbolRegion, acc::OpenACCSupport &accSupport, const acc::ACCRuntimeCallConfig &config, ACCDataRuntimeArgs &runtimeArgs, const ACCDataCallOptions &options={}, SymbolTable *symbolTable=nullptr)
Emit the OpenACC data runtime arguments for data-clause operands.
FailureOr< SmallVector< Value > > emitACCDataRuntimeCall(Location loc, acc::RuntimeFunction fn, ValueRange mappingOperands, ValueRange convertedOperands, ConversionPatternRewriter &rewriter, acc::OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config, ArrayRef< Value > trailingArguments, const ACCDataCallOptions &options={})
Emit the call to the mapping entry point fn for mappingOperands, followed by trailingArguments.
FailureOr< Value > createACCMappedObjectSize(Location loc, Value operand, Value converted, acc::MapFlags mapFlags, acc::OpenACCSupport &accSupport, ConversionPatternRewriter &rewriter)
The size in bytes of operand, or zero where its descriptor or bounds state the extent instead.
ACCDataCallKind
Identifies how data runtime arguments will be consumed.
Value createACCMappedObjectBase(Location loc, Operation *mapOp, acc::MapFlags mapFlags, ConversionPatternRewriter &rewriter)
The host pointer slot the object mapOp maps is attached to, or a null pointer when it is not attached...
Value createACCArgumentDescriptor(Operation *mapOp, Value convertedOperand, acc::OpenACCSupport &accSupport, ConversionPatternRewriter &rewriter)
Build the runtime argument descriptor for mapOp, or a null pointer when the mapping needs no descript...
Value createACCMappedObjectPointer(Location loc, Value operand, Value converted, acc::MapFlags mapFlags, ConversionPatternRewriter &rewriter)
The address of operand as the runtime expects to receive it, given its type converted value converted...
Value createACCMemRefDescriptorWrapperArg(Location loc, MemRefType memrefType, Value convertedMemref, ValueRange bounds, Value elementSize, ConversionPatternRewriter &rewriter)
Build the runtime argument descriptor wrapping an already converted memref.
ACCDataRegionFlags
Flags of __tgt_acc_data_begin and __tgt_acc_data_end.
@ Implicit
The implicit data region of a compute construct.
@ None
An explicit data construct.
What a data runtime call is asked for besides mapping its operands.
int64_t flags
Region flags, in the encoding of ACCDataRegionFlags.
ValueRange returnAddressOperands
Mapping operands whose device address the entry point returns.
The arguments every mapping entry point of the OpenACC runtime takes, in the order they are passed.
Value argNames
Array of variable names for runtime diagnostics, null where unknown.
Value deviceType
Device type the directive applies to, in the runtime encoding.
Value argSizes
Array of object sizes in bytes; zero where the descriptor or the bounds state the extent instead.
Value argMappers
Array of user-defined mappers. OpenACC has none, so this is always null.
Value ident
Source position and enclosing function name of the directive.
Value argTypes
Array of map-type flags, in the runtime encoding of acc::MapFlags.
SmallVector< Value > getCallArgs() const
Returns the fields above in the order the entry points take them, so that a caller only appends the a...
SmallVector< unsigned > returnAddressSlots
The argBasePtrs slot the entry point writes the device address of each requested operand into,...
Value argBasePtrs
Array of pointer slots to attach a mapped object to, null when the object is not attached to anything...
Value argNum
Number of mapped objects, that is, the length of each array below.
Value argDescs
Array of descriptors stating layout and bounds, null for whole objects of a known size.
Value flags
Region flags, in the encoding of ACCDataRegionFlags.
Value argPtrs
Array of addresses of the mapped objects themselves.
The values that describe one object to the runtime, one for each argument array.