Changeset 6025


Ignore:
Timestamp:
May 8, 2018, 12:30:14 PM (3 months ago)
Author:
nmedfort
Message:

bug fix for mmap kernel to prevent it from copying the entire file

File:
1 edited

Legend:

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

    r6010 r6025  
    3535    BasicBlock * const exit = b->CreateBasicBlock("Exit");
    3636    IntegerType * const sizeTy = b->getSizeTy();
     37
     38    ConstantInt * const PAGE_SIZE = b->getSize(getpagesize());
     39    ConstantInt * const ZERO = b->getSize(0);
     40
     41
    3742    Value * const fd = b->getScalarField("fileDescriptor");
    3843    assert (fileSizeMethod);
     
    5156    b->setBufferedSize("sourceBuffer", fileSize);
    5257    b->setScalarField("fileSize", fileSize);
    53     b->setProducedItemCount("sourceBuffer", fileSize);
     58    b->setProducedItemCount("sourceBuffer", ZERO);
    5459    b->setCapacity("sourceBuffer", fileSize);
    5560    b->CreateBr(exit);
    5661
    5762    b->SetInsertPoint(emptyFile);
    58     ConstantInt * const PAGE_SIZE = b->getSize(getpagesize());
    59     ConstantInt * const ZERO = b->getSize(0);
    6063    Value * const emptyFilePtr = b->CreatePointerCast(b->CreateAnonymousMMap(PAGE_SIZE), codeUnitPtrTy);
    6164    b->setScalarField("buffer", emptyFilePtr);
Note: See TracChangeset for help on using the changeset viewer.