Denotes pointer to some entity with its general state and build error. More...
#include <detail/kernel_program_cache.hpp>
Public Member Functions | |
BuildResult (T *P, BuildState S) | |
Public Attributes | |
std::atomic< T * > | Ptr |
T | Val |
std::atomic< BuildState > | 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... | |
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.
|
inline |
Definition at line 70 of file kernel_program_cache.hpp.
BuildError sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Error |
Definition at line 54 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::KernelProgramCache::waitUntilBuilt().
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.
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.
std::atomic<T *> sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Ptr |
Definition at line 51 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::KernelProgramCache::waitUntilBuilt(), and sycl::_V1::detail::KernelProgramCache::~KernelProgramCache().
std::atomic<BuildState> sycl::_V1::detail::KernelProgramCache::BuildResult< T >::State |
Definition at line 53 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::KernelProgramCache::waitUntilBuilt().
T sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Val |
Definition at line 52 of file kernel_program_cache.hpp.