Ignore:
Timestamp:
Dec 3, 2017, 12:40:40 PM (20 months ago)
Author:
nmedfort
Message:

Bug fixes and simplified MultiBlockKernel? logic

File:
1 edited

Legend:

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

    r5706 r5755  
    1515namespace kernel {
    1616
    17 void StdOutKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value * const /* numOfStrides */) {
     17Value * StdOutKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value * const numOfStrides) {
    1818    Value * codeUnitBuffer = iBuilder->getInputStreamBlockPtr("codeUnitBuffer", iBuilder->getInt32(0));
    1919    codeUnitBuffer = iBuilder->CreatePointerCast(codeUnitBuffer, iBuilder->getInt8PtrTy());
     
    2525    }
    2626    iBuilder->CreateWriteCall(iBuilder->getInt32(1), codeUnitBuffer, bytesToDo);
     27    return numOfStrides;
    2728}
    2829
     
    6263}
    6364
    64 void FileSink::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & iBuilder, Value * const /* numOfStrides */) {
     65Value * FileSink::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & iBuilder, Value * const numOfStrides) {
    6566    BasicBlock * const closeFile = iBuilder->CreateBasicBlock("closeFile");
    6667    BasicBlock * const fileOutExit = iBuilder->CreateBasicBlock("fileOutExit");
    6768
    6869    Value * const fileDes = iBuilder->getScalarField("fileDes");
    69     Value * const codeUnitBuffer = iBuilder->CreatePointerCast(getStreamSetInputBufferPtr(0), iBuilder->getInt8PtrTy());
     70    Value * codeUnitBuffer = iBuilder->getInputStreamBlockPtr("codeUnitBuffer", iBuilder->getInt32(0));
     71    codeUnitBuffer = iBuilder->CreatePointerCast(codeUnitBuffer, iBuilder->getInt8PtrTy());
    7072    Value * bytesToDo = mAvailableItemCount[0];
    7173    if (LLVM_UNLIKELY(mCodeUnitWidth > 8)) {
     
    8688   
    8789    iBuilder->SetInsertPoint(fileOutExit);
     90    return numOfStrides;
    8891}
    8992
Note: See TracChangeset for help on using the changeset viewer.