clang 19.0.0git
Public Types | Public Member Functions | List of all members
clang::AtomicScopeHIPModel Class Reference

Defines the synch scope model for HIP. More...

#include "clang/Basic/SyncScope.h"

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

Public Types

enum  ID {
  SingleThread = 1 , Wavefront = 2 , Workgroup = 3 , Agent = 4 ,
  System = 5 , Last = System
}
 The enum values match the pre-defined macros __HIP_MEMORY_SCOPE_*, which are used to define memory_scope_* enums in hip-c.h. More...
 

Public Member Functions

 AtomicScopeHIPModel ()
 
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 synch scope model for HIP.

Definition at line 172 of file SyncScope.h.

Member Enumeration Documentation

◆ ID

The enum values match the pre-defined macros __HIP_MEMORY_SCOPE_*, which are used to define memory_scope_* enums in hip-c.h.

Enumerator
SingleThread 
Wavefront 
Workgroup 
Agent 
System 
Last 

Definition at line 177 of file SyncScope.h.

Constructor & Destructor Documentation

◆ AtomicScopeHIPModel()

clang::AtomicScopeHIPModel::AtomicScopeHIPModel ( )
inline

Definition at line 186 of file SyncScope.h.

Member Function Documentation

◆ getFallBackValue()

unsigned clang::AtomicScopeHIPModel::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 218 of file SyncScope.h.

References System.

◆ getRuntimeValues()

ArrayRef< unsigned > clang::AtomicScopeHIPModel::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 209 of file SyncScope.h.

References Agent, Last, SingleThread, System, Wavefront, and Workgroup.

◆ isValid()

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

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

Implements clang::AtomicScopeModel.

Definition at line 204 of file SyncScope.h.

References Last, and SingleThread.

◆ map()

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

Maps language specific synch scope values to internal SyncScope enum.

Implements clang::AtomicScopeModel.

Definition at line 188 of file SyncScope.h.

References Agent, clang::HIPAgent, clang::HIPSingleThread, clang::HIPSystem, clang::HIPWavefront, clang::HIPWorkgroup, SingleThread, System, Wavefront, and Workgroup.


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