Ignore:
Timestamp:
Jan 6, 2016, 2:12:17 PM (3 years ago)
Author:
cameron
Message:

Kernels in icgrep: initial check-in

File:
1 edited

Legend:

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

    r4900 r4907  
    247247        throw std::runtime_error("Could not create ExecutionEngine: " + errMessage);
    248248    }
    249     //engine->addGlobalMapping(cast<GlobalValue>(mPrintRegisterFunction), (void *)&wrapped_print_register);
    250     // engine->addGlobalMapping(externalFunction, proto->getFunctionPtr());
    251249
    252250    return engine;
     251}
     252
     253extern "C" {
     254    void wrapped_report_match(uint64_t recordNum, uint64_t recordStart, uint64_t recordEnd) {
     255        printf("line %llu: (%llu, %llu)\n", recordNum, recordStart, recordEnd);
     256    }
    253257}
    254258
     
    267271        if (fnName == "process_block") continue;
    268272        if (fnName == "process_block_initialize_carries") continue;
     273       
    269274        if (fnName == "wrapped_print_register") {
    270275            e->addGlobalMapping(cast<GlobalValue>(it), (void *)&wrapped_print_register);
     276        }
     277        if (fnName == "wrapped_report_match") {
     278            e->addGlobalMapping(cast<GlobalValue>(it), (void *)&wrapped_report_match);
    271279        }
    272280#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
Note: See TracChangeset for help on using the changeset viewer.