Ignore:
Timestamp:
Mar 20, 2018, 4:05:54 PM (13 months ago)
Author:
xwa163
Message:
  1. Initial checkin for new approach for lz4 index decoder that always use 4MB buffer
  2. Add test case for new approach (for now test cases will fail when test file is larger than 4MB)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/lz4d_ext_dep.cpp

    r5874 r5921  
    2626#include <iostream>
    2727#include <lz4/LZ4Generator.h>
     28#include <lz4/LZ4GeneratorNew.h>
    2829
    2930namespace re { class CC; }
     
    4243static cl::opt<bool> extractOnly("extract-only", cl::desc("Only extract literal data to output file"), cl::init(false), cl::cat(lz4dDebugFlags));
    4344static cl::opt<bool> extractAndDepositOnly("extract-and-deposit-only", cl::desc("Only extract and deposit literal data to output file"), cl::init(false), cl::cat(lz4dDebugFlags));
     45static cl::opt<bool> newApproach("new-approach", cl::desc("Use new approach"), cl::init(false), cl::cat(lz4dDebugFlags));
    4446
    4547
     
    7981    }
    8082
    81     LZ4Generator g;
     83    std::unique_ptr<LZ4Generator> g = newApproach? llvm::make_unique<LZ4GeneratorNew>(): llvm::make_unique<LZ4Generator>();
    8284
    8385    if (extractOnly) {
    84         g.generateExtractOnlyPipeline(outputFile);
     86        g->generateExtractOnlyPipeline(outputFile);
    8587    } else if (extractAndDepositOnly) {
    86         g.generateExtractAndDepositOnlyPipeline(outputFile);
     88        g->generateExtractAndDepositOnlyPipeline(outputFile);
    8789    } else {
    88         g.generatePipeline(outputFile);
     90        g->generatePipeline(outputFile);
    8991    }
    9092
    91     auto main = g.getMainFunc();
     93    auto main = g->getMainFunc();
    9294
    9395    main(fileBuffer, lz4Frame.getBlocksStart(), lz4Frame.getBlocksStart() + lz4Frame.getBlocksLength(), lz4Frame.hasBlockChecksum());
Note: See TracChangeset for help on using the changeset viewer.