Changeset 5259


Ignore:
Timestamp:
Jan 13, 2017, 7:55:24 AM (10 months ago)
Author:
cameron
Message:

Fix mmap kernel producer position calculation

File:
1 edited

Legend:

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

    r5257 r5259  
    3030    Value * lessThanFullSegment = iBuilder->CreateICmpULT(itemsAvail, segmentItems);
    3131    Value * itemsToDo = iBuilder->CreateSelect(lessThanFullSegment, itemsAvail, segmentItems);
    32     setProducedItemCount(self, "sourceBuffer", iBuilder->CreateAdd(produced, itemsToDo));
     32    produced = iBuilder->CreateAdd(produced, itemsToDo);
     33    setProducedItemCount(self, "sourceBuffer", produced);
    3334   
    3435    iBuilder->CreateCondBr(lessThanFullSegment, setTermination, mmapSourceExit);
     
    3738    iBuilder->CreateBr(mmapSourceExit);
    3839    iBuilder->SetInsertPoint(mmapSourceExit);
     40    Value * ssStructPtr = getStreamSetStructPtr(self, "sourceBuffer");
     41    Value * producerPosPtr = mStreamSetOutputBuffers[0]->getProducerPosPtr(ssStructPtr);
     42    iBuilder->CreateAtomicStoreRelease(produced, producerPosPtr);
     43   
    3944    iBuilder->CreateRetVoid();
    4045    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.