Ignore:
Timestamp:
Dec 19, 2016, 2:39:35 PM (3 years ago)
Author:
nmedfort
Message:

Multi-threading support for PabloAST / PabloCompiler?. Requires unique LLVM Context / Module for each thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5229 r5230  
    77#include <pablo/codegenstate.h>
    88#include <pablo/pablo_compiler.h>
    9 #include <llvm/Support/Debug.h>
     9// #include <llvm/Support/Debug.h>
    1010#include <pablo/pe_var.h>
    1111#include <llvm/IR/Verifier.h>
    1212#include <IDISA/idisa_builder.h>
    13 #include <pablo/prototype.h>
    14 #include <stack>
    1513
    1614using namespace pablo;
     
    2018
    2119Var * PabloKernel::addInput(const std::string name, Type * const type) {
    22     Var * param = new Var(mSymbolTable->make(name), type, true);
     20    Var * param = new (mAllocator) Var(mSymbolTable->make(name, iBuilder), type, mAllocator, true);
    2321    mInputs.push_back(param);
    2422    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     
    3230
    3331Var * PabloKernel::addOutput(const std::string name, Type * const type) {
    34     Var * result = new Var(mSymbolTable->make(name), type, false);
     32    Var * result = new (mAllocator) Var(mSymbolTable->make(name, iBuilder), type, mAllocator, false);
    3533    mOutputs.push_back(result);
    3634    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     
    4442
    4543Var * PabloKernel::makeVariable(PabloAST * name, Type * const type) {
    46     Var * const var = new Var(name, type);
     44    Var * const var = new (mAllocator) Var(name, type, mAllocator);
    4745    mVariables.push_back(var);
    4846    return var;
     
    5856        }
    5957    }
    60     Zeroes * value = new Zeroes(type);
     58    Zeroes * value = new (mAllocator) Zeroes(type, mAllocator);
    6159    mConstants.push_back(value);
    6260    return value;
     
    7270        }
    7371    }
    74     Ones * value = new Ones(type);
     72    Ones * value = new (mAllocator) Ones(type, mAllocator);
    7573    mConstants.push_back(value);
    7674    return value;
     
    131129: KernelBuilder(builder, kernelName, {}, {}, {}, {}, {Binding{builder->getBitBlockType(), "EOFbit"}, Binding{builder->getBitBlockType(), "EOFmask"}})
    132130, mPabloCompiler(new PabloCompiler(this))
    133 , mSymbolTable(new SymbolGenerator())
     131, mSymbolTable(new SymbolGenerator(mAllocator))
    134132, mEntryBlock(PabloBlock::Create(this))
    135133{
Note: See TracChangeset for help on using the changeset viewer.