Ignore:
Timestamp:
Jan 7, 2017, 12:26:09 PM (2 years ago)
Author:
cameron
Message:

Separate processedItemCounts and producedItemCounts for each stream set

File:
1 edited

Legend:

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

    r5246 r5247  
    4646    LoadInst * producerPos = iBuilder->CreateAtomicLoadAcquire(mStreamSetInputBuffers[0]->getProducerPosPtr(streamStructPtr));
    4747    //iBuilder->CallPrintInt("producerPos", producerPos);
    48     Value * processed = getProcessedItemCount(self);
     48    Value * processed = getProcessedItemCount(self, "codeUnitBuffer");
    4949    Value * itemsAvail = iBuilder->CreateSub(producerPos, processed);
    5050    Value * itemsMax = iBuilder->CreateMul(blocksToDo, blockItems);
     
    6262
    6363    processed = iBuilder->CreateAdd(processed, itemsToDo);
    64     setProcessedItemCount(self, processed);
     64    setProcessedItemCount(self, "codeUnitBuffer", processed);
    6565    setScalarField(self, blockNoScalar, iBuilder->CreateUDiv(processed, blockItems));
    6666    mStreamSetInputBuffers[0]->setConsumerPos(streamStructPtr, processed);
     
    9292    Value * streamStructPtr = getStreamSetStructPtr(self, "codeUnitBuffer");
    9393    LoadInst * producerPos = iBuilder->CreateAtomicLoadAcquire(mStreamSetInputBuffers[0]->getProducerPosPtr(streamStructPtr));
    94     Value * processed = getProcessedItemCount(self);
     94    Value * processed = getProcessedItemCount(self, "codeUnitBuffer");
    9595    Value * itemsAvail = iBuilder->CreateSub(producerPos, processed);
    9696    Value * blockNo = getScalarField(self, blockNoScalar);
     
    9999    Value * bytePtr = iBuilder->CreateGEP(iBuilder->CreateBitCast(basePtr, i8PtrTy), byteOffset);
    100100    iBuilder->CreateWriteCall(iBuilder->getInt32(1), bytePtr, iBuilder->CreateMul(itemsAvail, itemBytes));
    101     setProcessedItemCount(self, producerPos);
     101    setProcessedItemCount(self, "codeUnitBuffer", producerPos);
    102102    mStreamSetInputBuffers[0]->setConsumerPos(streamStructPtr, producerPos);
    103103    setTerminationSignal(self);
Note: See TracChangeset for help on using the changeset viewer.