Changeset 5294


Ignore:
Timestamp:
Feb 2, 2017, 12:20:41 PM (8 months ago)
Author:
lindanl
Message:

Bug fixed for icgrep GPU version.

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CudaDriver.h

    r5212 r5294  
    101101  // Retrieve device data
    102102
     103  CUevent start;
     104  CUevent stop;
     105  float elapsedTime;
     106
     107  cuEventCreate(&start, CU_EVENT_BLOCKING_SYNC);
     108  cuEventRecord(start,0);
     109
    103110  ulong * matchRslt;
    104111  int ret = posix_memalign((void**)&matchRslt, 32, outputSize);
     
    116123  }
    117124
     125  cuEventCreate(&stop, CU_EVENT_BLOCKING_SYNC);
     126  cuEventRecord(stop,0);
     127  cuEventSynchronize(stop);
     128
     129  cuEventElapsedTime(&elapsedTime, start, stop);
     130  printf("GPU Kernel time : %f ms\n" ,elapsedTime);
     131
    118132
    119133  // Clean-up
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5293 r5294  
    182182    fileIdx->setName("fileIdx");
    183183
     184    const unsigned segmentSize = codegen::SegmentSize;
     185
    184186    ExternalFileBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy( 2, 1));
    185187    MatchResults.setStreamSetBuffer(rsltStream, fileSize);
     188
     189    kernel::MMapSourceKernel mmapK(iBuilder, segmentSize);
     190    mmapK.generateKernel({}, {&MatchResults});
     191    mmapK.setInitialArguments({fileSize});
    186192
    187193    kernel::ScanMatchKernel scanMatchK(iBuilder, grepType);
     
    190196    scanMatchK.setInitialArguments({inputStream, fileSize, fileIdx});
    191197   
    192     generatePipelineLoop(iBuilder, {&scanMatchK});
     198    generatePipelineLoop(iBuilder, {&mmapK, &scanMatchK});
    193199    iBuilder->CreateRetVoid();
    194200
Note: See TracChangeset for help on using the changeset viewer.