Ignore:
Timestamp:
Nov 10, 2016, 11:11:58 PM (3 years ago)
Author:
lindanl
Message:

Some fixes for editd. Add timer.

File:
1 edited

Legend:

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

    r5212 r5213  
    425425#define GROUPBLOCKS 64
    426426
    427 void editdGPUCodeGen(){ 
     427void editdGPUCodeGen(unsigned patternLen){ 
    428428    LLVMContext TheContext;
    429429    Module * M = new Module("editd-gpu", TheContext);
     
    445445    ExternalFileBuffer ResultStream(iBuilder, StreamSetType(iBuilder, editDistance+1, 1), addrSpace);
    446446
    447     const unsigned patternLen = 19;
    448447    kernel::editdGPUKernel editdk(iBuilder, editDistance, patternLen);
    449448    editdk.generateKernel({&CCStream}, {&ResultStream});
     
    512511    Type * const size_ty = iBuilder->getSizeTy();
    513512    Type * const voidTy = Type::getVoidTy(M->getContext());
    514     Type * const inputType = PointerType::get(ArrayType::get(mBitBlockType, 4), 0);
     513    Type * const inputType = PointerType::get(ArrayType::get(mBitBlockType, editDistance+1), 0);
    515514
    516515    ExternalFileBuffer MatchResults(iBuilder, StreamSetType(iBuilder, editDistance+1, 1));
     
    573572#ifdef CUDA_ENABLED 
    574573    setNVPTXOption();   
    575     if(codegen::NVPTX){   
    576         editdGPUCodeGen();
     574    if(codegen::NVPTX){
    577575
    578576        std::ifstream t(PatternFilename);
     
    581579            exit(-1);
    582580        } 
    583         std::string pattern_str((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
    584 
    585         ulong * rslt = RunPTX(PTXFilename, chStream, size, pattern_str.c_str(), pattern_str.length());
     581        std::string patterns((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
     582
     583        editdGPUCodeGen(patterns.length()/GROUPTHREADS - 1);
     584
     585        ulong * rslt = RunPTX(PTXFilename, chStream, size, patterns.c_str(), patterns.length(), editDistance);
    586586
    587587        editdFunctionType editd_ptr = editdScanCPUCodeGen();
Note: See TracChangeset for help on using the changeset viewer.