Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit bd4bd77

Browse files
nicolasvasilacheTheodoros Theodoridis
authored andcommitted
Add delimiters for cache classes and impl
1 parent a9f9a11 commit bd4bd77

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tc/core/cuda/cuda_compilation_cache.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ CachedEntryType* searchKernel(
141141
}
142142
} // namespace
143143

144+
////////////////////////////////////////////////////////////////////////////////
145+
// CudaCache
146+
////////////////////////////////////////////////////////////////////////////////
144147
std::shared_ptr<CudaCache>& CudaCache::getGlobalSharedCache() {
145148
static std::shared_ptr<CudaCache> cudaCache_;
146149
return cudaCache_;
@@ -284,6 +287,10 @@ CudaCacheEntryProto CudaCachedEntry::toProtobuf() const {
284287
return buf;
285288
}
286289

290+
////////////////////////////////////////////////////////////////////////////////
291+
// OptionsCache
292+
////////////////////////////////////////////////////////////////////////////////
293+
287294
OptionsCachedEntry::OptionsCachedEntry(
288295
const std::string& id,
289296
const std::vector<const DLTensor*>& inputs,
@@ -560,6 +567,9 @@ void OptionsCache::keepOnlyBestCandidates(size_t numberToKeep) {
560567
}
561568
}
562569

570+
////////////////////////////////////////////////////////////////////////////////
571+
// ManualCudaCache
572+
////////////////////////////////////////////////////////////////////////////////
563573
std::shared_ptr<ManualCudaCache>& ManualCudaCache::getGlobalSharedCache() {
564574
static std::shared_ptr<ManualCudaCache> manualCudaCache_;
565575
return manualCudaCache_;

tc/core/cuda/cuda_compilation_cache.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ namespace tc {
3636

3737
class OptionsCache;
3838

39+
////////////////////////////////////////////////////////////////////////////////
40+
// CudaCache
41+
////////////////////////////////////////////////////////////////////////////////
3942
struct CudaCachedEntry {
4043
CudaCachedEntry(
4144
const std::string& id,
@@ -127,6 +130,9 @@ class CudaCache : public Cache<CudaCache, CudaCachedEntry> {
127130
void removeEntriesNotInOptionsCache(const OptionsCache& oc);
128131
};
129132

133+
////////////////////////////////////////////////////////////////////////////////
134+
// OptionsCache
135+
////////////////////////////////////////////////////////////////////////////////
130136
/**
131137
* An OptionsCache holds multiple OptionsCachedEntry's.
132138
* Each OptionsCachedEntry is split to two conceptual parts the key and the
@@ -225,6 +231,9 @@ class OptionsCache : public Cache<OptionsCache, OptionsCachedEntry> {
225231
void keepOnlyBestCandidates(size_t numberToKeep);
226232
};
227233

234+
////////////////////////////////////////////////////////////////////////////////
235+
// ManualCudaCache
236+
////////////////////////////////////////////////////////////////////////////////
228237
/**
229238
* A CudaCache holds multiple CudaCachedEntry's.
230239
* Each CudaCachedEntry is split to two conceptual parts the key and the values.
@@ -306,6 +315,9 @@ class ManualCudaCache : public Cache<ManualCudaCache, ManualCudaCachedEntry> {
306315
const std::vector<const DLTensor*>& outputs) const;
307316
};
308317

318+
////////////////////////////////////////////////////////////////////////////////
319+
// Free functions
320+
////////////////////////////////////////////////////////////////////////////////
309321
inline void removeFromCudaCacheEntriesNotInOptionsCache(
310322
CudaCache& cc,
311323
const OptionsCache& oc) {

0 commit comments

Comments
 (0)