MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / loadDataFromFile

Function loadDataFromFile

src/library/tools/tune/storage_io.c:348–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void
349loadDataFromFile(StorageCacheImpl* cache)
350{
351 bool structIsCorrect = true;
352 char* name = NULL;
353 unsigned int nameLen;
354 unsigned int numExtra;
355 unsigned int curFunc = 0;
356 unsigned int curPatt = 0;
357 unsigned int func;
358 unsigned int patt;
359 HfInfo file;
360
361 if ( hfOpenRead(&file, cache->fpath) == FILE_NOT_FOUND ) {
362 cache->isPopulate = false;
363 return;
364 }
365
366 // Read file Header
367 loadHeader(&file);
368
369 // Read pattern header
370 structIsCorrect &= loadPatternDataFromFile(&file, &name, &nameLen,
371 &numExtra);
372
373 while (structIsCorrect)
374 {
375 unsigned int func = curFunc;
376 unsigned int patt = curPatt;
377 bool ret;
378 BlasPatternInfo* bPatt = getPatternInfo(cache, func, patt);
379
380
381 while (bPatt != NULL && memcmp(name, bPatt->name, nameLen) != 0 ) {
382 nextPattern(cache, &func, &patt);
383 bPatt = getPatternInfo(cache, func, patt);
384 }
385
386 if (bPatt != NULL) {
387 bPatt->sstatus = SS_CORRECT_DATA;
388
389 // Read pattern data
390 ret = readPatternData(&file, bPatt, numExtra);
391
392 // go to next pattern
393 nextPattern(cache, &func, &patt);
394 // if the pattern is read witch error or not completely
395 if (!ret) {
396 bPatt = getPatternInfo(cache, func, patt);
397 hfJump(&file, bPatt->offset);
398 }
399
400 curFunc = func;
401 curPatt = patt;
402 }
403 free(name);
404 name = NULL;
405 structIsCorrect &= loadPatternDataFromFile(&file, &name, &nameLen,

Callers 1

getStorageCacheFunction · 0.85

Calls 10

hfOpenReadFunction · 0.85
loadHeaderFunction · 0.85
loadPatternDataFromFileFunction · 0.85
getPatternInfoFunction · 0.85
nextPatternFunction · 0.85
readPatternDataFunction · 0.85
hfJumpFunction · 0.85
findPatternFunction · 0.85
hfCloseFunction · 0.85
checkOffsetFunction · 0.85

Tested by

no test coverage detected