Ignore:
Timestamp:
Jun 9, 2017, 12:44:00 PM (23 months ago)
Author:
cameron
Message:

Fix for read_source kernel; stride attribute for multiblock kernels

File:
1 edited

Legend:

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

    r5493 r5497  
    241241    // Otherwise, allocate a buffer with twice the capacity and copy the unconsumed data back into it
    242242    iBuilder->SetInsertPoint(expandAndCopyBack);
     243
    243244    Value * const expandedCapacity = iBuilder->CreateShl(capacity, 1);
    244245    Value * const expandedBuffer = iBuilder->CreatePointerCast(iBuilder->CreateCacheAlignedMalloc(expandedCapacity), codeUnitPtrTy);
     
    255256    baseAddress->addIncoming(expandedBuffer, expandAndCopyBack);
    256257    Value * const modifiedPtr = iBuilder->CreateGEP(baseAddress, remaining);
    257     Value * const logicalAddress = iBuilder->CreateGEP(modifiedPtr, iBuilder->CreateNeg(iBuilder->CreateAnd(produced, alignmentMask)));
     258    Value * const logicalAddress = iBuilder->CreateGEP(baseAddress, iBuilder->CreateNeg(consumed));
    258259    iBuilder->setBaseAddress("sourceBuffer", logicalAddress);
    259260    iBuilder->CreateBr(readData);
Note: See TracChangeset for help on using the changeset viewer.