Lines Matching refs:sourceOperandIndex

230 std::string toString(SourceOperandIndex sourceOperandIndex) {  in toString()  argument
231 return "(" + std::to_string(sourceOperandIndex.first) + ", " + in toString()
232 std::to_string(sourceOperandIndex.second) + ")"; in toString()
326 void DynamicTemporaries::declare(SourceOperandIndex sourceOperandIndex, uint32_t stepIndex, in declare() argument
330 << toString(sourceOperandIndex) << ", stepIndex = " << stepIndex in declare()
338 sourceOperandIndex, InternalLocationAndShape{stepIndex, 0, initialDimensions, in declare()
341 mStepIndexToSourceOperandIndexes[stepIndex].emplace_back(sourceOperandIndex); in declare()
344 bool DynamicTemporaries::redeclare(SourceOperandIndex sourceOperandIndex, in redeclare() argument
346 auto createAndLogResult = [sourceOperandIndex, &newDimensions, newLength](bool changedShape) { in redeclare()
348 << toString(sourceOperandIndex) in redeclare()
357 InternalLocationAndShape& temp = mSourceOperandToTemporary.at(sourceOperandIndex); in redeclare()
386 for (const auto& sourceOperandIndex : sourceOperandIndexesI->second) { in allocate() local
387 InternalLocationAndShape& temp = mSourceOperandToTemporary.at(sourceOperandIndex); in allocate()
424 SourceOperandIndex sourceOperandIndex, bool mustBeAllocated) const { in lookup() argument
426 if (auto it = mSourceOperandToTemporary.find(sourceOperandIndex); in lookup()
431 CHECK(isAllocated) << "Source operand " << toString(sourceOperandIndex) in lookup()
455 int ExecutionStep::addOperand(uint32_t sourceOperandIndex, uint32_t* stepOperandIndex, in addOperand() argument
458 auto i = mOperandMap.find(sourceOperandIndex); in addOperand()
467 mOperandMap.emplace(sourceOperandIndex, *stepOperandIndex); in addOperand()
471 const Operand& operand = sourceModel.getOperand(sourceOperandIndex); in addOperand()
511 mTempsAsStepModelInputs.emplace_back(sourceOperandIndex, *stepOperandIndex); in addOperand()
516 mPlan->recordTemporaryDef(SourceOperandIndex(mSourceModelIndex, sourceOperandIndex), in addOperand()
521 mModelInputs.emplace_back(sourceOperandIndex, *stepOperandIndex); in addOperand()
528 mOutputsAsStepModelInputs.emplace_back(sourceOperandIndex, *stepOperandIndex); in addOperand()
532 mModelOutputs.emplace_back(sourceOperandIndex, *stepOperandIndex); in addOperand()
535 mPlan->recordOutputDef(SourceOperandIndex(mSourceModelIndex, sourceOperandIndex), in addOperand()
600 SourceOperandIndex sourceOperandIndex(mSourceModelIndex, stepModelOperandIndex); in mapInputsAndOutputs() local
601 if (auto it = sourceOperandToLocationOfTemporary.find(sourceOperandIndex); in mapInputsAndOutputs()
606 } else if (auto loc = dynamicTemporaries.lookup(sourceOperandIndex); loc != std::nullopt) { in mapInputsAndOutputs()
609 } else if (auto it = sourceOperandToInputIndex.find(sourceOperandIndex); in mapInputsAndOutputs()
612 } else if (auto it = sourceOperandToOutputIndex.find(sourceOperandIndex); in mapInputsAndOutputs()
618 } else if (auto it = sourceOperandToConstantReference.find(sourceOperandIndex); in mapInputsAndOutputs()
626 << toString(sourceOperandIndex); in mapInputsAndOutputs()
630 SourceOperandIndex sourceOperandIndex(mSourceModelIndex, stepModelOperandIndex); in mapInputsAndOutputs() local
631 if (auto it = sourceOperandToLocationOfTemporary.find(sourceOperandIndex); in mapInputsAndOutputs()
636 } else if (auto loc = dynamicTemporaries.lookup(sourceOperandIndex); loc != std::nullopt) { in mapInputsAndOutputs()
639 } else if (auto it = sourceOperandToOutputIndex.find(sourceOperandIndex); in mapInputsAndOutputs()
644 << toString(sourceOperandIndex); in mapInputsAndOutputs()
657 [this](const SourceOperandIndex& sourceOperandIndex) { in findModelOutputsThatAreDownstreamInputs() argument
658 const auto it = mOutputToDefiningExecutionStep.find(sourceOperandIndex); in findModelOutputsThatAreDownstreamInputs()
665 << toString(sourceOperandIndex) << ")"; in findModelOutputsThatAreDownstreamInputs()
666 CHECK(mSourceOperandToOutputIndex.find(sourceOperandIndex) != in findModelOutputsThatAreDownstreamInputs()
669 mSourceOperandToOutputIndex.at(sourceOperandIndex)); in findModelOutputsThatAreDownstreamInputs()
674 SourceOperandIndex sourceOperandIndex(step->getSourceModelIndex(), output.first); in findModelOutputsThatAreDownstreamInputs() local
675 declareModelOutputIsDownstreamInput(sourceOperandIndex); in findModelOutputsThatAreDownstreamInputs()
682 auto recordAsOutputIfTemporary = [this](const SourceOperandIndex& sourceOperandIndex) { in findTempsAsStepModelOutputs() argument
683 const auto it = mTemporaryToDefiningExecutionStep.find(sourceOperandIndex); in findTempsAsStepModelOutputs()
692 mSteps[stepIndex]->executionStep()->recordTempAsStepModelOutput(sourceOperandIndex.second); in findTempsAsStepModelOutputs()
697 SourceOperandIndex sourceOperandIndex(step->getSourceModelIndex(), input.first); in findTempsAsStepModelOutputs() local
698 recordAsOutputIfTemporary(sourceOperandIndex); in findTempsAsStepModelOutputs()
702 for (const SourceOperandIndex& sourceOperandIndex : step->outerInputOperands) { in findTempsAsStepModelOutputs() local
703 recordAsOutputIfTemporary(sourceOperandIndex); in findTempsAsStepModelOutputs()
706 for (const SourceOperandIndex& sourceOperandIndex : step->outerInputOperands) { in findTempsAsStepModelOutputs() local
707 recordAsOutputIfTemporary(sourceOperandIndex); in findTempsAsStepModelOutputs()
834 uint32_t sourceOperandIndex = e.first; in finishStepModel() local
835 return mainModelOperandToInputIndex[sourceOperandIndex]; in finishStepModel()
844 uint32_t sourceOperandIndex = e.first; in finishStepModel() local
845 return mainModelOperandToOutputIndex[sourceOperandIndex]; in finishStepModel()
854 uint32_t sourceOperandIndex = e.first; in finishStepModel() local
855 return mainModelOperandToOutputIndex[sourceOperandIndex]; in finishStepModel()
926 for (const auto& sourceOperandIndex : operands) { in finish() local
927 const ModelBuilder* sourceModel = sourceModels->getModel(sourceOperandIndex.first); in finish()
928 const Operand& operand = sourceModel->getOperand(sourceOperandIndex.second); in finish()
1014 sourceModels](const SourceOperandIndex& sourceOperandIndex) { in findControlFlowBoundaryConstants() argument
1015 const ModelBuilder* sourceModel = sourceModels->getModel(sourceOperandIndex.first); in findControlFlowBoundaryConstants()
1016 const Operand& operand = sourceModel->getOperand(sourceOperandIndex.second); in findControlFlowBoundaryConstants()
1019 mSourceOperandToBoundaryConstantCopy[sourceOperandIndex] = { in findControlFlowBoundaryConstants()
1024 mSourceOperandToBoundaryConstantCopy[sourceOperandIndex] = { in findControlFlowBoundaryConstants()
1029 mSourceOperandToBoundaryConstantReference[sourceOperandIndex] = { in findControlFlowBoundaryConstants()
1039 for (const auto& sourceOperandIndex : step->outerInputOperands) { in findControlFlowBoundaryConstants() local
1040 handleBoundaryConstants(sourceOperandIndex); in findControlFlowBoundaryConstants()
1043 for (const auto& sourceOperandIndex : step->outerInputOperands) { in findControlFlowBoundaryConstants() local
1044 handleBoundaryConstants(sourceOperandIndex); in findControlFlowBoundaryConstants()
1200 for (const auto& [sourceOperandIndex, location] : sourceOperandToConstantCopy) { in Controller()
1202 mSourceOperandToLocationOfTemporary[sourceOperandIndex].offset, in Controller()
1296 const SourceOperandIndex& sourceOperandIndex, in makeController()
1303 const Operand& sourceOperand = executionBuilder->getSourceOperand(sourceOperandIndex); in makeController()
1313 body->getMemoryPreferenceOfSourceOperand(sourceOperandIndex); in makeController()
1316 auto [_, isNew] = sourceOperandToLocationOfTemporary->emplace(sourceOperandIndex, loc); in makeController()
1318 VLOG(EXECUTION) << "temp: operand " << toString(sourceOperandIndex) in makeController()
1368 for (const auto& sourceOperandIndex : step->outerOutputOperands) { in makeController() local
1369 mapTemporary(sourceOperandIndex, &sourceOperandToLocationOfTemporary); in makeController()
1385 for (const auto& sourceOperandIndex : step->outerOutputOperands) { in makeController() local
1386 mapTemporary(sourceOperandIndex, &sourceOperandToLocationOfTemporary); in makeController()
1391 for (const auto& sourceOperandIndex : step->bodyOutputOperands) { in makeController() local
1392 mapTemporary(sourceOperandIndex, &sourceOperandToLocationOfTemporary, in makeController()
1395 mapTemporary(sourceOperandIndex, &sourceOperandToLocationOfTemporary2, in makeController()
1407 for (const auto& [sourceOperandIndex, location] : body->mSourceOperandToBoundaryConstantCopy) { in makeController()
1408 const auto memoryPreference = body->getMemoryPreferenceOfSourceOperand(sourceOperandIndex); in makeController()
1411 sourceOperandToLocationOfTemporary.emplace(sourceOperandIndex, loc); in makeController()
1412 VLOG(EXECUTION) << "temp (boundary constant): operand " << toString(sourceOperandIndex) in makeController()
1420 SourceOperandIndex sourceOperandIndex, in makeController()
1423 const auto memoryPreference = body->getMemoryPreferenceOfSourceOperand(sourceOperandIndex); in makeController()
1427 dynamicTemporaries.declare(sourceOperandIndex, definingStepIndex, sourceOperand.dimensions, in makeController()
1945 void ExecutionPlan::recordOutputDef(SourceOperandIndex sourceOperandIndex, uint32_t stepIndex) { in recordOutputDef() argument
1947 compound()->mOutputToDefiningExecutionStep.emplace(sourceOperandIndex, stepIndex); in recordOutputDef()
1949 << toString(sourceOperandIndex) << " already defined by step " << it->second; in recordOutputDef()
1952 void ExecutionPlan::recordTemporaryDef(SourceOperandIndex sourceOperandIndex, uint32_t stepIndex) { in recordTemporaryDef() argument
1954 compound()->mTemporaryToDefiningExecutionStep.emplace(sourceOperandIndex, stepIndex); in recordTemporaryDef()
1956 << toString(sourceOperandIndex) << " already defined by step " << it->second; in recordTemporaryDef()
2068 const auto sourceOperandIndex = mPlan->getInputSourceOperand(index); in forEachStepRoleOfInput() local
2069 forEachStepRoleOfSourceOperand(sourceOperandIndex, callback); in forEachStepRoleOfInput()
2075 const auto sourceOperandIndex = mPlan->getOutputSourceOperand(index); in forEachStepRoleOfOutput() local
2076 forEachStepRoleOfSourceOperand(sourceOperandIndex, callback); in forEachStepRoleOfOutput()
2095 const auto sourceOperandIndex = type == IOType::INPUT ? getInputSourceOperand(index) in getMemoryPreference() local
2097 return compound()->getMemoryPreferenceOfSourceOperand(sourceOperandIndex); in getMemoryPreference()
2125 const auto sourceOperandIndex = SourceOperandIndex(sourceModelIndex, entry.first); in forEachDynamicTemporary() local
2126 const auto& sourceOperand = getSourceOperand(sourceOperandIndex); in forEachDynamicTemporary()
2128 fn(sourceOperandIndex, sourceOperand, stepIndex); in forEachDynamicTemporary()