Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tc::ManualCudaCache Class Reference

#include <compilation_cache.h>

Inheritance diagram for tc::ManualCudaCache:
Collaboration diagram for tc::ManualCudaCache:

Classes

struct  CachedEntry
 

Public Member Functions

 ManualCudaCache ()=default
 
 ManualCudaCache (const ManualCudaCacheProto &buf)
 
ManualCudaCacheProto toProtobuf () const
 
void cacheKernel (const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs, const std::string &kernelSpecializedName, const std::vector< int > &kernelParameters, const std::string &cudaSource, const Grid &grid, const Block &block)
 
std::unique_ptr
< CudaCache::RetrievalResult
retrieveKernel (const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs) const
 
template<typename C , typename TensorTy >
auto searchKernelImpl (C &c, const std::string &id, const std::vector< TensorTy > &inputs, const std::vector< TensorTy > &outputs) -> decltype(c.searchKernel(id, inputs, outputs))
 
- Public Member Functions inherited from tc::Cache< ManualCudaCache >
size_t size () const
 
void clear ()
 

Private Types

using Protobuf = ManualCudaCacheProto
 

Private Member Functions

CachedEntrysearchKernel (const std::string &id, const std::vector< detail::TensorInfo > &inputs, const std::vector< detail::TensorInfo > &outputs)
 
CachedEntrysearchKernel (const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs)
 
const CachedEntrysearchKernel (const std::string &id, const std::vector< const DLTensor * > &inputs, const std::vector< const DLTensor * > &outputs) const
 

Static Private Member Functions

static std::shared_ptr
< ManualCudaCache > & 
getGlobalSharedCache ()
 
template<typename C , typename InputTy >
static auto searchKernelImpl (C &c, const std::string &id, const std::vector< InputTy > &inputs, const std::vector< InputTy > &outputs) -> decltype(c.searchKernel(id, inputs, outputs))
 

Private Attributes

std::vector< CachedEntryentries_
 

Friends

class Cache< ManualCudaCache >
 

Additional Inherited Members

- Static Public Member Functions inherited from tc::Cache< ManualCudaCache >
static void enableCache ()
 
static void disableCache ()
 
static void dumpCacheToProtobuf (const std::string &filename)
 
static void loadCacheFromProtobuf (const std::string &filename)
 
static void loadCacheFromProtobuf (const Protobuf &buf)
 
static std::shared_ptr
< ManualCudaCache
getCache ()
 
static bool cacheEnabled ()
 
- Public Attributes inherited from tc::Cache< ManualCudaCache >
int numberAttemptedRetrievals
 
int numberSuccessfulRetrievals
 
int numberCacheAttemps
 
- Protected Attributes inherited from tc::Cache< ManualCudaCache >
std::mutex mtx_
 

Member Typedef Documentation

using tc::ManualCudaCache::Protobuf = ManualCudaCacheProto
private

Constructor & Destructor Documentation

tc::ManualCudaCache::ManualCudaCache ( )
default
tc::ManualCudaCache::ManualCudaCache ( const ManualCudaCacheProto &  buf)

Member Function Documentation

void tc::ManualCudaCache::cacheKernel ( const std::string &  id,
const std::vector< const DLTensor * > &  inputs,
const std::vector< const DLTensor * > &  outputs,
const std::string &  kernelSpecializedName,
const std::vector< int > &  kernelParameters,
const std::string &  cudaSource,
const Grid grid,
const Block block 
)
static std::shared_ptr<ManualCudaCache>& tc::ManualCudaCache::getGlobalSharedCache ( )
staticprivate
std::unique_ptr<CudaCache::RetrievalResult> tc::ManualCudaCache::retrieveKernel ( const std::string &  id,
const std::vector< const DLTensor * > &  inputs,
const std::vector< const DLTensor * > &  outputs 
) const
CachedEntry* tc::ManualCudaCache::searchKernel ( const std::string &  id,
const std::vector< detail::TensorInfo > &  inputs,
const std::vector< detail::TensorInfo > &  outputs 
)
private
CachedEntry* tc::ManualCudaCache::searchKernel ( const std::string &  id,
const std::vector< const DLTensor * > &  inputs,
const std::vector< const DLTensor * > &  outputs 
)
private
const CachedEntry* tc::ManualCudaCache::searchKernel ( const std::string &  id,
const std::vector< const DLTensor * > &  inputs,
const std::vector< const DLTensor * > &  outputs 
) const
private
template<typename C , typename TensorTy >
auto tc::ManualCudaCache::searchKernelImpl ( C &  c,
const std::string &  id,
const std::vector< TensorTy > &  inputs,
const std::vector< TensorTy > &  outputs 
) -> decltype(c.searchKernel(id, inputs, outputs))
template<typename C , typename InputTy >
static auto tc::ManualCudaCache::searchKernelImpl ( C &  c,
const std::string &  id,
const std::vector< InputTy > &  inputs,
const std::vector< InputTy > &  outputs 
) -> decltype(c.searchKernel(id, inputs, outputs))
staticprivate
ManualCudaCacheProto tc::ManualCudaCache::toProtobuf ( ) const

Friends And Related Function Documentation

friend class Cache< ManualCudaCache >
friend

Member Data Documentation

std::vector<CachedEntry> tc::ManualCudaCache::entries_
private

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