Ignore:
Timestamp:
Oct 8, 2017, 9:20:51 AM (22 months ago)
Author:
cameron
Message:

MatchAccumulator? modularization step

File:
1 edited

Legend:

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

    r5676 r5678  
    1010#include <IR_Gen/FunctionTypeBuilder.h>
    1111#include <llvm/Support/raw_ostream.h>
     12#include <grep_engine.h>
    1213
    1314using namespace llvm;
     
    3536}
    3637   
    37 void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, size_t line_start, size_t line_end) {
    38     reinterpret_cast<MatchAccumulator *>(accum_addr)->accumulate_match(lineNum, line_start, line_end);
    39 }
    40 
    41 
    4238void ScanMatchKernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder) {
    4339
     
    158154            Value * matchRecordEnd = iBuilder->CreateAdd(phiScanwordPos, iBuilder->CreateCountForwardZeroes(phiMatchWord));
    159155            if (mGrepType == GrepType::CallBack) {
    160                 Function * dispatcher = iBuilder->LinkFunction<void (intptr_t, size_t, size_t, size_t)>("accumulate_match_wrapper", & accumulate_match_wrapper);
     156                Function * dispatcher = m->getFunction("accumulate_match_wrapper"); assert (dispatcher);
     157                //Function * dispatcher = iBuilder->LinkFunction<void (intptr_t, size_t, size_t, size_t)>("accumulate_match_wrapper", & grep::accumulate_match_wrapper);
    161158                Value * accumulator = iBuilder->getScalarField("accumulator_address");
    162159                iBuilder->CreateCall(dispatcher, {accumulator, matchRecordNum, matchRecordStart, matchRecordEnd});
Note: See TracChangeset for help on using the changeset viewer.