Ignore:
Timestamp:
Dec 5, 2016, 1:08:23 PM (2 years ago)
Author:
cameron
Message:

Automate instance creation

File:
1 edited

Legend:

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

    r5217 r5220  
    9595
    9696
    97 Value * KernelInterface::createInstance(std::vector<Value *> args) {
    98     Value * kernelInstance = iBuilder->CreateCacheAlignedAlloca(mKernelStateType);
     97void KernelInterface::setInitialArguments(std::vector<Value *> args) {
     98    mInitialArguments = args;
     99}
     100
     101void KernelInterface::createInstance() {
     102    mKernelInstance = iBuilder->CreateCacheAlignedAlloca(mKernelStateType);
    99103    Module * m = iBuilder->getModule();
    100     std::vector<Value *> init_args = {kernelInstance};
    101     for (auto a : args) {
     104    std::vector<Value *> init_args = {mKernelInstance};
     105    for (auto a : mInitialArguments) {
    102106        init_args.push_back(a);
    103107    }
     
    108112    }
    109113    iBuilder->CreateCall(initMethod, init_args);
    110     return kernelInstance;
    111114}
    112115
Note: See TracChangeset for help on using the changeset viewer.