MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / create_test_cache

Function create_test_cache

test/common.h:206–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static cache_t *create_test_cache(const char *alg_name,
207 common_cache_params_t cc_params,
208 reader_t *reader, const char *params) {
209 cache_t *cache;
210 if (strcasecmp(alg_name, "LRU") == 0) {
211 cache = LRU_init(cc_params, NULL);
212 } else if (strcasecmp(alg_name, "Clock") == 0) {
213 cache = Clock_init(cc_params, NULL);
214 } else if (strcasecmp(alg_name, "FIFO") == 0) {
215 cache = FIFO_init(cc_params, NULL);
216 } else if (strcasecmp(alg_name, "FIFO-Reinsertion") == 0 ||
217 strcasecmp(alg_name, "Clock") == 0) {
218 cache = Clock_init(cc_params, NULL);
219 } else if (strcasecmp(alg_name, "ClockPro") == 0) {
220 cache = ClockPro_init(cc_params, NULL);
221 } else if (strcasecmp(alg_name, "Belady") == 0) {
222 cache = Belady_init(cc_params, NULL);
223 } else if (strcasecmp(alg_name, "BeladySize") == 0) {
224 cache = BeladySize_init(cc_params, NULL);
225 } else if (strcasecmp(alg_name, "LRUv0") == 0) {
226 cache = LRUv0_init(cc_params, NULL);
227 } else if (strcasecmp(alg_name, "Random") == 0) {
228 cache = Random_init(cc_params, NULL);
229 } else if (strcasecmp(alg_name, "MRU") == 0) {
230 cache = MRU_init(cc_params, NULL);
231 // } else if (strcmp(alg_name, "LRU_K") == 0) {
232 // cache = LRU_K_init(cc_params, NULL);
233 } else if (strcasecmp(alg_name, "LFU") == 0) {
234 cache = LFU_init(cc_params, NULL);
235 } else if (strcasecmp(alg_name, "LFU") == 0) {
236 cache = LFU_init(cc_params, NULL);
237 } else if (strcasecmp(alg_name, "LFUDA") == 0) {
238 cache = LFUDA_init(cc_params, NULL);
239 } else if (strcasecmp(alg_name, "GDSF") == 0) {
240 cache = GDSF_init(cc_params, NULL);
241 } else if (strcasecmp(alg_name, "ARC") == 0) {
242 cache = ARC_init(cc_params, NULL);
243#if defined(ENABLE_GLCACHE) && ENABLE_GLCACHE == 1
244 } else if (strncasecmp(alg_name, "GLCache", 7) == 0) {
245 const char *init_params = NULL;
246 if (strcasecmp(alg_name, "GLCache-OracleLog") == 0) {
247 init_params = "type=logOracle, rank-intvl=0.05, retrain-intvl=172800";
248 } else if (strcasecmp(alg_name, "GLCache-OracleItem") == 0) {
249 init_params = "type=itemOracle, rank-intvl=0.05, retrain-intvl=172800";
250 } else if (strcasecmp(alg_name, "GLCache-OracleBoth") == 0) {
251 init_params = "type=twoOracle, rank-intvl=0.05, retrain-intvl=172800";
252 } else if (strcasecmp(alg_name, "GLCache-LearnedTrueY") == 0) {
253 init_params =
254 "type=learned, "
255 "train-source-y=oracle, rank-intvl=0.05, retrain-intvl=172800";
256 } else if (strcasecmp(alg_name, "GLCache-LearnedOnline") == 0) {
257 init_params =
258 "type=learned, "
259 "train-source-y=online, rank-intvl=0.05, retrain-intvl=172800";
260 }
261 cache = GLCache_init(cc_params, init_params);
262#endif
263#if defined(ENABLE_3L_CACHE) && ENABLE_3L_CACHE == 1

Callers 15

test_GLCache_ORACLE_LOGFunction · 0.85
test_GLCache_ORACLE_ITEMFunction · 0.85
test_GLCache_ORACLE_BOTHFunction · 0.85
test_MithrilFunction · 0.85
test_OBLFunction · 0.85
test_PGFunction · 0.85
test_LRUFunction · 0.85
test_ClockFunction · 0.85

Calls 15

LRU_initFunction · 0.85
Clock_initFunction · 0.85
FIFO_initFunction · 0.85
ClockPro_initFunction · 0.85
Belady_initFunction · 0.85
BeladySize_initFunction · 0.85
LRUv0_initFunction · 0.85
Random_initFunction · 0.85
MRU_initFunction · 0.85
LFU_initFunction · 0.85
LFUDA_initFunction · 0.85
GDSF_initFunction · 0.85

Tested by 15

test_GLCache_ORACLE_LOGFunction · 0.68
test_GLCache_ORACLE_ITEMFunction · 0.68
test_GLCache_ORACLE_BOTHFunction · 0.68
test_MithrilFunction · 0.68
test_OBLFunction · 0.68
test_PGFunction · 0.68
test_LRUFunction · 0.68
test_ClockFunction · 0.68