Changeset 5611


Ignore:
Timestamp:
Aug 14, 2017, 9:52:32 PM (4 months ago)
Author:
cameron
Message:

MaxReferenceItems? for MaxRatio?

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
2 edited

Legend:

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

    r5552 r5611  
    8686
    8787unsigned ProcessingRate::calculateMaxReferenceItems(unsigned outputItems, bool doFinal) const {
    88     if (mKind == ProcessingRate::ProcessingRateKind::FixedRatio) {
     88    if (mKind == ProcessingRate::ProcessingRateKind::FixedRatio || mKind == ProcessingRate::ProcessingRateKind::MaxRatio) {
    8989        if (mRatioNumerator == mRatioDenominator) {
    9090            return outputItems;
     
    9898        return doFinal ? outputItems - 1 : outputItems;
    9999    }
    100     report_fatal_error("Inverse processing rate calculation attempted for variable or unknown rate.");
     100    report_fatal_error("Inverse processing rate calculation attempted for unknown rate.");
    101101}
    102102
    103103Value * ProcessingRate::CreateMaxReferenceItemsCalculation(IDISA::IDISA_Builder * const b, Value * outputItems, Value * doFinal) const {
    104     if (mKind == ProcessingRate::ProcessingRateKind::FixedRatio) {
     104    if (mKind == ProcessingRate::ProcessingRateKind::FixedRatio || mKind == ProcessingRate::ProcessingRateKind::MaxRatio) {
    105105        if (mRatioNumerator == mRatioDenominator) {
    106106            return outputItems;
     
    123123        return b->CreateSub(outputItems, ConstantInt::get(T, 1));
    124124    }
    125     report_fatal_error("Inverse processing rate calculation attempted for variable or unknown rate.");
     125    report_fatal_error("Inverse processing rate calculation attempted for unknown rate.");
    126126}
    127127
  • icGREP/icgrep-devel/icgrep/kernels/interface.h

    r5590 r5611  
    4242    bool isUnknownRate() const { return mKind == ProcessingRateKind::Unknown; }
    4343    unsigned calculateRatio(unsigned referenceItems, bool doFinal = false) const;
     44    // Calculate the max number of reference items that can be processed without exceeding/exhausting outputItems
    4445    unsigned calculateMaxReferenceItems(unsigned outputItems, bool doFinal = false) const;
    4546    llvm::Value * CreateRatioCalculation(IDISA::IDISA_Builder * const b, llvm::Value * referenceItems, llvm::Value * doFinal = nullptr) const;
Note: See TracChangeset for help on using the changeset viewer.