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

BuildState waitUntilTransition (BuildState From=BuildState::BS_InProgress)
 
void updateAndNotify (BuildState DesiredState)
 

Public Attributes

Val
 
std::atomic< BuildStateState {BuildState::BS_Initial}
 
BuildError Error {"", 0}
 
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 52 of file kernel_program_cache.hpp.

Member Function Documentation

◆ updateAndNotify()

◆ waitUntilTransition()

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 67 of file kernel_program_cache.hpp.

Referenced by sycl::_V1::detail::KernelProgramCache::BuildResult< T >::updateAndNotify(), and sycl::_V1::detail::KernelProgramCache::BuildResult< T >::waitUntilTransition().

◆ MBuildResultMutex

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

◆ State

◆ Val


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