Ignore:
Timestamp:
Apr 5, 2017, 11:47:54 AM (2 years ago)
Author:
cameron
Message:

Kernel signatures for object cache

File:
1 edited

Legend:

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

    r5391 r5392  
    1313#include <llvm/IR/Module.h>
    1414#include <llvm/Support/raw_ostream.h>
     15#include <llvm/Bitcode/ReaderWriter.h>
    1516#include <llvm/Transforms/Utils/Local.h>
    1617
     
    5960}
    6061
    61 void KernelBuilder::prepareKernelSignature() {
     62void KernelBuilder::prepareStreamSetNameMap() {
    6263    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    6364        mStreamSetNameMap.emplace(mStreamSetInputs[i].name, i);
     
    110111    }
    111112    if (mStreamSetNameMap.empty()) {
    112         prepareKernelSignature();
     113        prepareStreamSetNameMap();
    113114    }
    114115    for (auto binding : mInternalScalars) {
     
    153154   
    154155}   
     156
     157
     158// Default kernel signature: generate the IR and emit as byte code.
     159void KernelBuilder::generateKernelSignature(std::string &signature) {
     160    generateKernel();
     161    raw_string_ostream OS(signature);
     162    WriteBitcodeToFile(iBuilder->getModule(), OS);
     163}
     164
    155165
    156166std::unique_ptr<Module> KernelBuilder::createKernelModule(const std::vector<StreamSetBuffer *> & inputs, const std::vector<StreamSetBuffer *> & outputs) {
Note: See TracChangeset for help on using the changeset viewer.