Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
ObjectCacheChain.h
Go to the documentation of this file.
1//===-- ObjectCacheChain.h -- Object cache chain header --===//
2//
3// Part of the Proteus Project, under the Apache License v2.0 with LLVM
4// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef PROTEUS_OBJECTCACHECHAIN_H
12#define PROTEUS_OBJECTCACHECHAIN_H
13
17
18#include <llvm/ADT/SmallString.h>
19#include <llvm/Support/MemoryBufferRef.h>
20
21#include <cstdint>
22#include <memory>
23#include <string>
24#include <vector>
25
26namespace proteus {
27
28using namespace llvm;
29
31public:
32 explicit ObjectCacheChain(const std::string &Label);
33
34 std::unique_ptr<CompiledLibrary> lookup(const HashT &HashValue);
35 void store(const HashT &HashValue, const CacheEntry &Entry);
36 void printStats();
37 void finalize();
38
39private:
40 void addCache(std::unique_ptr<ObjectCache> Cache);
41 void buildFromConfig(const std::string &ConfigStr);
42 std::unique_ptr<ObjectCache> createCache(const std::string &Name);
43 void promoteToLevel(const HashT &HashValue, const CacheEntry &Entry,
44 size_t Level);
45
46 std::vector<std::unique_ptr<ObjectCache>> Caches;
47 const std::string Label;
48 const std::string DistributedRank;
49};
50
51} // namespace proteus
52
53#endif
Definition Hashing.h:21
Definition ObjectCacheChain.h:30
void printStats()
Definition ObjectCacheChain.cpp:157
void store(const HashT &HashValue, const CacheEntry &Entry)
Definition ObjectCacheChain.cpp:149
void finalize()
Definition ObjectCacheChain.cpp:165
std::unique_ptr< CompiledLibrary > lookup(const HashT &HashValue)
Definition ObjectCacheChain.cpp:112
Definition CompiledLibrary.h:7
Definition MemoryCache.h:26
Definition ObjectCache.h:27