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

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

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5227 r5230  
    427427Function * KernelBuilder::generateThreadFunction(std::string name){
    428428    Module * m = iBuilder->getModule();
    429     Type * const voidTy = Type::getVoidTy(m->getContext());
     429    Type * const voidTy = iBuilder->getVoidTy();
    430430    Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    431431    Type * const int8PtrTy = iBuilder->getInt8PtrTy();
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5229 r5230  
    120120#endif
    121121   
    122 void s2pKernel::generateFinalBlockMethod() {
     122void S2PKernel::generateFinalBlockMethod() {
    123123    /* Prepare the s2p final block function:
    124124     assumption: if remaining bytes is greater than 0, it is safe to read a full block of bytes.
     
    161161
    162162   
    163 void s2pKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
     163void S2PKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
    164164
    165165    Value * byteStream = getStreamSetBlockPtr(self, "byteStream", blockNo);
     
    181181}
    182182   
    183 void s2pKernel::generateDoBlockMethod() {
     183void S2PKernel::generateDoBlockMethod() {
    184184    auto savePoint = iBuilder->saveIP();
    185185
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r5217 r5230  
    2222
    2323
    24 class s2pKernel : public KernelBuilder {
     24class S2PKernel : public KernelBuilder {
    2525public:
    2626   
    27     s2pKernel(IDISA::IDISA_Builder * iBuilder) :
     27    S2PKernel(IDISA::IDISA_Builder * iBuilder) :
    2828    KernelBuilder(iBuilder, "s2p",
    2929                  {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5217 r5230  
    122122    switch (mGrepType) {
    123123        case GrepType::Normal:
    124             matchProcessor = m->getOrInsertFunction("wrapped_report_match", Type::getVoidTy(ctxt), T, T, T, S, T, T, nullptr);
     124            matchProcessor = m->getOrInsertFunction("wrapped_report_match", iBuilder->getVoidTy(), T, T, T, S, T, T, nullptr);
    125125            break;
    126126        case GrepType::NameExpression:
    127             matchProcessor = m->getOrInsertFunction("insert_codepoints", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     127            matchProcessor = m->getOrInsertFunction("insert_codepoints", iBuilder->getVoidTy(), T, T, T, S, nullptr);
    128128            break;
    129129        case GrepType::PropertyValue:
    130             matchProcessor = m->getOrInsertFunction("insert_property_values", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     130            matchProcessor = m->getOrInsertFunction("insert_property_values", iBuilder->getVoidTy(), T, T, T, S, nullptr);
    131131            break;
    132132        default: llvm_unreachable("unknown grep type");
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5224 r5230  
    2424// The doBlock method is deprecated.   But in case it is used, just call doSegment with
    2525// 1 as the number of blocks to do.
    26 void stdOutKernel::generateDoBlockMethod() {
     26void StdOutKernel::generateDoBlockMethod() {
    2727    auto savePoint = iBuilder->saveIP();
    2828    Module * m = iBuilder->getModule();
     
    3838// Rather than using doBlock logic to write one block at a time, this custom
    3939// doSegment method, writes the entire segment with a single write call.
    40 void stdOutKernel::generateDoSegmentMethod() {
     40void StdOutKernel::generateDoSegmentMethod() {
    4141    auto savePoint = iBuilder->saveIP();
    4242    Module * m = iBuilder->getModule();
     
    9494}
    9595
    96 void stdOutKernel::generateFinalBlockMethod() {
     96void StdOutKernel::generateFinalBlockMethod() {
    9797    auto savePoint = iBuilder->saveIP();
    9898    Module * m = iBuilder->getModule();
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h

    r5217 r5230  
    1414namespace kernel {
    1515
    16 class stdOutKernel : public KernelBuilder {
     16class StdOutKernel : public KernelBuilder {
    1717public:
    18     stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
     18    StdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
    1919    KernelBuilder(iBuilder, "stdout",
    2020                  {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}),
  • icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.cpp

    r5217 r5230  
    1313#include <kernels/instance.h>
    1414
    15 #include <pablo/prototype.h>
    1615#include <pablo/pablo_compiler.h>
    1716#include <pablo/analysis/pabloverifier.hpp>
     
    638637    delete sorting;
    639638
    640     releaseSlabAllocatorMemory();
    641 
    642639    generateGatherKernel(mGatherKernel, endpoints, 64);
    643640}
     
    648645
    649646    Type * inputType = PointerType::get(ArrayType::get(StructType::get(mMod->getContext(), std::vector<Type *>({ArrayType::get(mBitBlockType, 8)})), 1), 0);
    650     Function * const main = cast<Function>(mMod->getOrInsertFunction("Main", Type::getVoidTy(mMod->getContext()), inputType, intType, nullptr));
     647    Function * const main = cast<Function>(mMod->getOrInsertFunction("Main", iBuilder->getVoidTy(), inputType, intType, nullptr));
    651648    main->setCallingConv(CallingConv::C);
    652649    Function::arg_iterator args = main->arg_begin();
Note: See TracChangeset for help on using the changeset viewer.