Ignore:
Timestamp:
Dec 15, 2016, 12:56:58 PM (3 years ago)
Author:
cameron
Message:

Move responsibility for acquire/release of logical segment number into pipeline compilers.

File:
1 edited

Legend:

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

    r5220 r5224  
    180180    Value * self = &*(args++);
    181181    Value * blocksToDo = &*(args);
    182     Value * segmentNo = getLogicalSegmentNo(self);
    183182   
    184183    std::vector<Value *> inbufProducerPtrs;
     
    277276        iBuilder->CreateAtomicStoreRelease(produced, producerPosPtr);
    278277    }
    279 
    280     // Must be the last action, for synchronization.
    281     setLogicalSegmentNo(self, iBuilder->CreateAdd(segmentNo, ConstantInt::get(size_ty, 1)));
    282278    iBuilder->CreateBr(finalExit);
    283    
    284279    iBuilder->SetInsertPoint(finalExit);
    285280
     
    308303}
    309304
    310 Value * KernelBuilder::getLogicalSegmentNo(Value * self) {
     305Value * KernelBuilder::acquireLogicalSegmentNo(Value * self) {
    311306    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(logicalSegmentNoScalar)});
    312307    LoadInst * segNo = iBuilder->CreateAtomicLoadAcquire(ptr);
     
    326321}
    327322
    328 void KernelBuilder::setLogicalSegmentNo(Value * self, Value * newCount) {
     323void KernelBuilder::releaseLogicalSegmentNo(Value * self, Value * newCount) {
    329324    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(logicalSegmentNoScalar)});
    330325    iBuilder->CreateAtomicStoreRelease(newCount, ptr);
Note: See TracChangeset for help on using the changeset viewer.