MLIR 23.0.0git
mlir::acc::ACCParMappingPolicy< ParDimAttrT > Class Template Referenceabstract

Policy class that defines how OpenACC parallelism levels map to target-specific parallel dimension attributes. More...

#include "mlir/Dialect/OpenACC/OpenACCParMapping.h"

Inheritance diagram for mlir::acc::ACCParMappingPolicy< ParDimAttrT >:

Public Member Functions

virtual ~ACCParMappingPolicy ()=default
virtual ParDimAttrT map (MLIRContext *ctx, ParLevel level) const =0
 Map an OpenACC parallelism level to target dimension.
ParDimAttrT gangDim (MLIRContext *ctx, ParLevel level) const
 Convenience methods for specific parallelism levels.
ParDimAttrT workerDim (MLIRContext *ctx) const
ParDimAttrT vectorDim (MLIRContext *ctx) const
ParDimAttrT seqDim (MLIRContext *ctx) const
virtual bool isVector (ParDimAttrT attr) const =0
 Check if the attribute represents vector parallelism.
virtual bool isWorker (ParDimAttrT attr) const =0
 Check if the attribute represents worker parallelism.
virtual bool isGang (ParDimAttrT attr) const =0
 Check if the attribute represents gang parallelism (any gang dimension).
virtual bool isSeq (ParDimAttrT attr) const =0
 Check if the attribute represents sequential execution.

Detailed Description

template<typename ParDimAttrT>
class mlir::acc::ACCParMappingPolicy< ParDimAttrT >

Policy class that defines how OpenACC parallelism levels map to target-specific parallel dimension attributes.

Implementations provide the actual mapping.

Template parameter ParDimAttrT specifies the attribute type returned by the mapping functions (e.g., mlir::acc::GPUParallelDimAttr for GPU targets).

This policy allows different mapping strategies:

  • Standard GPU mapping (gang->block, worker->threadY, vector->threadX)
  • Custom mappings for specific targets or optimization strategies

Pass an implementation to functions that need to perform the mapping.

Definition at line 64 of file OpenACCParMapping.h.

Constructor & Destructor Documentation

◆ ~ACCParMappingPolicy()

template<typename ParDimAttrT>
virtual mlir::acc::ACCParMappingPolicy< ParDimAttrT >::~ACCParMappingPolicy ( )
virtualdefault

Member Function Documentation

◆ gangDim()

template<typename ParDimAttrT>
ParDimAttrT mlir::acc::ACCParMappingPolicy< ParDimAttrT >::gangDim ( MLIRContext * ctx,
ParLevel level ) const
inline

Convenience methods for specific parallelism levels.

Definition at line 76 of file OpenACCParMapping.h.

◆ isGang()

template<typename ParDimAttrT>
virtual bool mlir::acc::ACCParMappingPolicy< ParDimAttrT >::isGang ( ParDimAttrT attr) const
pure virtual

Check if the attribute represents gang parallelism (any gang dimension).

Implemented in mlir::acc::DefaultACCToGPUMappingPolicy.

◆ isSeq()

template<typename ParDimAttrT>
virtual bool mlir::acc::ACCParMappingPolicy< ParDimAttrT >::isSeq ( ParDimAttrT attr) const
pure virtual

Check if the attribute represents sequential execution.

Implemented in mlir::acc::DefaultACCToGPUMappingPolicy.

◆ isVector()

template<typename ParDimAttrT>
virtual bool mlir::acc::ACCParMappingPolicy< ParDimAttrT >::isVector ( ParDimAttrT attr) const
pure virtual

Check if the attribute represents vector parallelism.

Implemented in mlir::acc::DefaultACCToGPUMappingPolicy.

◆ isWorker()

template<typename ParDimAttrT>
virtual bool mlir::acc::ACCParMappingPolicy< ParDimAttrT >::isWorker ( ParDimAttrT attr) const
pure virtual

Check if the attribute represents worker parallelism.

Implemented in mlir::acc::DefaultACCToGPUMappingPolicy.

◆ map()

template<typename ParDimAttrT>
virtual ParDimAttrT mlir::acc::ACCParMappingPolicy< ParDimAttrT >::map ( MLIRContext * ctx,
ParLevel level ) const
pure virtual

Map an OpenACC parallelism level to target dimension.

Parameters
ctxThe MLIR context
levelThe OpenACC parallelism level (gang_dim1, gang_dim2, gang_dim3, worker, vector, or seq)
Returns
The corresponding parallel dimension attribute

Implemented in mlir::acc::DefaultACCToGPUMappingPolicy.

Referenced by mlir::acc::ACCParMappingPolicy< mlir::acc::GPUParallelDimAttr >::gangDim(), mlir::acc::ACCParMappingPolicy< mlir::acc::GPUParallelDimAttr >::seqDim(), mlir::acc::ACCParMappingPolicy< mlir::acc::GPUParallelDimAttr >::vectorDim(), and mlir::acc::ACCParMappingPolicy< mlir::acc::GPUParallelDimAttr >::workerDim().

◆ seqDim()

template<typename ParDimAttrT>
ParDimAttrT mlir::acc::ACCParMappingPolicy< ParDimAttrT >::seqDim ( MLIRContext * ctx) const
inline

Definition at line 88 of file OpenACCParMapping.h.

◆ vectorDim()

template<typename ParDimAttrT>
ParDimAttrT mlir::acc::ACCParMappingPolicy< ParDimAttrT >::vectorDim ( MLIRContext * ctx) const
inline

Definition at line 85 of file OpenACCParMapping.h.

◆ workerDim()

template<typename ParDimAttrT>
ParDimAttrT mlir::acc::ACCParMappingPolicy< ParDimAttrT >::workerDim ( MLIRContext * ctx) const
inline

Definition at line 82 of file OpenACCParMapping.h.


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