LLVM 19.0.0git
Classes | Namespaces | Macros | Enumerations | Functions
OMPContext.h File Reference

This file provides helper functions and classes to deal with OpenMP contexts as used by [begin/end] declare variant and metadirective. More...

#include "llvm/ADT/APInt.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/Frontend/OpenMP/OMPKinds.def"

Go to the source code of this file.

Classes

struct  llvm::omp::VariantMatchInfo
 Variant match information describes the required traits and how they are scored (via the ScoresMap). More...
 
struct  llvm::omp::OMPContext
 The context for a source location is made up of active property traits, e.g., device={kind(host)}, and constructs traits which describe the nesting in OpenMP constructs at the location. More...
 
struct  llvm::DenseMapInfo< omp::TraitProperty >
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::omp
 

Macros

#define OMP_TRAIT_SET(Enum, ...)   Enum,
 
#define OMP_TRAIT_SELECTOR(Enum, ...)   Enum,
 
#define OMP_TRAIT_PROPERTY(Enum, ...)   Enum,
 
#define OMP_LAST_TRAIT_PROPERTY(Enum)   Last = Enum
 

Enumerations

enum class  llvm::omp::TraitSet { llvm::omp::OMP_TRAIT_SET }
 OpenMP Context related IDs and helpers. More...
 
enum class  llvm::omp::TraitSelector { llvm::omp::OMP_TRAIT_SELECTOR }
 IDs for all OpenMP context selector trait (device={kind/isa...}/...). More...
 
enum class  llvm::omp::TraitProperty { llvm::omp::OMP_TRAIT_PROPERTY , llvm::omp::OMP_LAST_TRAIT_PROPERTY }
 IDs for all OpenMP context trait properties (host/gpu/bsc/llvm/...) More...
 

Functions

TraitSet llvm::omp::getOpenMPContextTraitSetKind (StringRef Str)
 Parse Str and return the trait set it matches or TraitSet::invalid.
 
TraitSet llvm::omp::getOpenMPContextTraitSetForSelector (TraitSelector Selector)
 Return the trait set for which Selector is a selector.
 
TraitSet llvm::omp::getOpenMPContextTraitSetForProperty (TraitProperty Property)
 Return the trait set for which Property is a property.
 
StringRef llvm::omp::getOpenMPContextTraitSetName (TraitSet Kind)
 Return a textual representation of the trait set Kind.
 
TraitSelector llvm::omp::getOpenMPContextTraitSelectorKind (StringRef Str)
 Parse Str and return the trait set it matches or TraitSelector::invalid.
 
TraitSelector llvm::omp::getOpenMPContextTraitSelectorForProperty (TraitProperty Property)
 Return the trait selector for which Property is a property.
 
StringRef llvm::omp::getOpenMPContextTraitSelectorName (TraitSelector Kind)
 Return a textual representation of the trait selector Kind.
 
TraitProperty llvm::omp::getOpenMPContextTraitPropertyKind (TraitSet Set, TraitSelector Selector, StringRef Str)
 Parse Str and return the trait property it matches in the set Set and selector Selector or TraitProperty::invalid.
 
TraitProperty llvm::omp::getOpenMPContextTraitPropertyForSelector (TraitSelector Selector)
 Return the trait property for a singleton selector Selector.
 
StringRef llvm::omp::getOpenMPContextTraitPropertyName (TraitProperty Kind, StringRef RawString)
 Return a textual representation of the trait property Kind, which might be the raw string we parsed (RawString) if we do not translate the property into a (distinct) enum.
 
StringRef llvm::omp::getOpenMPContextTraitPropertyFullName (TraitProperty Kind)
 Return a textual representation of the trait property Kind with selector and set name included.
 
std::string llvm::omp::listOpenMPContextTraitSets ()
 Return a string listing all trait sets.
 
std::string llvm::omp::listOpenMPContextTraitSelectors (TraitSet Set)
 Return a string listing all trait selectors for Set.
 
std::string llvm::omp::listOpenMPContextTraitProperties (TraitSet Set, TraitSelector Selector)
 Return a string listing all trait properties for Set and Selector.
 
bool llvm::omp::isValidTraitSelectorForTraitSet (TraitSelector Selector, TraitSet Set, bool &AllowsTraitScore, bool &RequiresProperty)
 }
 
bool llvm::omp::isValidTraitPropertyForTraitSetAndSelector (TraitProperty Property, TraitSelector Selector, TraitSet Set)
 Return true if Property can be nested in Selector and Set.
 
bool llvm::omp::isVariantApplicableInContext (const VariantMatchInfo &VMI, const OMPContext &Ctx, bool DeviceSetOnly=false)
 Return true if VMI is applicable in Ctx, that is, all traits required by VMI are available in the OpenMP context Ctx.
 
int llvm::omp::getBestVariantMatchForContext (const SmallVectorImpl< VariantMatchInfo > &VMIs, const OMPContext &Ctx)
 Return the index (into VMIs) of the variant with the highest score from the ones applicble in Ctx.
 

Detailed Description

This file provides helper functions and classes to deal with OpenMP contexts as used by [begin/end] declare variant and metadirective.

Definition in file OMPContext.h.

Macro Definition Documentation

◆ OMP_LAST_TRAIT_PROPERTY

#define OMP_LAST_TRAIT_PROPERTY (   Enum)    Last = Enum

Definition at line 47 of file OMPContext.h.

◆ OMP_TRAIT_PROPERTY

#define OMP_TRAIT_PROPERTY (   Enum,
  ... 
)    Enum,

Definition at line 46 of file OMPContext.h.

◆ OMP_TRAIT_SELECTOR

#define OMP_TRAIT_SELECTOR (   Enum,
  ... 
)    Enum,

Definition at line 40 of file OMPContext.h.

◆ OMP_TRAIT_SET

#define OMP_TRAIT_SET (   Enum,
  ... 
)    Enum,

Definition at line 34 of file OMPContext.h.