DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
cl::sycl::detail::KernelProgramCache Class Reference

#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...
 

Public Types

using PiProgramT = std::remove_pointer< RT::PiProgram >::type
 
using PiProgramPtrT = std::atomic< PiProgramT * >
 
using ProgramWithBuildStateT = BuildResult< PiProgramT >
 
using ProgramCacheKeyT = std::pair< std::pair< SerializedObj, KernelSetId >, std::pair< RT::PiDevice, std::string > >
 
using ProgramCacheT = std::map< ProgramCacheKeyT, ProgramWithBuildStateT >
 
using ContextPtr = context_impl *
 
using PiKernelT = std::remove_pointer< RT::PiKernel >::type
 
using PiKernelPtrT = std::atomic< PiKernelT * >
 
using KernelWithBuildStateT = BuildResult< PiKernelT >
 
using KernelByNameT = std::map< std::string, KernelWithBuildStateT >
 
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 *, RT::PiProgram >
 
using KernelFastCacheT = std::map< KernelFastCacheKeyT, KernelFastCacheValT >
 

Public Member Functions

 ~KernelProgramCache ()
 
void setContextPtr (const ContextPtr &AContext)
 
Locked< ProgramCacheTacquireCachedPrograms ()
 
Locked< KernelCacheTacquireKernelsPerProgramCache ()
 
template<typename T , class Predicate >
void waitUntilBuilt (BuildResult< T > &BR, Predicate Pred) const
 
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)
 

Friends

class ::MockKernelProgramCache
 

Detailed Description

Definition at line 31 of file kernel_program_cache.hpp.

Member Typedef Documentation

◆ ContextPtr

◆ KernelByNameT

◆ KernelCacheT

◆ KernelFastCacheKeyT

Definition at line 87 of file kernel_program_cache.hpp.

◆ KernelFastCacheT

◆ KernelFastCacheValT

◆ KernelWithBuildStateT

◆ PiKernelPtrT

◆ PiKernelT

Definition at line 78 of file kernel_program_cache.hpp.

◆ PiProgramPtrT

◆ PiProgramT

Definition at line 70 of file kernel_program_cache.hpp.

◆ ProgramCacheKeyT

using cl::sycl::detail::KernelProgramCache::ProgramCacheKeyT = std::pair<std::pair<SerializedObj, KernelSetId>, std::pair<RT::PiDevice, std::string> >

Definition at line 74 of file kernel_program_cache.hpp.

◆ ProgramCacheT

◆ ProgramWithBuildStateT

Constructor & Destructor Documentation

◆ ~KernelProgramCache()

cl::sycl::detail::KernelProgramCache::~KernelProgramCache ( )

Member Function Documentation

◆ acquireCachedPrograms()

Locked<ProgramCacheT> cl::sycl::detail::KernelProgramCache::acquireCachedPrograms ( )
inline

◆ acquireKernelsPerProgramCache()

Locked<KernelCacheT> cl::sycl::detail::KernelProgramCache::acquireKernelsPerProgramCache ( )
inline

◆ notifyAllBuild()

template<typename T >
void cl::sycl::detail::KernelProgramCache::notifyAllBuild ( BuildResult< T > &  BR) const
inline

Definition at line 111 of file kernel_program_cache.hpp.

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

◆ saveKernel()

template<typename KeyT , typename ValT >
void cl::sycl::detail::KernelProgramCache::saveKernel ( KeyT &&  CacheKey,
ValT &&  CacheVal 
)
inline

◆ setContextPtr()

void cl::sycl::detail::KernelProgramCache::setContextPtr ( const ContextPtr AContext)
inline

◆ tryToGetKernelFast()

template<typename KeyT >
KernelFastCacheValT cl::sycl::detail::KernelProgramCache::tryToGetKernelFast ( KeyT &&  CacheKey)
inline

◆ waitUntilBuilt()

template<typename T , class Predicate >
void cl::sycl::detail::KernelProgramCache::waitUntilBuilt ( BuildResult< T > &  BR,
Predicate  Pred 
) const
inline

Definition at line 105 of file kernel_program_cache.hpp.

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

Friends And Related Function Documentation

◆ ::MockKernelProgramCache

friend class ::MockKernelProgramCache
friend

Definition at line 143 of file kernel_program_cache.hpp.


The documentation for this class was generated from the following files: