clang 20.0.0git
Public Types | Public Member Functions | List of all members
clang::AtomicScopeGenericModel Class Reference

Defines the generic atomic scope model. More...

#include "clang/Basic/SyncScope.h"

Inheritance diagram for clang::AtomicScopeGenericModel:
Inheritance graph
[legend]

Public Types

enum  ID {
  System = 0 , Device = 1 , Workgroup = 2 , Wavefront = 3 ,
  Single = 4 , Last = Single
}
 The enum values match predefined built-in macros __ATOMIC_SCOPE_*. More...
 

Public Member Functions

 AtomicScopeGenericModel ()=default
 
SyncScope map (unsigned S) const override
 Maps language specific synch scope values to internal SyncScope enum.
 
bool isValid (unsigned S) const override
 Check if the compile-time constant synch scope value is valid.
 
ArrayRef< unsignedgetRuntimeValues () const override
 Get all possible synch scope values that might be encountered at runtime for the current language.
 
unsigned getFallBackValue () const override
 If atomic builtin function is called with invalid synch scope value at runtime, it will fall back to a valid synch scope value returned by this function.
 
- Public Member Functions inherited from clang::AtomicScopeModel
virtual ~AtomicScopeModel ()
 
virtual SyncScope map (unsigned S) const =0
 Maps language specific synch scope values to internal SyncScope enum.
 
virtual bool isValid (unsigned S) const =0
 Check if the compile-time constant synch scope value is valid.
 
virtual ArrayRef< unsignedgetRuntimeValues () const =0
 Get all possible synch scope values that might be encountered at runtime for the current language.
 
virtual unsigned getFallBackValue () const =0
 If atomic builtin function is called with invalid synch scope value at runtime, it will fall back to a valid synch scope value returned by this function.
 

Additional Inherited Members

- Static Public Member Functions inherited from clang::AtomicScopeModel
static std::unique_ptr< AtomicScopeModelcreate (AtomicScopeModelKind K)
 Create an atomic scope model by AtomicScopeModelKind.
 

Detailed Description

Defines the generic atomic scope model.

Definition at line 224 of file SyncScope.h.

Member Enumeration Documentation

◆ ID

The enum values match predefined built-in macros __ATOMIC_SCOPE_*.

Enumerator
System 
Device 
Workgroup 
Wavefront 
Single 
Last 

Definition at line 227 of file SyncScope.h.

Constructor & Destructor Documentation

◆ AtomicScopeGenericModel()

clang::AtomicScopeGenericModel::AtomicScopeGenericModel ( )
default

Member Function Documentation

◆ getFallBackValue()

unsigned clang::AtomicScopeGenericModel::getFallBackValue ( ) const
inlineoverridevirtual

If atomic builtin function is called with invalid synch scope value at runtime, it will fall back to a valid synch scope value returned by this function.

Implements clang::AtomicScopeModel.

Definition at line 267 of file SyncScope.h.

References System.

◆ getRuntimeValues()

ArrayRef< unsigned > clang::AtomicScopeGenericModel::getRuntimeValues ( ) const
inlineoverridevirtual

Get all possible synch scope values that might be encountered at runtime for the current language.

Implements clang::AtomicScopeModel.

Definition at line 258 of file SyncScope.h.

References Device, Last, Single, System, Wavefront, and Workgroup.

◆ isValid()

bool clang::AtomicScopeGenericModel::isValid ( unsigned  S) const
inlineoverridevirtual

Check if the compile-time constant synch scope value is valid.

Implements clang::AtomicScopeModel.

Definition at line 254 of file SyncScope.h.

References Last.

◆ map()

SyncScope clang::AtomicScopeGenericModel::map ( unsigned  S) const
inlineoverridevirtual

Maps language specific synch scope values to internal SyncScope enum.

Implements clang::AtomicScopeModel.

Definition at line 238 of file SyncScope.h.

References Device, clang::DeviceScope, Single, clang::SingleScope, System, clang::SystemScope, Wavefront, clang::WavefrontScope, Workgroup, and clang::WorkgroupScope.


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