Ignore:
Timestamp:
Jul 30, 2016, 1:12:45 PM (3 years ago)
Author:
cameron
Message:

DoBlock/FinalBlock/DoSegment? Kernel functions always return void; clean-up

File:
1 edited

Legend:

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

    r5106 r5111  
    5454    std::vector<Type *> doBlockParameters = {selfType};
    5555    std::vector<Type *> finalBlockParameters = {selfType, iBuilder->getSizeTy()};
    56     /*
    57     for (auto inputSet : mStreamSetInputs) {
    58         Type * inputSetParmType = PointerType::getUnqual(inputSet.ssType.getStreamSetBlockType(iBuilder));
    59         doBlockParameters.push_back(inputSetParmType);
    60         finalBlockParameters.push_back(inputSetParmType);
    61     }
    62     for (auto outputSet : mStreamSetOutputs) {
    63         Type * outputSetParmType = PointerType::getUnqual(outputSet.ssType.getStreamSetBlockType(iBuilder));
    64         doBlockParameters.push_back(outputSetParmType);
    65         finalBlockParameters.push_back(outputSetParmType);
    66     }
    67      */
    68     FunctionType * doBlockFunctionType = FunctionType::get(mDoBlockReturnType, doBlockParameters, false);
     56    FunctionType * doBlockFunctionType = FunctionType::get(iBuilder->getVoidTy(), doBlockParameters, false);
    6957    std::string doBlockName = mKernelName + doBlock_suffix;
    7058    Function * doBlockFn = Function::Create(doBlockFunctionType, GlobalValue::ExternalLinkage, doBlockName, client);
     
    7563    }
    7664   
    77     FunctionType * finalBlockType = FunctionType::get(mDoBlockReturnType, finalBlockParameters, false);
     65    FunctionType * finalBlockType = FunctionType::get(iBuilder->getVoidTy(), finalBlockParameters, false);
    7866    std::string finalBlockName = mKernelName + finalBlock_suffix;
    7967    Function * finalBlockFn = Function::Create(finalBlockType, GlobalValue::ExternalLinkage, finalBlockName, client);
     
    9583    finalBlockArg->setName("remainingBytes");
    9684
    97 /*    for (auto inputSet : mStreamSetInputs) {
    98         doBlockArg = &*(doBlockArgs++);
    99         finalBlockArg = &*(finalBlockArgs++);
    100         doBlockArg->setName(inputSet.ssName);
    101         finalBlockArg->setName(inputSet.ssName);
    102     }
    103     for (auto outputSet : mStreamSetOutputs) {
    104         doBlockArg = &*(doBlockArgs++);
    105         finalBlockArg = &*(finalBlockArgs++);
    106         doBlockArg->setName(outputSet.ssName);
    107         finalBlockArg->setName(outputSet.ssName);
    108     }
    109     */
    11085    // Create the doSegment function prototype.
    11186    std::vector<Type *> doSegmentParameters = {selfType, iBuilder->getSizeTy()};
    112     FunctionType * doSegmentFunctionType = FunctionType::get(mDoBlockReturnType, doSegmentParameters, false);
     87    FunctionType * doSegmentFunctionType = FunctionType::get(iBuilder->getVoidTy(), doSegmentParameters, false);
    11388    std::string doSegmentName = mKernelName + doSegment_suffix;
    11489    Function * doSegmentFn = Function::Create(doSegmentFunctionType, GlobalValue::ExternalLinkage, doSegmentName, client);
     
    137112    if (!initMethod) {
    138113        throw std::runtime_error("Cannot find " + initFnName);
    139         //Or just zero-initialize???
    140         //iBuilder->CreateStore(Constant::getNullValue(mKernelStateType), kernelInstance);
    141         //return kernelInstance;
    142114    }
    143115    iBuilder->CreateCall(initMethod, init_args);
Note: See TracChangeset for help on using the changeset viewer.