Ignore:
Timestamp:
Jan 17, 2017, 11:40:09 PM (3 years ago)
Author:
cameron
Message:

Fixes

File:
1 edited

Legend:

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

    r5265 r5266  
    3636    }
    3737    Value * produced = getProducedItemCount(self, "sourceBuffer");
    38     Value * itemsAvail = iBuilder->CreateSub(fileItems, produced);
    39     Value * lessThanFullSegment = iBuilder->CreateICmpULT(itemsAvail, segmentItems);
    40     Value * itemsToDo = iBuilder->CreateSelect(lessThanFullSegment, itemsAvail, segmentItems);
    41     produced = iBuilder->CreateAdd(produced, itemsToDo);
     38   
     39    Value * nextProduced = iBuilder->CreateAdd(produced, segmentItems);
     40    Value * lessThanFullSegment = iBuilder->CreateICmpULT(fileItems, nextProduced);
     41    produced = iBuilder->CreateSelect(lessThanFullSegment, fileItems, nextProduced);
    4242    setProducedItemCount(self, "sourceBuffer", produced);
    4343   
Note: See TracChangeset for help on using the changeset viewer.