Changeset 5605


Ignore:
Timestamp:
Aug 8, 2017, 2:14:34 PM (4 months ago)
Author:
lindanl
Message:

Allows stdout for u8u16.

File:
1 edited

Legend:

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

    r5597 r5605  
    4444static cl::OptionCategory u8u16Options("u8u16 Options", "Transcoding control options.");
    4545static cl::opt<std::string> inputFile(cl::Positional, cl::desc("<input file>"), cl::Required, cl::cat(u8u16Options));
    46 static cl::opt<std::string> outputFile(cl::Positional, cl::desc("<output file>"),  cl::Required, cl::cat(u8u16Options));
     46static cl::opt<std::string> outputFile(cl::Positional, cl::desc("<output file>"), cl::cat(u8u16Options));
    4747static cl::opt<bool> enableAVXdel("enable-AVX-deletion", cl::desc("Enable AVX2 deletion algorithms."), cl::cat(u8u16Options));
    4848static cl::opt<bool> mMapBuffering("mmap-buffering", cl::desc("Enable mmap buffering."), cl::cat(u8u16Options));
     
    403403   
    404404    Kernel * p2sk = pxDriver.addKernelInstance(make_unique<P2S16KernelWithCompressedOutput>(iBuilder));
    405    
    406     Kernel * outK = pxDriver.addKernelInstance(make_unique<FileSink>(iBuilder, 16));
    407     Value * fName = iBuilder->CreatePointerCast(iBuilder->GetString(outputFile.c_str()), iBuilder->getInt8PtrTy());
    408     outK->setInitialArguments({fName});
    409    
     405 
     406    Kernel * outK = nullptr;
     407    if (outputFile=="") {
     408        outK = pxDriver.addKernelInstance(make_unique<StdOutKernel>(iBuilder, 16));
     409    }
     410    else {
     411        outK = pxDriver.addKernelInstance(make_unique<FileSink>(iBuilder, 16));
     412        Value * fName = iBuilder->CreatePointerCast(iBuilder->GetString(outputFile.c_str()), iBuilder->getInt8PtrTy());
     413        outK->setInitialArguments({fName});
     414    }
    410415    // Different choices for the output buffer depending on chosen option.
    411416    StreamSetBuffer * U16out = nullptr;
Note: See TracChangeset for help on using the changeset viewer.