Changeset 5398 for icGREP/icgrepdevel/icgrep/kernels/interface.cpp
 Timestamp:
 Apr 7, 2017, 4:59:04 PM (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

icGREP/icgrepdevel/icgrep/kernels/interface.cpp
r5390 r5398 44 44 Value * ProcessingRate::CreateRatioCalculation(IDISA::IDISA_Builder * b, Value * principalInputItems, Value * doFinal) const { 45 45 if (mKind == ProcessingRate::ProcessingRateKind::Fixed  mKind == ProcessingRate::ProcessingRateKind::Max) { 46 if ( ratio_numerator == 1) {46 if (mRatioNumerator == 1) { 47 47 return principalInputItems; 48 48 } 49 49 Type * const T = principalInputItems>getType(); 50 Constant * const numerator = ConstantInt::get(T, ratio_numerator);51 Constant * const denominator = ConstantInt::get(T, ratio_denominator);52 Constant * const denominatorLess1 = ConstantInt::get(T, ratio_denominator  1);50 Constant * const numerator = ConstantInt::get(T, mRatioNumerator); 51 Constant * const denominator = ConstantInt::get(T, mRatioDenominator); 52 Constant * const denominatorLess1 = ConstantInt::get(T, mRatioDenominator  1); 53 53 Value * strmItems = b>CreateMul(principalInputItems, numerator); 54 54 return b>CreateUDiv(b>CreateAdd(denominatorLess1, strmItems), denominator); … … 56 56 if (mKind == ProcessingRate::ProcessingRateKind::RoundUp) { 57 57 Type * const T = principalInputItems>getType(); 58 Constant * const denominator = ConstantInt::get(T, ratio_denominator);59 Constant * const denominatorLess1 = ConstantInt::get(T, ratio_denominator  1);58 Constant * const denominator = ConstantInt::get(T, mRatioDenominator); 59 Constant * const denominatorLess1 = ConstantInt::get(T, mRatioDenominator  1); 60 60 return b>CreateMul(b>CreateUDiv(b>CreateAdd(principalInputItems, denominatorLess1), denominator), denominator); 61 61 } … … 95 95 96 96 // Create the doSegment function prototype. 97 std::vector<Type *> doSegmentParameters = {selfType, iBuilder>getInt1Ty()}; 97 std::vector<Type *> params = {selfType, iBuilder>getInt1Ty()}; 98 // const auto count = mStreamSetInputs.size() + mStreamSetOutputs.size(); 98 99 for (unsigned i = 0; i < mStreamSetInputs.size(); ++i) { 99 doSegmentParameters.push_back(iBuilder>getSizeTy());100 params.push_back(iBuilder>getSizeTy()); 100 101 } 101 FunctionType * doSegmentType = FunctionType::get(iBuilder>getVoidTy(), doSegmentParameters, false); 102 103 FunctionType * doSegmentType = FunctionType::get(iBuilder>getVoidTy(), params, false); 102 104 Function * doSegment = Function::Create(doSegmentType, GlobalValue::ExternalLinkage, getName() + DO_SEGMENT_SUFFIX, client); 103 105 doSegment>setCallingConv(CallingConv::C); … … 107 109 args>setName("self"); 108 110 (++args)>setName("doFinal"); 109 for ( auto ss: mStreamSetInputs) {110 (++args)>setName( ss.name + "_availableItems");111 for (const Binding & input : mStreamSetInputs) { 112 (++args)>setName(input.name + "_availableItems"); 111 113 } 114 // for (const Binding & output : mStreamSetOutputs) { 115 // (++args)>setName(output.name + "_consumedItems"); 116 // } 112 117 113 118 // Create the accumulator get function prototypes
Note: See TracChangeset
for help on using the changeset viewer.