Changeset 5550 for icGREP/icgrep-devel


Ignore:
Timestamp:
Jul 5, 2017, 1:51:04 PM (2 years ago)
Author:
lindanl
Message:

Use exsiting PTX file.

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

Legend:

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

    r5548 r5550  
    9494}
    9595   
    96 void GrepEngine::doGrep(const std::string & fileName) const{
     96void GrepEngine::doGrep(const std::string & fileName, std::string & PTXFilename) const{
    9797#ifdef CUDA_ENABLED
    9898    const bool CountOnly = true;
     
    125125                exit(-1);
    126126            }
    127             const auto PTXFilename = mGrepDriver->getBuilder()->getModule()->getModuleIdentifier() + ".ptx";
     127            if(PTXFilename=="")
     128                PTXFilename = mGrepDriver->getBuilder()->getModule()->getModuleIdentifier() + ".ptx";
    128129            RunPTX(PTXFilename, fileBuffer, fileSize, CountOnly, LFPositions, startPoints, accumBytes);
    129130            source.close();
  • icGREP/icgrep-devel/icgrep/grep_engine.h

    r5548 r5550  
    3535    void grepCodeGen_nvptx(std::vector<re::RE *> REs, GrepModeType grepMode, bool UTF_16);
    3636
    37     void doGrep(const std::string & fileName) const;
     37    void doGrep(const std::string & fileName, std::string & PTXFilename) const;
    3838   
    3939    bool matchesNeedToBeMovedToEOL() const;
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5486 r5550  
    4343static cl::opt<bool> MultiGrepKernels("enable-multigrep-kernels", cl::desc("Construct separated kernels for each regular expression"));
    4444static cl::opt<int> REsPerGroup("re-num", cl::desc("Number of regular expressions processed by each kernel."), cl::init(1));
     45
     46static cl::opt<std::string> PTXFile("ptx", cl::desc("compiled PTX file."), cl::init(""));
     47
    4548static std::vector<std::string> allFiles;
    46 
    4749static re::ModeFlagSet globalFlags = 0;
    4850
     
    191193               
    192194        if (codegen::NVPTX) {
    193             grepEngine.grepCodeGen_nvptx(REs, grep::Mode, UTF_16);
     195            if(PTXFile=="")
     196                grepEngine.grepCodeGen_nvptx(REs, grep::Mode, UTF_16);
    194197            for (unsigned i = 0; i != allFiles.size(); ++i) {
    195                 grepEngine.doGrep(allFiles[i]);
     198                grepEngine.doGrep(allFiles[i], PTXFile);
    196199            }
    197200            return 0;
Note: See TracChangeset for help on using the changeset viewer.