Ignore:
Timestamp:
Jun 25, 2016, 9:07:07 AM (3 years ago)
Author:
cameron
Message:

Kernel infrastructure: move common logic into KernelBuilder? base class; demo linking in wc

File:
1 edited

Legend:

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

    r5070 r5074  
    1818#include <llvm/ExecutionEngine/ExecutionEngine.h>
    1919#include <llvm/ExecutionEngine/MCJIT.h>
     20#include "llvm/Linker/Linker.h"
    2021
    2122#include <llvm/Support/CommandLine.h>
     
    142143    unsigned mBlockSize = iBuilder->getBitBlockWidth();
    143144    s2pKernel  s2pk(iBuilder);
    144     s2pk.generateKernel();
    145    
     145    std::unique_ptr<Module> s2pM = s2pk.createKernelModule();
    146146    pablo_function_passes(function);
    147147    pablo::PabloKernel  wck(iBuilder, "wc", function, {"lineCount", "wordCount", "charCount"});
    148     wck.prepareKernel();
    149     wck.generateKernel();
     148    std::unique_ptr<Module> wcM = wck.createKernelModule();
     149   
     150    s2pk.addKernelDeclarations(mMod);
     151    wck.addKernelDeclarations(mMod);
    150152
    151153    Constant * record_counts_routine;
     
    221223   
    222224    iBuilder->CreateRetVoid();
     225   
     226    Linker L(*mMod);
     227    L.linkInModule(std::move(s2pM));
     228    L.linkInModule(std::move(wcM));
     229   
    223230    return main;
    224231}
Note: See TracChangeset for help on using the changeset viewer.