|
MLIR 24.0.0git
|
Classes | |
| struct | DeclareTargetDefaultModel |
| struct | DeviceTypeClauseOps |
| struct | OffloadModuleDefaultModel |
| struct | OffloadModuleOpts |
| Offload-specific OpenMP module attributes, associated to the OffloadModuleInterface. More... | |
| struct | TargetExtOperands |
| Extended TargetOperands with kernel_type attribute. More... | |
Typedefs | |
| using | HostEvaluatedOperands |
| Clauses that correspond to operations other than omp.target, but might have to be evaluated outside of a parent target region. | |
| using | DeclareTargetOperands = detail::Clauses<DeviceTypeClauseOps> |
| using | TargetEnterExitUpdateDataOperands = TargetEnterDataOperands |
| omp.target_enter_data, omp.target_exit_data and omp.target_update take the same clauses, so we give the structure to be shared by all of them a representative name. | |
Functions | |
| std::tuple< NewCliOp, OpOperand *, OpOperand * > | decodeCli (mlir::Value cli) |
| Find the omp.new_cli, generator, and consumer of a canonical loop info. | |
| ClauseProcBindKind | convertProcBindKind (llvm::omp::ProcBindKind kind) |
| Convert a proc_bind kind from the LLVM frontend enum to the corresponding OpenMP dialect enum. | |
| void | setOffloadModuleInterfaceAttributes (ModuleOp module, const OffloadModuleOpts &opts) |
| Sets OpenMP offload module interface attributes on a ModuleOp, shared between Flang and Clang (CIR) frontends. | |
| void | setOpenMPVersionAttribute (ModuleOp module, int64_t version) |
| Adds or updates the omp.version attribute. | |
| int64_t | getOpenMPVersionAttribute (ModuleOp module, int64_t fallback=-1) |
| Returns the value of the omp.version attribute, if present, or the fallback. | |
| bool | isOpenMPModule (ModuleOp module) |
| Checks whether this is an OpenMP-enabled module. | |
| bool | allocaUsesRequireSharedMem (Value alloc) |
| Check whether the value representing an allocation, assumed to have been defined in a shared device context, is used in a manner that would require device shared memory for correctness. | |
| bool | opInSharedDeviceContext (Operation &op) |
| Check whether the given operation is located in a context where an allocation to be used by multiple threads in a parallel region would have to be placed in device shared memory to be accessible. | |
Variables | |
| constexpr int64_t | kNullAllocator = 0 |
| Value of the omp_null_allocator handle. | |
| using mlir::omp::DeclareTargetOperands = detail::Clauses<DeviceTypeClauseOps> |
Definition at line 47 of file OpenMPClauseOperands.h.
Clauses that correspond to operations other than omp.target, but might have to be evaluated outside of a parent target region.
Definition at line 42 of file OpenMPClauseOperands.h.
| using mlir::omp::TargetEnterExitUpdateDataOperands = TargetEnterDataOperands |
omp.target_enter_data, omp.target_exit_data and omp.target_update take the same clauses, so we give the structure to be shared by all of them a representative name.
Definition at line 52 of file OpenMPClauseOperands.h.
Check whether the value representing an allocation, assumed to have been defined in a shared device context, is used in a manner that would require device shared memory for correctness.
When a use takes place inside an omp.parallel region and it's not as a private clause argument, or when it is a reduction argument passed to omp.parallel or a function call argument, then the defining allocation is eligible for replacement with shared memory.
Definition at line 92 of file Utils.cpp.
References allocaUseRequiresSharedMem(), mlir::Operation::getResults(), mlir::Value::getUses(), and result.
Referenced by allocatePrivateVars(), cleanupPrivateVars(), and createDeviceArgumentAccessor().
| ClauseProcBindKind mlir::omp::convertProcBindKind | ( | llvm::omp::ProcBindKind | kind | ) |
Convert a proc_bind kind from the LLVM frontend enum to the corresponding OpenMP dialect enum.
The LLVM 'default' and 'unknown' kinds have no dialect counterpart and are not valid inputs.
Definition at line 4197 of file OpenMPDialect.cpp.
| std::tuple< NewCliOp, OpOperand *, OpOperand * > mlir::omp::decodeCli | ( | mlir::Value | cli | ) |
Find the omp.new_cli, generator, and consumer of a canonical loop info.
Definition at line 4165 of file OpenMPDialect.cpp.
References mlir::Value::getContext(), mlir::Value::getDefiningOp(), mlir::Value::getType(), and mlir::Value::getUses().
Referenced by checkApplyeesNesting().
| bool mlir::omp::isOpenMPModule | ( | ModuleOp | module | ) |
Check whether the given operation is located in a context where an allocation to be used by multiple threads in a parallel region would have to be placed in device shared memory to be accessible.
That means that it is inside of a target device module, it is a non-SPMD target region, is inside of one or it's located in a device function, and it is not not inside of a parallel region.
This represents a necessary but not sufficient set of conditions to use device shared memory in place of regular allocas. For some variables, the associated OpenMP construct or their uses might also need to be taken into account.
Definition at line 107 of file Utils.cpp.
References mlir::Operation::getParentOfType().
Referenced by allocatePrivateVars(), allocReductionVars(), cleanupPrivateVars(), createDeviceArgumentAccessor(), createReductionsAndCleanup(), and shouldReplaceAllocaWithDeviceSharedMem().
| void mlir::omp::setOffloadModuleInterfaceAttributes | ( | ModuleOp | module, |
| const OffloadModuleOpts & | opts ) |
Sets OpenMP offload module interface attributes on a ModuleOp, shared between Flang and Clang (CIR) frontends.
Definition at line 20 of file Utils.cpp.
References mlir::omp::OffloadModuleOpts::assumeNoNestedParallelism, mlir::omp::OffloadModuleOpts::assumeNoThreadState, mlir::omp::OffloadModuleOpts::assumeTeamsOversubscription, mlir::omp::OffloadModuleOpts::assumeThreadsOversubscription, mlir::omp::OffloadModuleOpts::forceUSM, mlir::omp::OffloadModuleOpts::hostIRFile, mlir::omp::OffloadModuleOpts::isGPU, mlir::omp::OffloadModuleOpts::isTargetDevice, mlir::omp::OffloadModuleOpts::noGPULib, mlir::omp::OffloadModuleOpts::openMPDeviceVersion, mlir::omp::OffloadModuleOpts::targetDebugKind, and mlir::omp::OffloadModuleOpts::targetTriples.
|
constexpr |
Value of the omp_null_allocator handle.
Using it as an allocator operand selects the default allocator of the binding task.
Definition at line 55 of file OpenMPDialect.h.