Ignore:
Timestamp:
Feb 7, 2017, 12:58:01 PM (2 years ago)
Author:
cameron
Message:

Modify u8u16 to use FileSink? for output

File:
1 edited

Legend:

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

    r5301 r5306  
    4343
    4444static cl::OptionCategory u8u16Options("u8u16 Options", "Transcoding control options.");
    45 static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore, cl::cat(u8u16Options));
     45static cl::opt<std::string> inputFile(cl::Positional, cl::desc("<input file>"), cl::Required, cl::cat(u8u16Options));
     46static cl::opt<std::string> outputFile(cl::Positional, cl::desc("<output file>"),  cl::Required, cl::cat(u8u16Options));
    4647static cl::opt<bool> segmentPipelineParallel("enable-segment-pipeline-parallel", cl::desc("Enable multithreading with segment pipeline parallelism."), cl::cat(u8u16Options));
    4748static cl::opt<bool> mMapBuffering("mmap-buffering", cl::desc("Enable mmap buffering."), cl::cat(u8u16Options));
     
    315316    P2S16KernelWithCompressedOutput p2sk(iBuilder);
    316317
    317     StdOutKernel stdoutK(iBuilder, 16);
    318 
     318    FileSink outK(iBuilder, 16);
    319319    if (mMapBuffering || memAlignBuffering) {
    320320        p2sk.generateKernel({&U16Bits, &DeletionCounts}, {&U16external});
    321         stdoutK.generateKernel({&U16external}, {});
     321        outK.generateKernel({&U16external}, {});
    322322    } else {
    323323        p2sk.generateKernel({&U16Bits, &DeletionCounts}, {&U16out});
    324         stdoutK.generateKernel({&U16out}, {});
    325     }
    326 
    327 
     324        outK.generateKernel({&U16out}, {});
     325    }
    328326    iBuilder->SetInsertPoint(BasicBlock::Create(mod->getContext(), "entry", main,0));
    329327
     
    340338        U16out.allocateBuffer();
    341339    }
     340    Value * fName = iBuilder->CreatePointerCast(iBuilder->CreateGlobalString(outputFile.c_str()), iBuilder->getInt8PtrTy());
     341    outK.setInitialArguments({fName});
    342342
    343343    if (segmentPipelineParallel){
    344         generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &u8u16k, &delK, &p2sk, &stdoutK});
     344        generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &u8u16k, &delK, &p2sk, &outK});
    345345    } else {
    346         generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &u8u16k, &delK, &p2sk, &stdoutK});
     346        generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &u8u16k, &delK, &p2sk, &outK});
    347347    }
    348348
     
    434434    u8u16FunctionType fn_ptr = u8u16CodeGen();
    435435
    436     for (unsigned i = 0; i != inputFiles.size(); ++i) {
    437         u8u16(fn_ptr, inputFiles[i]);
    438     }
     436    u8u16(fn_ptr, inputFile);
    439437
    440438    return 0;
Note: See TracChangeset for help on using the changeset viewer.