#include <detail/kernel_program_cache.hpp>
Classes | |
struct | BuildError |
Denotes build error data. More... | |
struct | BuildResult |
Denotes pointer to some entity with its general state and build error. More... | |
struct | ProgramCache |
Public Types | |
enum | BuildState { BS_InProgress, BS_Done, BS_Failed } |
Denotes the state of a build. More... | |
using | ProgramWithBuildStateT = BuildResult< RT::PiProgram > |
using | ProgramCacheKeyT = std::pair< std::pair< SerializedObj, std::uintptr_t >, std::pair< RT::PiDevice, std::string > > |
using | CommonProgramKeyT = std::pair< std::uintptr_t, RT::PiDevice > |
using | ContextPtr = context_impl * |
using | KernelArgMaskPairT = std::pair< RT::PiKernel, const KernelArgMask * > |
using | KernelByNameT = std::map< std::string, BuildResult< KernelArgMaskPairT > > |
using | KernelCacheT = std::map< RT::PiProgram, KernelByNameT > |
using | KernelFastCacheKeyT = std::tuple< SerializedObj, OSModuleHandle, RT::PiDevice, std::string, std::string > |
using | KernelFastCacheValT = std::tuple< RT::PiKernel, std::mutex *, const KernelArgMask *, RT::PiProgram > |
using | KernelFastCacheT = std::map< KernelFastCacheKeyT, KernelFastCacheValT > |
Public Member Functions | |
~KernelProgramCache () | |
void | setContextPtr (const ContextPtr &AContext) |
Locked< ProgramCache > | acquireCachedPrograms () |
Locked< KernelCacheT > | acquireKernelsPerProgramCache () |
std::pair< ProgramWithBuildStateT *, bool > | getOrInsertProgram (const ProgramCacheKeyT &CacheKey) |
std::pair< BuildResult< KernelArgMaskPairT > *, bool > | getOrInsertKernel (RT::PiProgram Program, const std::string &KernelName) |
template<typename T , class Predicate > | |
void | waitUntilBuilt (BuildResult< T > &BR, Predicate Pred) const |
template<typename ExceptionT , typename RetT > | |
RetT * | waitUntilBuilt (BuildResult< RetT > *BuildResult) |
template<typename T > | |
void | notifyAllBuild (BuildResult< T > &BR) const |
template<typename KeyT > | |
KernelFastCacheValT | tryToGetKernelFast (KeyT &&CacheKey) |
template<typename KeyT , typename ValT > | |
void | saveKernel (KeyT &&CacheKey, ValT &&CacheVal) |
void | reset () |
Clears cache state. More... | |
Friends | |
class | ::MockKernelProgramCache |
Definition at line 32 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::CommonProgramKeyT = std::pair<std::uintptr_t, RT::PiDevice> |
Definition at line 76 of file kernel_program_cache.hpp.
Definition at line 85 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelArgMaskPairT = std::pair<RT::PiKernel, const KernelArgMask *> |
Definition at line 87 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelByNameT = std::map<std::string, BuildResult<KernelArgMaskPairT> > |
Definition at line 88 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelCacheT = std::map<RT::PiProgram, KernelByNameT> |
Definition at line 89 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelFastCacheKeyT = std::tuple<SerializedObj, OSModuleHandle, RT::PiDevice, std::string, std::string> |
Definition at line 93 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelFastCacheT = std::map<KernelFastCacheKeyT, KernelFastCacheValT> |
Definition at line 96 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::KernelFastCacheValT = std::tuple<RT::PiKernel, std::mutex *, const KernelArgMask *, RT::PiProgram> |
Definition at line 95 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::ProgramCacheKeyT = std::pair<std::pair<SerializedObj, std::uintptr_t>, std::pair<RT::PiDevice, std::string> > |
Definition at line 75 of file kernel_program_cache.hpp.
using sycl::_V1::detail::KernelProgramCache::ProgramWithBuildStateT = BuildResult<RT::PiProgram> |
Definition at line 73 of file kernel_program_cache.hpp.
Denotes the state of a build.
Enumerator | |
---|---|
BS_InProgress | |
BS_Done | |
BS_Failed |
Definition at line 44 of file kernel_program_cache.hpp.
sycl::_V1::detail::KernelProgramCache::~KernelProgramCache | ( | ) |
Definition at line 16 of file kernel_program_cache.cpp.
References piKernelRelease(), piProgramRelease(), and sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Ptr.
|
inline |
Definition at line 102 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::context_impl::getProgramForDevImgs().
|
inline |
Definition at line 106 of file kernel_program_cache.hpp.
|
inline |
Definition at line 129 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::ProgramManager::getOrCreateKernel().
|
inline |
Definition at line 111 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::ProgramManager::build(), and sycl::_V1::detail::ProgramManager::getBuiltPIProgram().
|
inline |
Definition at line 162 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::getOrBuild().
|
inline |
Clears cache state.
This member function should only be used in unit tests.
Definition at line 187 of file kernel_program_cache.hpp.
|
inline |
Definition at line 177 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::ProgramManager::getOrCreateKernel().
|
inline |
Definition at line 100 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::context_impl::context_impl().
|
inline |
Definition at line 167 of file kernel_program_cache.hpp.
References sycl::_V1::detail::make_tuple().
Referenced by sycl::_V1::detail::ProgramManager::getOrCreateKernel().
|
inline |
Definition at line 146 of file kernel_program_cache.hpp.
References sycl::_V1::detail::KernelProgramCache::BuildError::Code, sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Error, sycl::_V1::detail::KernelProgramCache::BuildError::isFilledIn(), sycl::_V1::detail::KernelProgramCache::BuildError::Msg, sycl::_V1::detail::KernelProgramCache::BuildResult< T >::Ptr, and sycl::_V1::detail::KernelProgramCache::BuildResult< T >::State.
|
inline |
Definition at line 139 of file kernel_program_cache.hpp.
Referenced by sycl::_V1::detail::getOrBuild(), and sycl::_V1::detail::context_impl::getProgramForDevImgs().
|
friend |
Definition at line 203 of file kernel_program_cache.hpp.