DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::KernelProgramCache::BuildResult< T > Struct Template Reference

Denotes pointer to some entity with its general state and build error. More...

#include <detail/kernel_program_cache.hpp>

Collaboration diagram for sycl::_V1::detail::KernelProgramCache::BuildResult< T >:

Public Member Functions

 BuildResult (T *P, BuildState S)
 

Public Attributes

std::atomic< T * > Ptr
 
T Val
 
std::atomic< BuildStateState
 
BuildError Error
 
std::condition_variable MBuildCV
 Condition variable to signal that build result is ready. More...
 
std::mutex MBuildResultMutex
 A mutex to be employed along with MBuildCV. More...
 

Detailed Description

template<typename T>
struct sycl::_V1::detail::KernelProgramCache::BuildResult< T >

Denotes pointer to some entity with its general state and build error.

The pointer is not null if and only if the entity is usable. State of the entity is provided by the user of cache instance. Currently there is only a single user - ProgramManager class.

Definition at line 50 of file kernel_program_cache.hpp.

Constructor & Destructor Documentation

◆ BuildResult()

template<typename T >
sycl::_V1::detail::KernelProgramCache::BuildResult< T >::BuildResult ( T P,
BuildState  S 
)
inline

Definition at line 70 of file kernel_program_cache.hpp.

Member Data Documentation

◆ Error

◆ MBuildCV

template<typename T >
std::condition_variable sycl::_V1::detail::KernelProgramCache::BuildResult< T >::MBuildCV

Condition variable to signal that build result is ready.

A per-object (i.e. kernel or program) condition variable is employed instead of global one in order to eliminate the following deadlock. A thread T1 awaiting for build result BR1 to be ready may be awakened by another thread (due to use of global condition variable), which made build result BR2 ready. Meanwhile, a thread which made build result BR1 ready notifies everyone via a global condition variable and T1 will skip this notification as it's not in condition_variable::wait()'s wait cycle now. Now T1 goes to sleep again and will wait until either a spurious wake-up or another thread will wake it up.

Definition at line 66 of file kernel_program_cache.hpp.

◆ MBuildResultMutex

template<typename T >
std::mutex sycl::_V1::detail::KernelProgramCache::BuildResult< T >::MBuildResultMutex

A mutex to be employed along with MBuildCV.

Definition at line 68 of file kernel_program_cache.hpp.

◆ Ptr

◆ State

template<typename T >
std::atomic<BuildState> sycl::_V1::detail::KernelProgramCache::BuildResult< T >::State

◆ Val

Definition at line 52 of file kernel_program_cache.hpp.


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