LLVM 19.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::OpenMPIRBuilderConfig Class Reference

Captures attributes that affect generating LLVM-IR using the OpenMPIRBuilder and related classes. More...

#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"

Public Member Functions

 OpenMPIRBuilderConfig ()
 
 OpenMPIRBuilderConfig (bool IsTargetDevice, bool IsGPU, bool OpenMPOffloadMandatory, bool HasRequiresReverseOffload, bool HasRequiresUnifiedAddress, bool HasRequiresUnifiedSharedMemory, bool HasRequiresDynamicAllocators)
 
bool isTargetDevice () const
 
bool isGPU () const
 
bool openMPOffloadMandatory () const
 
bool hasRequiresFlags () const
 
bool hasRequiresReverseOffload () const
 
bool hasRequiresUnifiedAddress () const
 
bool hasRequiresUnifiedSharedMemory () const
 
bool hasRequiresDynamicAllocators () const
 
int64_t getRequiresFlags () const
 Returns requires directive clauses as flags compatible with those expected by libomptarget.
 
StringRef firstSeparator () const
 
StringRef separator () const
 
void setIsTargetDevice (bool Value)
 
void setIsGPU (bool Value)
 
void setOpenMPOffloadMandatory (bool Value)
 
void setFirstSeparator (StringRef FS)
 
void setSeparator (StringRef S)
 
void setHasRequiresReverseOffload (bool Value)
 
void setHasRequiresUnifiedAddress (bool Value)
 
void setHasRequiresUnifiedSharedMemory (bool Value)
 
void setHasRequiresDynamicAllocators (bool Value)
 

Public Attributes

std::optional< boolIsTargetDevice
 Flag to define whether to generate code for the role of the OpenMP host (if set to false) or device (if set to true) in an offloading context.
 
std::optional< boolIsGPU
 Flag for specifying if the compilation is done for an accelerator.
 
std::optional< boolOpenMPOffloadMandatory
 
std::optional< StringRefFirstSeparator
 First separator used between the initial two parts of a name.
 
std::optional< StringRefSeparator
 Separator used between all of the rest consecutive parts of s name.
 

Detailed Description

Captures attributes that affect generating LLVM-IR using the OpenMPIRBuilder and related classes.

Note that not all attributes are required for all classes or functions. In some use cases the configuration is not necessary at all, because because the only functions that are called are ones that are not dependent on the configuration.

Definition at line 84 of file OMPIRBuilder.h.

Constructor & Destructor Documentation

◆ OpenMPIRBuilderConfig() [1/2]

OpenMPIRBuilderConfig::OpenMPIRBuilderConfig ( )

Definition at line 418 of file OMPIRBuilder.cpp.

◆ OpenMPIRBuilderConfig() [2/2]

OpenMPIRBuilderConfig::OpenMPIRBuilderConfig ( bool  IsTargetDevice,
bool  IsGPU,
bool  OpenMPOffloadMandatory,
bool  HasRequiresReverseOffload,
bool  HasRequiresUnifiedAddress,
bool  HasRequiresUnifiedSharedMemory,
bool  HasRequiresDynamicAllocators 
)

Definition at line 421 of file OMPIRBuilder.cpp.

Member Function Documentation

◆ firstSeparator()

StringRef llvm::OpenMPIRBuilderConfig::firstSeparator ( ) const
inline

Definition at line 147 of file OMPIRBuilder.h.

References FirstSeparator, and isGPU().

Referenced by llvm::OpenMPIRBuilder::createPlatformSpecificName().

◆ getRequiresFlags()

int64_t OpenMPIRBuilderConfig::getRequiresFlags ( ) const

Returns requires directive clauses as flags compatible with those expected by libomptarget.

Definition at line 454 of file OMPIRBuilder.cpp.

References hasRequiresFlags().

Referenced by llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata().

◆ hasRequiresDynamicAllocators()

bool OpenMPIRBuilderConfig::hasRequiresDynamicAllocators ( ) const

Definition at line 450 of file OMPIRBuilder.cpp.

◆ hasRequiresFlags()

bool llvm::OpenMPIRBuilderConfig::hasRequiresFlags ( ) const
inline

◆ hasRequiresReverseOffload()

bool OpenMPIRBuilderConfig::hasRequiresReverseOffload ( ) const

Definition at line 438 of file OMPIRBuilder.cpp.

◆ hasRequiresUnifiedAddress()

bool OpenMPIRBuilderConfig::hasRequiresUnifiedAddress ( ) const

Definition at line 442 of file OMPIRBuilder.cpp.

◆ hasRequiresUnifiedSharedMemory()

bool OpenMPIRBuilderConfig::hasRequiresUnifiedSharedMemory ( ) const

◆ isGPU()

bool llvm::OpenMPIRBuilderConfig::isGPU ( ) const
inline

Definition at line 124 of file OMPIRBuilder.h.

References assert(), and IsGPU.

Referenced by llvm::OpenMPIRBuilder::createOffloadEntry(), firstSeparator(), and separator().

◆ isTargetDevice()

bool llvm::OpenMPIRBuilderConfig::isTargetDevice ( ) const
inline

◆ openMPOffloadMandatory()

bool llvm::OpenMPIRBuilderConfig::openMPOffloadMandatory ( ) const
inline

Definition at line 129 of file OMPIRBuilder.h.

References assert(), and OpenMPOffloadMandatory.

Referenced by llvm::OpenMPIRBuilder::emitTargetRegionFunction().

◆ separator()

StringRef llvm::OpenMPIRBuilderConfig::separator ( ) const
inline

Definition at line 157 of file OMPIRBuilder.h.

References isGPU(), and Separator.

Referenced by llvm::OpenMPIRBuilder::createPlatformSpecificName().

◆ setFirstSeparator()

void llvm::OpenMPIRBuilderConfig::setFirstSeparator ( StringRef  FS)
inline

Definition at line 168 of file OMPIRBuilder.h.

References FirstSeparator.

◆ setHasRequiresDynamicAllocators()

void OpenMPIRBuilderConfig::setHasRequiresDynamicAllocators ( bool  Value)

Definition at line 480 of file OMPIRBuilder.cpp.

◆ setHasRequiresReverseOffload()

void OpenMPIRBuilderConfig::setHasRequiresReverseOffload ( bool  Value)

Definition at line 459 of file OMPIRBuilder.cpp.

◆ setHasRequiresUnifiedAddress()

void OpenMPIRBuilderConfig::setHasRequiresUnifiedAddress ( bool  Value)

Definition at line 466 of file OMPIRBuilder.cpp.

◆ setHasRequiresUnifiedSharedMemory()

void OpenMPIRBuilderConfig::setHasRequiresUnifiedSharedMemory ( bool  Value)

Definition at line 473 of file OMPIRBuilder.cpp.

◆ setIsGPU()

void llvm::OpenMPIRBuilderConfig::setIsGPU ( bool  Value)
inline

Definition at line 166 of file OMPIRBuilder.h.

References IsGPU.

◆ setIsTargetDevice()

void llvm::OpenMPIRBuilderConfig::setIsTargetDevice ( bool  Value)
inline

Definition at line 165 of file OMPIRBuilder.h.

References IsTargetDevice.

◆ setOpenMPOffloadMandatory()

void llvm::OpenMPIRBuilderConfig::setOpenMPOffloadMandatory ( bool  Value)
inline

Definition at line 167 of file OMPIRBuilder.h.

References OpenMPOffloadMandatory.

◆ setSeparator()

void llvm::OpenMPIRBuilderConfig::setSeparator ( StringRef  S)
inline

Definition at line 169 of file OMPIRBuilder.h.

References Separator.

Member Data Documentation

◆ FirstSeparator

std::optional<StringRef> llvm::OpenMPIRBuilderConfig::FirstSeparator

First separator used between the initial two parts of a name.

Definition at line 106 of file OMPIRBuilder.h.

Referenced by firstSeparator(), and setFirstSeparator().

◆ IsGPU

std::optional<bool> llvm::OpenMPIRBuilderConfig::IsGPU

Flag for specifying if the compilation is done for an accelerator.

It is set according to the architecture of the target triple and currently only true when targeting AMDGPU or NVPTX. Today, these targets can only perform the role of an OpenMP target device, so IsTargetDevice must also be true if IsGPU is true. This restriction might be lifted if an accelerator- like target with the ability to work as the OpenMP host is added, or if the capabilities of the currently supported GPU architectures are expanded.

Definition at line 100 of file OMPIRBuilder.h.

Referenced by isGPU(), and setIsGPU().

◆ IsTargetDevice

std::optional<bool> llvm::OpenMPIRBuilderConfig::IsTargetDevice

Flag to define whether to generate code for the role of the OpenMP host (if set to false) or device (if set to true) in an offloading context.

It is set when the -fopenmp-is-target-device compiler frontend option is specified.

Definition at line 90 of file OMPIRBuilder.h.

Referenced by llvm::OpenMPIRBuilder::createTargetData(), isTargetDevice(), and setIsTargetDevice().

◆ OpenMPOffloadMandatory

std::optional<bool> llvm::OpenMPIRBuilderConfig::OpenMPOffloadMandatory

Definition at line 103 of file OMPIRBuilder.h.

Referenced by openMPOffloadMandatory(), and setOpenMPOffloadMandatory().

◆ Separator

std::optional<StringRef> llvm::OpenMPIRBuilderConfig::Separator

Separator used between all of the rest consecutive parts of s name.

Definition at line 108 of file OMPIRBuilder.h.

Referenced by separator(), and setSeparator().


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