Ignore:
Timestamp:
May 13, 2017, 11:37:08 AM (2 years ago)
Author:
cameron
Message:

Hack for source/external buffers with mBufferBlocks=1; u8u16 test with segment-pipeline-parallel; simplified copying

File:
1 edited

Legend:

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

    r5442 r5448  
    9292    Value * bytePtr = iBuilder->CreatePointerCast(iBuilder->getInputStreamBlockPtr("codeUnitBuffer", iBuilder->getInt32(0)), i8PtrTy);
    9393    bytePtr = iBuilder->CreateGEP(bytePtr, byteOffset);
    94     iBuilder->CreateWriteCall(fileDes, bytePtr, iBuilder->CreateMul(itemsToDo, itemBytes));
     94    Value * bytesToDo = mCodeUnitWidth == 8 ? itemsToDo : iBuilder->CreateMul(itemsToDo, itemBytes);
     95    iBuilder->CreateWriteCall(fileDes, bytePtr, bytesToDo);
    9596   
    9697    processed = iBuilder->CreateAdd(processed, itemsToDo);
     
    109110        bytePtr = iBuilder->CreateGEP(bytePtr, byteOffset);
    110111        itemsToDo = iBuilder->CreateSub(available, processed);
    111         iBuilder->CreateWriteCall(fileDes, bytePtr, iBuilder->CreateMul(itemsToDo, itemBytes));
     112        bytesToDo = mCodeUnitWidth == 8 ? itemsToDo : iBuilder->CreateMul(itemsToDo, itemBytes);
     113        iBuilder->CreateWriteCall(fileDes, bytePtr, bytesToDo);
    112114        processed = iBuilder->CreateAdd(processed, itemsToDo);
    113115        iBuilder->setProcessedItemCount("codeUnitBuffer", available);
Note: See TracChangeset for help on using the changeset viewer.