Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
ObjectCacheChain.hpp
Go to the documentation of this file.
1//===-- ObjectCacheChain.hpp -- 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_HPP
12#define PROTEUS_OBJECTCACHECHAIN_HPP
13
14#include <cstdint>
15#include <memory>
16#include <string>
17#include <vector>
18
19#include <llvm/ADT/SmallString.h>
20#include <llvm/Support/MemoryBufferRef.h>
21
24#include "proteus/Hashing.hpp"
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
38private:
39 void addCache(std::unique_ptr<ObjectCache> Cache);
40 void buildFromConfig(const std::string &ConfigStr);
41 std::unique_ptr<ObjectCache> createCache(const std::string &Name);
42 void promoteToLevel(const HashT &HashValue, const CacheEntry &Entry,
43 size_t Level);
44
45 std::vector<std::unique_ptr<ObjectCache>> Caches;
46 const std::string Label;
47 const std::string DistributedRank;
48};
49
50} // namespace proteus
51
52#endif
Definition Hashing.hpp:21
Definition ObjectCacheChain.hpp:30
void printStats()
Definition ObjectCacheChain.cpp:136
void store(const HashT &HashValue, const CacheEntry &Entry)
Definition ObjectCacheChain.cpp:128
std::unique_ptr< CompiledLibrary > lookup(const HashT &HashValue)
Definition ObjectCacheChain.cpp:91
Definition Helpers.h:141
Definition ObjectCacheChain.cpp:26
Definition ObjectCache.hpp:27