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/radix64.cpp

    r5246 r5247  
    9595
    9696    LoadInst * producerPos = iBuilder->CreateAtomicLoadAcquire(mStreamSetInputBuffers[0]->getProducerPosPtr(streamStructPtr));
    97     Value * processed = getProcessedItemCount(self);
     97    Value * processed = getProcessedItemCount(self, "sourceStream");
    9898    Value * itemsAvail = iBuilder->CreateSub(producerPos, processed);
    9999   
     
    116116    Value * sourceBlockPtr = getStreamSetBlockPtr(self, "sourceStream", blockNo);
    117117
    118     Value * outputGenerated = getProducedItemCount(self); // bytes previously generated to output
     118    Value * outputGenerated = getProducedItemCount(self, "expandedStream"); // bytes previously generated to output
    119119    Value * outputBlockNo = iBuilder->CreateUDiv(outputGenerated, stride);
    120120
     
    250250
    251251    processed = iBuilder->CreateAdd(processed, itemsToDo);
    252     setProcessedItemCount(self, processed);
     252    setProcessedItemCount(self, "sourceStream", processed);
    253253
    254254    setScalarField(self, blockNoScalar, iBuilder->CreateUDiv(processed, stride));
     
    257257    // input byte.
    258258    Value * totalProduced = iBuilder->CreateAdd(iBuilder->CreateMul(iBuilder->CreateUDiv(processed, Const3), Const4), iBuilder->CreateURem(processed, Const3));
    259     setProducedItemCount(self, totalProduced);
     259    setProducedItemCount(self, "expandedStream", totalProduced);
    260260    Value * ssStructPtr = getStreamSetStructPtr(self, "expandedStream");
    261261
     
    337337        iBuilder->CreateBlockAlignedStore(radix64pack, radix64stream, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
    338338    }
    339     Value * produced = getProducedItemCount(self);
     339    Value * produced = getProducedItemCount(self, "radix64stream");
    340340    produced = iBuilder->CreateAdd(produced, iBuilder->getSize(iBuilder->getStride()));
    341     setProducedItemCount(self, produced);   
     341    setProducedItemCount(self, "radix64stream", produced);   
    342342}
    343343
     
    450450    iBuilder->SetInsertPoint(fbExit);
    451451    Value * outputNumberAdd = iBuilder->CreateSelect(iBuilder->CreateICmpEQ(remainMod4, iBuilder->getSize(0)), iBuilder->getSize(0), iBuilder->getSize(1));
    452     Value * produced = iBuilder->CreateAdd(getProducedItemCount(self), iBuilder->CreateAdd(remainingBytes, outputNumberAdd));
    453     setProducedItemCount(self, produced);
     452    Value * produced = iBuilder->CreateAdd(getProducedItemCount(self, "radix64stream"), iBuilder->CreateAdd(remainingBytes, outputNumberAdd));
     453    setProducedItemCount(self, "radix64stream", produced);
    454454
    455455    iBuilder->CreateRetVoid();
     
    496496        iBuilder->CreateBlockAlignedStore(iBuilder->bitCast(base64pack), base64stream_ptr, {iBuilder->getInt32(0), iBuilder->getInt32(0), iBuilder->getInt32(i)});
    497497    }
    498     Value * produced = getProducedItemCount(self);
     498    Value * produced = getProducedItemCount(self, "base64stream");
    499499    produced = iBuilder->CreateAdd(produced, iBuilder->getSize(iBuilder->getStride()));
    500     setProducedItemCount(self, produced);   
     500    setProducedItemCount(self, "base64stream", produced);
    501501}
    502502
     
    566566    iBuilder->CreateBr(fbExit);
    567567    iBuilder->SetInsertPoint(fbExit);
    568     Value * produced = iBuilder->CreateAdd(getProducedItemCount(self), iBuilder->CreateAdd(remainingBytes, padBytes));
    569     setProducedItemCount(self, produced);
    570 
    571 
     568    Value * produced = iBuilder->CreateAdd(getProducedItemCount(self, "base64stream"), iBuilder->CreateAdd(remainingBytes, padBytes));
     569    setProducedItemCount(self, "base64stream", produced);
    572570    iBuilder->CreateRetVoid();
    573571    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.