LLVM OpenMP 22.0.0git
kmp_flag_native< PtrType, FlagType, Sleepable > Class Template Reference

Base class for wait/release volatile flag. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/openmp/runtime/src/kmp_wait_release.h"

Inheritance diagram for kmp_flag_native< PtrType, FlagType, Sleepable >:
[legend]

Public Types

typedef PtrType flag_t
Public Types inherited from kmp_flag< FlagType >
typedef flag_traits< FlagType > traits_type

Public Member Functions

 kmp_flag_native (volatile PtrType *p)
 kmp_flag_native (volatile PtrType *p, kmp_info_t *thr)
 kmp_flag_native (volatile PtrType *p, PtrType c)
 kmp_flag_native (volatile PtrType *p, PtrType c, std::atomic< bool > *sloc)
virtual ~kmp_flag_native ()
voidoperator new (size_t size)
void operator delete (void *p)
volatile PtrType * get ()
voidget_void_p ()
void set (volatile PtrType *new_loc)
PtrType load ()
void store (PtrType val)
virtual bool done_check ()
virtual bool done_check_val (PtrType old_loc)
virtual bool notdone_check ()
void internal_release ()
PtrType set_sleeping ()
void unset_sleeping ()
bool is_sleeping_val (PtrType old_loc)
bool is_sleeping ()
 Test whether there are threads sleeping on the flag.
bool is_any_sleeping ()
kmp_uint8get_stolen ()
Public Member Functions inherited from kmp_flag< FlagType >
 kmp_flag ()
 kmp_flag (int nwaiters)
 kmp_flag (std::atomic< bool > *sloc)
flag_type get_type ()
kmp_info_tget_waiter (kmp_uint32 i)
 param i in index into waiting_threads
kmp_uint32 get_num_waiters ()
void set_waiter (kmp_info_t *thr)
enum barrier_type get_bt ()

Protected Types

typedef flag_traits< FlagType > traits_type

Protected Attributes

volatile PtrType * loc
PtrType checker = (PtrType)0
 When flag==checker, it has been released.
Protected Attributes inherited from kmp_flag< FlagType >
flag_properties t
 "Type" of the flag in loc
kmp_info_twaiting_threads [1] = {nullptr}
kmp_uint32 num_waiting_threads
 Num threads sleeping on this thread.
std::atomic< bool > * sleepLoc

Detailed Description

template<typename PtrType, flag_type FlagType, bool Sleepable>
class kmp_flag_native< PtrType, FlagType, Sleepable >

Base class for wait/release volatile flag.

Definition at line 141 of file kmp_wait_release.h.

Member Typedef Documentation

◆ flag_t

template<typename PtrType, flag_type FlagType, bool Sleepable>
typedef PtrType kmp_flag_native< PtrType, FlagType, Sleepable >::flag_t

Definition at line 148 of file kmp_wait_release.h.

◆ traits_type

template<typename PtrType, flag_type FlagType, bool Sleepable>
typedef flag_traits<FlagType> kmp_flag_native< PtrType, FlagType, Sleepable >::traits_type
protected

Definition at line 145 of file kmp_wait_release.h.

Constructor & Destructor Documentation

◆ kmp_flag_native() [1/4]

template<typename PtrType, flag_type FlagType, bool Sleepable>
kmp_flag_native< PtrType, FlagType, Sleepable >::kmp_flag_native ( volatile PtrType * p)
inline

Definition at line 149 of file kmp_wait_release.h.

References kmp_flag< FlagType >::kmp_flag(), loc, and p.

◆ kmp_flag_native() [2/4]

template<typename PtrType, flag_type FlagType, bool Sleepable>
kmp_flag_native< PtrType, FlagType, Sleepable >::kmp_flag_native ( volatile PtrType * p,
kmp_info_t * thr )
inline

Definition at line 150 of file kmp_wait_release.h.

References kmp_flag< FlagType >::kmp_flag(), loc, and p.

◆ kmp_flag_native() [3/4]

template<typename PtrType, flag_type FlagType, bool Sleepable>
kmp_flag_native< PtrType, FlagType, Sleepable >::kmp_flag_native ( volatile PtrType * p,
PtrType c )
inline

Definition at line 154 of file kmp_wait_release.h.

References checker, kmp_flag< FlagType >::kmp_flag(), loc, and p.

◆ kmp_flag_native() [4/4]

template<typename PtrType, flag_type FlagType, bool Sleepable>
kmp_flag_native< PtrType, FlagType, Sleepable >::kmp_flag_native ( volatile PtrType * p,
PtrType c,
std::atomic< bool > * sloc )
inline

Definition at line 156 of file kmp_wait_release.h.

References checker, kmp_flag< FlagType >::kmp_flag(), loc, and p.

◆ ~kmp_flag_native()

template<typename PtrType, flag_type FlagType, bool Sleepable>
virtual kmp_flag_native< PtrType, FlagType, Sleepable >::~kmp_flag_native ( )
inlinevirtual

Definition at line 158 of file kmp_wait_release.h.

Member Function Documentation

◆ done_check()

template<typename PtrType, flag_type FlagType, bool Sleepable>
virtual bool kmp_flag_native< PtrType, FlagType, Sleepable >::done_check ( )
inlinevirtual
Returns
true if the flag object has been released.

Reimplemented in kmp_flag_oncore.

Definition at line 167 of file kmp_wait_release.h.

References checker, get(), and KMP_BARRIER_SLEEP_STATE.

◆ done_check_val()

template<typename PtrType, flag_type FlagType, bool Sleepable>
virtual bool kmp_flag_native< PtrType, FlagType, Sleepable >::done_check_val ( PtrType old_loc)
inlinevirtual
Parameters
old_locin old value of flag
Returns
true if the flag's old value indicates it was released.

Reimplemented in kmp_flag_oncore.

Definition at line 176 of file kmp_wait_release.h.

References checker.

◆ get()

template<typename PtrType, flag_type FlagType, bool Sleepable>
volatile PtrType * kmp_flag_native< PtrType, FlagType, Sleepable >::get ( )
inline

◆ get_stolen()

template<typename PtrType, flag_type FlagType, bool Sleepable>
kmp_uint8 * kmp_flag_native< PtrType, FlagType, Sleepable >::get_stolen ( )
inline

Definition at line 230 of file kmp_wait_release.h.

◆ get_void_p()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void * kmp_flag_native< PtrType, FlagType, Sleepable >::get_void_p ( )
inline

Definition at line 162 of file kmp_wait_release.h.

References CCAST, loc, and RCAST.

◆ internal_release()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void kmp_flag_native< PtrType, FlagType, Sleepable >::internal_release ( )
inline
Returns
Actual flag value before release was applied. Trigger all waiting threads to run by modifying flag to release state.

Definition at line 187 of file kmp_wait_release.h.

References get(), and void.

◆ is_any_sleeping()

template<typename PtrType, flag_type FlagType, bool Sleepable>
bool kmp_flag_native< PtrType, FlagType, Sleepable >::is_any_sleeping ( )
inline

Definition at line 225 of file kmp_wait_release.h.

References get(), and is_sleeping_val().

◆ is_sleeping()

template<typename PtrType, flag_type FlagType, bool Sleepable>
bool kmp_flag_native< PtrType, FlagType, Sleepable >::is_sleeping ( )
inline

Test whether there are threads sleeping on the flag.

Definition at line 220 of file kmp_wait_release.h.

References get(), and is_sleeping_val().

Referenced by __kmp_resume_if_soft_paused().

◆ is_sleeping_val()

template<typename PtrType, flag_type FlagType, bool Sleepable>
bool kmp_flag_native< PtrType, FlagType, Sleepable >::is_sleeping_val ( PtrType old_loc)
inline
Parameters
old_locin old value of flag Test if there are threads sleeping on the flag's old value in old_loc.

Definition at line 214 of file kmp_wait_release.h.

References KMP_BARRIER_SLEEP_STATE.

Referenced by is_any_sleeping(), and is_sleeping().

◆ load()

template<typename PtrType, flag_type FlagType, bool Sleepable>
PtrType kmp_flag_native< PtrType, FlagType, Sleepable >::load ( )
inline

Definition at line 164 of file kmp_wait_release.h.

References loc.

◆ notdone_check()

template<typename PtrType, flag_type FlagType, bool Sleepable>
virtual bool kmp_flag_native< PtrType, FlagType, Sleepable >::notdone_check ( )
inlinevirtual
Returns
true if the flag object is not yet released. Used in __kmp_wait_template like:
while (flag.notdone_check()) { pause(); }
volatile int flag

Reimplemented in kmp_flag_oncore.

Definition at line 182 of file kmp_wait_release.h.

References get().

◆ operator delete()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void kmp_flag_native< PtrType, FlagType, Sleepable >::operator delete ( void * p)
inline

Definition at line 160 of file kmp_wait_release.h.

References __kmp_free, and p.

◆ operator new()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void * kmp_flag_native< PtrType, FlagType, Sleepable >::operator new ( size_t size)
inline

Definition at line 159 of file kmp_wait_release.h.

References __kmp_allocate, and size.

◆ set()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void kmp_flag_native< PtrType, FlagType, Sleepable >::set ( volatile PtrType * new_loc)
inline

Definition at line 163 of file kmp_wait_release.h.

References loc.

◆ set_sleeping()

template<typename PtrType, flag_type FlagType, bool Sleepable>
PtrType kmp_flag_native< PtrType, FlagType, Sleepable >::set_sleeping ( )
inline
Returns
Actual flag value before sleep bit(s) set. Notes that there is at least one thread sleeping on the flag by setting sleep bit(s).

Definition at line 193 of file kmp_wait_release.h.

References get(), and KMP_BARRIER_SLEEP_STATE.

◆ store()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void kmp_flag_native< PtrType, FlagType, Sleepable >::store ( PtrType val)
inline

Definition at line 165 of file kmp_wait_release.h.

References loc, and val.

◆ unset_sleeping()

template<typename PtrType, flag_type FlagType, bool Sleepable>
void kmp_flag_native< PtrType, FlagType, Sleepable >::unset_sleeping ( )
inline
Returns
Actual flag value before sleep bit(s) cleared. Notes that there are no longer threads sleeping on the flag by clearing sleep bit(s).

Definition at line 204 of file kmp_wait_release.h.

References get(), and KMP_BARRIER_SLEEP_STATE.

Member Data Documentation

◆ checker

template<typename PtrType, flag_type FlagType, bool Sleepable>
PtrType kmp_flag_native< PtrType, FlagType, Sleepable >::checker = (PtrType)0
protected

When flag==checker, it has been released.

Definition at line 144 of file kmp_wait_release.h.

Referenced by done_check(), done_check_val(), kmp_flag_native(), and kmp_flag_native().

◆ loc

template<typename PtrType, flag_type FlagType, bool Sleepable>
volatile PtrType* kmp_flag_native< PtrType, FlagType, Sleepable >::loc
protected

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