Ignore:
Timestamp:
Dec 6, 2017, 5:41:27 PM (21 months ago)
Author:
nmedfort
Message:

Bug fixes + more assertions to prevent similar errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5755 r5757  
    180180    Module * M = idb->getModule();
    181181   
    182     const unsigned segmentSize = codegen::SegmentSize;
     182    const auto segmentSize = codegen::SegmentSize;
     183    const auto bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
     184
    183185    const unsigned encodingBits = 8;
    184186   
     
    192194   
    193195    StreamSetBuffer * ByteStream = mGrepDriver->addBuffer<SourceBuffer>(idb, idb->getStreamSetTy(1, encodingBits));
    194     kernel::Kernel * sourceK = mGrepDriver->addKernelInstance<kernel::FDSourceKernel>(idb, segmentSize);
     196    kernel::Kernel * sourceK = mGrepDriver->addKernelInstance<kernel::FDSourceKernel>(idb, segmentSize * bufferSegments);
    195197    sourceK->setInitialArguments({fileDescriptor});
    196198    mGrepDriver->makeKernelCall(sourceK, {}, {ByteStream});
     
    299301    Module * M = idb->getModule();
    300302   
    301     const unsigned segmentSize = codegen::SegmentSize;
     303    const auto segmentSize = codegen::SegmentSize;
     304    const auto bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
    302305    const unsigned encodingBits = 8;
    303306   
     
    313316   
    314317    StreamSetBuffer * ByteStream = mGrepDriver->addBuffer<SourceBuffer>(idb, idb->getStreamSetTy(1, encodingBits));
    315     kernel::Kernel * sourceK = mGrepDriver->addKernelInstance<kernel::FDSourceKernel>(idb, segmentSize);
     318    kernel::Kernel * sourceK = mGrepDriver->addKernelInstance<kernel::FDSourceKernel>(idb, segmentSize * bufferSegments);
    316319    sourceK->setInitialArguments({fileDescriptor});
    317320    mGrepDriver->makeKernelCall(sourceK, {}, {ByteStream});
Note: See TracChangeset for help on using the changeset viewer.