Ignore:
Timestamp:
Mar 10, 2016, 4:10:02 PM (3 years ago)
Author:
nmedfort
Message:

Some fixes for threading and kernel builder.

File:
1 edited

Legend:

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

    r4967 r4968  
    5454#define ISPC_LLVM_VERSION ISPC_LLVM_3_6
    5555#include "ispc.cpp"
     56#include <sstream>
    5657
    5758using namespace pablo;
     
    432433    InitializeNativeTargetAsmParser();
    433434
     435    PassRegistry * Registry = PassRegistry::getPassRegistry();
     436    initializeCore(*Registry);
     437    initializeCodeGen(*Registry);
     438    initializeLowerIntrinsicsPass(*Registry);
     439
    434440    std::string errMessage;
    435441    EngineBuilder builder(std::move(std::unique_ptr<Module>(m)));
     
    452458    }
    453459
     460    // builder.selectTarget();
     461
    454462    //builder.setOptLevel(mMaxWhileDepth ? CodeGenOpt::Level::Less : CodeGenOpt::Level::None);
    455463    ExecutionEngine * engine = builder.create();
     
    458466        throw std::runtime_error("Could not create ExecutionEngine: " + errMessage);
    459467    }
    460 
    461468    if (EnableObjectCache) {
    462469        if (ObjectCacheDir.empty())
     
    472479
    473480
    474 int * total_count;
    475 std::stringstream * resultStrs;
    476 std::vector<std::string> inputFiles;
     481static int * total_count;
     482static std::stringstream * resultStrs = nullptr;
     483static std::vector<std::string> inputFiles;
    477484
    478485void initResult(std::vector<std::string> filenames, const int n){
    479486
    480487    inputFiles = filenames;
    481 
    482     std::stringstream * ss = new std::stringstream[n];
    483     resultStrs = ss;
    484 
    485     int * c = new int[n];
    486     total_count = c;
     488    resultStrs = new std::stringstream[n];
     489    total_count = new int[n];
    487490    for (int i=1; i<inputFiles.size(); i++){
    488491        total_count[i-1] = 0;
Note: See TracChangeset for help on using the changeset viewer.