Ignore:
Timestamp:
Oct 18, 2017, 9:35:52 AM (2 years ago)
Author:
cameron
Message:

Update scanmatch callback protocol to use line start/end pointers; add finalize callback for buffer end

File:
1 edited

Legend:

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

    r5693 r5694  
    363363    BasicBlock * finalizeDone = kb->CreateBasicBlock("finalizeDone");
    364364    // if the fileDescriptor is 0, the file is stdin, use readSource kernel logic, otherwise use mmap logic.
    365     kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(0)), finalizeRead, finalizeMMap);
     365    kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(STDIN_FILENO)), finalizeRead, finalizeMMap);
    366366    kb->SetInsertPoint(finalizeRead);
    367367    reinterpret_cast<ReadSourceKernel *>(this)->ReadSourceKernel::generateFinalizeMethod(kb);
     
    378378    BasicBlock * initializeDone = kb->CreateBasicBlock("initializeDone");
    379379    // if the fileDescriptor is 0, the file is stdin, use readSource kernel logic, otherwise use MMap logic.
    380     kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(0)), initializeRead, initializeMMap);
     380    kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(STDIN_FILENO)), initializeRead, initializeMMap);
    381381    kb->SetInsertPoint(initializeRead);
    382382    reinterpret_cast<ReadSourceKernel *>(this)->ReadSourceKernel::generateInitializeMethod(kb);
     
    393393    BasicBlock * DoSegmentDone = kb->CreateBasicBlock("DoSegmentDone");
    394394    // if the fileDescriptor is 0, the file is stdin, use readSource kernel logic, otherwise use MMap logic.
    395     kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(0)), DoSegmentRead, DoSegmentMMap);
     395    kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(STDIN_FILENO)), DoSegmentRead, DoSegmentMMap);
    396396    kb->SetInsertPoint(DoSegmentRead);
    397397    reinterpret_cast<ReadSourceKernel *>(this)->ReadSourceKernel::generateDoSegmentMethod(kb);
Note: See TracChangeset for help on using the changeset viewer.