Ignore:
Timestamp:
Apr 9, 2017, 3:59:17 PM (2 years ago)
Author:
nmedfort
Message:

Updated all projects to use ParabixDriver?. Deprecated original pipeline generation methods. Enabled LLVM optimizations, IR and ASM printing for Kernel modules. Enabled object cache by default. Begun work on moving consumed position information back to producing kernels.

File:
1 edited

Legend:

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

    r5398 r5401  
    2222using namespace llvm;
    2323
    24 ProcessingRate FixedRatio(unsigned strmItemsPer, unsigned perPrincipalInputItems, std::string referenceStreamSet) {
    25     return ProcessingRate(ProcessingRate::ProcessingRateKind::Fixed, strmItemsPer, perPrincipalInputItems, referenceStreamSet);
     24ProcessingRate FixedRatio(unsigned strmItemsPer, unsigned perPrincipalInputItems, std::string && referenceStreamSet) {
     25    return ProcessingRate(ProcessingRate::ProcessingRateKind::Fixed, strmItemsPer, perPrincipalInputItems, std::move(referenceStreamSet));
    2626}
    2727
    28 ProcessingRate MaxRatio(unsigned strmItemsPer, unsigned perPrincipalInputItems, std::string referenceStreamSet) {
    29     return ProcessingRate(ProcessingRate::ProcessingRateKind::Max, strmItemsPer, perPrincipalInputItems, referenceStreamSet);
     28ProcessingRate MaxRatio(unsigned strmItemsPer, unsigned perPrincipalInputItems, std::string && referenceStreamSet) {
     29    return ProcessingRate(ProcessingRate::ProcessingRateKind::Max, strmItemsPer, perPrincipalInputItems, std::move(referenceStreamSet));
    3030}
    3131
    32 ProcessingRate RoundUpToMultiple(unsigned itemMultiple, std::string referenceStreamSet) {
    33     return ProcessingRate(ProcessingRate::ProcessingRateKind::RoundUp, itemMultiple, itemMultiple, referenceStreamSet);
     32ProcessingRate RoundUpToMultiple(unsigned itemMultiple, std::string && referenceStreamSet) {
     33    return ProcessingRate(ProcessingRate::ProcessingRateKind::RoundUp, itemMultiple, itemMultiple, std::move(referenceStreamSet));
    3434}
    3535
    36 ProcessingRate Add1(std::string referenceStreamSet) {
    37     return ProcessingRate(ProcessingRate::ProcessingRateKind::Add1, 0, 0, referenceStreamSet);
     36ProcessingRate Add1(std::string && referenceStreamSet) {
     37    return ProcessingRate(ProcessingRate::ProcessingRateKind::Add1, 0, 0, std::move(referenceStreamSet));
    3838}
    3939
     
    9494    }
    9595
    96     // Create the doSegment function prototype.
     96    /// INVESTIGATE: should we explicitly mark whether to track a kernel output's consumed amount? It would have
     97    /// to be done at the binding level using the current architecture. It would reduce the number of arguments
     98    /// passed between kernels.
     99
     100    // Create the doSegment function prototype.   
     101    IntegerType * const sizeTy = iBuilder->getSizeTy();
     102
    97103    std::vector<Type *> params = {selfType, iBuilder->getInt1Ty()};
    98     // const auto count = mStreamSetInputs.size() + mStreamSetOutputs.size();
    99     for (unsigned i = 0; i < mStreamSetInputs.size(); ++i) {
    100         params.push_back(iBuilder->getSizeTy());
     104    params.insert(params.end(), mStreamSetInputs.size() + mStreamSetOutputs.size(), sizeTy);
     105
     106    Type * retType = nullptr;
     107    if (mStreamSetInputs.empty()) {
     108        retType = iBuilder->getVoidTy();
     109    } else {
     110        retType = ArrayType::get(sizeTy, mStreamSetInputs.size());
    101111    }
    102112
    103     FunctionType * doSegmentType = FunctionType::get(iBuilder->getVoidTy(), params, false);
     113    FunctionType * const doSegmentType = FunctionType::get(retType, params, false);
    104114    Function * doSegment = Function::Create(doSegmentType, GlobalValue::ExternalLinkage, getName() + DO_SEGMENT_SUFFIX, client);
    105115    doSegment->setCallingConv(CallingConv::C);
     
    112122        (++args)->setName(input.name + "_availableItems");
    113123    }
    114 //    for (const Binding & output : mStreamSetOutputs) {
    115 //        (++args)->setName(output.name + "_consumedItems");
    116 //    }
     124    for (const Binding & output : mStreamSetOutputs) {
     125        (++args)->setName(output.name + "_consumedItems");
     126    }
     127
     128    /// INVESTIGATE: replace the accumulator methods with a single Exit method that handles any clean up and returns
     129    /// a struct containing all scalar outputs?
    117130
    118131    // Create the accumulator get function prototypes
Note: See TracChangeset for help on using the changeset viewer.