Ignore:
Timestamp:
Aug 31, 2017, 11:29:59 PM (21 months ago)
Author:
xuedongx
Message:

add ExpandStream? kernel and small fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/alignedprint.cpp

    r5440 r5625  
    9494}
    9595
     96void ExpandStream::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> &iBuilder) {
     97    if (mSizeOutputStreamSet <= mSizeInputStreamSet)
     98        llvm::report_fatal_error("Stream Expanding fails.\n");
     99
     100    for (unsigned i = 0; i < mSizeOutputStreamSet; i++) {
     101        if (i < mSizeInputStreamSet) {
     102            Value * bitStrmVal = iBuilder->loadInputStreamBlock("bitStreams", iBuilder->getInt32(i));
     103            iBuilder->storeOutputStreamBlock("outputbitStreams", iBuilder->getInt32(i), bitStrmVal);
     104        } else {
     105            iBuilder->storeOutputStreamBlock("outputbitStreams", iBuilder->getInt32(i), iBuilder->bitCast(Constant::getNullValue(iBuilder->getBitBlockType())));
     106        }
     107    }
     108   
     109}
     110
    96111void PrintStreamSet::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> &iBuilder) {
    97112
     
    266281}
    267282
     283ExpandStream::ExpandStream(const std::unique_ptr<kernel::KernelBuilder> & builder, unsigned sizeInputStreamSet, unsigned sizeOutputStreamSet)
     284: BlockOrientedKernel("ExpandStream", {Binding{builder->getStreamSetTy(sizeInputStreamSet), "bitStreams"}}, {Binding{builder->getStreamSetTy(sizeOutputStreamSet), "outputbitStreams"}}, {}, {}, {}), mSizeInputStreamSet(sizeInputStreamSet), mSizeOutputStreamSet(sizeOutputStreamSet) {
     285    setNoTerminateAttribute(true);
     286
     287}
     288
    268289PrintStreamSet::PrintStreamSet(const std::unique_ptr<kernel::KernelBuilder> & builder, std::vector<std::string> && names, const unsigned minWidth)
    269290: BlockOrientedKernel("PrintableStreamSet", {}, {}, {}, {}, {})
Note: See TracChangeset for help on using the changeset viewer.