DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
cl::sycl::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 cl::sycl::detail::KernelProgramCache::BuildResult< T >:

Public Member Functions

 BuildResult (T *P, int S)
 

Public Attributes

std::atomic< T * > Ptr
 
std::atomic< int > State
 
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 cl::sycl::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 48 of file kernel_program_cache.hpp.

Constructor & Destructor Documentation

◆ BuildResult()

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

Definition at line 67 of file kernel_program_cache.hpp.

References P.

Member Data Documentation

◆ Error

◆ MBuildCV

template<typename T >
std::condition_variable cl::sycl::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 63 of file kernel_program_cache.hpp.

◆ MBuildResultMutex

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

A mutex to be employed along with MBuildCV.

Definition at line 65 of file kernel_program_cache.hpp.

Referenced by cl::sycl::detail::getOrBuild().

◆ Ptr

◆ State

template<typename T >
std::atomic<int> cl::sycl::detail::KernelProgramCache::BuildResult< T >::State

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