/aosp12/packages/modules/NeuralNetworks/driver/sample/ |
H A D | SampleDriverFloatXNNPACK.cpp | 75 RunTimeOperandInfo* operands) { in updateForArguments() argument 80 RunTimeOperandInfo& to = operands[operandIndex]; in updateForArguments() 111 const size_t count = subgraph.operands.size(); in initializeRunTimeInfo() 112 std::vector<RunTimeOperandInfo> operands(count); in initializeRunTimeInfo() local 115 RunTimeOperandInfo& to = operands[i]; in initializeRunTimeInfo() 149 return operands; in initializeRunTimeInfo() 227 data = operands[tensors[t]].buffer; in Create() 282 value.data = operands[t].buffer; in Invoke() 1158 if (operands[ins[1]].dimensions[0] != 2) { in VisitMeanNode() 1655 auto status = subgraph->Invoke(operands); in asyncExecuteXNNPACK() [all …]
|
/aosp12/packages/modules/NeuralNetworks/common/operations/ |
H A D | BidirectionalSequenceLSTM.cpp | 82 input_ = GetInput(operation, operands, kInputTensor); in BidirectionalSequenceLSTM() 93 GetInput(operation, operands, kFwRecurrentToForgetWeightsTensor); in BidirectionalSequenceLSTM() 96 GetInput(operation, operands, kFwRecurrentToOutputWeightsTensor); in BidirectionalSequenceLSTM() 107 fw_cell_bias_ = GetInput(operation, operands, kFwCellGateBiasTensor); in BidirectionalSequenceLSTM() 114 fw_cell_state_ = GetInput(operation, operands, kFwInputCellStateTensor); in BidirectionalSequenceLSTM() 139 bw_cell_bias_ = GetInput(operation, operands, kBwCellGateBiasTensor); in BidirectionalSequenceLSTM() 146 bw_cell_state_ = GetInput(operation, operands, kBwInputCellStateTensor); in BidirectionalSequenceLSTM() 148 aux_input_ = GetInput(operation, operands, kAuxInputTensor); in BidirectionalSequenceLSTM() 151 GetInput(operation, operands, kFwAuxInputToForgetWeightsTensor); in BidirectionalSequenceLSTM() 191 fw_output_ = GetOutput(operation, operands, kFwOutputTensor); in BidirectionalSequenceLSTM() [all …]
|
H A D | QuantizedLSTM.cpp | 221 input_ = GetInput(operation, operands, kInputTensor); in QuantizedLSTMCell() 233 inputGateBias_ = GetInput(operation, operands, kInputGateBiasTensor); in QuantizedLSTMCell() 234 forgetGateBias_ = GetInput(operation, operands, kForgetGateBiasTensor); in QuantizedLSTMCell() 235 cellGateBias_ = GetInput(operation, operands, kCellGateBiasTensor); in QuantizedLSTMCell() 236 outputGateBias_ = GetInput(operation, operands, kOutputGateBiasTensor); in QuantizedLSTMCell() 238 prevCellState_ = GetInput(operation, operands, kPrevCellStateTensor); in QuantizedLSTMCell() 239 prevOutput_ = GetInput(operation, operands, kPrevOutputTensor); in QuantizedLSTMCell() 241 cellStateOut_ = GetOutput(operation, operands, kCellStateOutTensor); in QuantizedLSTMCell() 242 output_ = GetOutput(operation, operands, kOutputTensor); in QuantizedLSTMCell() 247 auto input = GetInput(operation, operands, kInputTensor); in prepare() [all …]
|
H A D | SVDF.cpp | 31 SVDF::SVDF(const Operation& operation, RunTimeOperandInfo* operands) { in SVDF() argument 33 input_ = GetInput(operation, operands, kInputTensor); in SVDF() 35 weights_time_ = GetInput(operation, operands, kWeightsTimeTensor); in SVDF() 36 bias_ = GetInput(operation, operands, kBiasTensor); in SVDF() 37 state_in_ = GetInput(operation, operands, kStateInTensor); in SVDF() 39 const auto& rankOperand = *GetInput(operation, operands, kRankParam); in SVDF() 45 state_out_ = GetOutput(operation, operands, kStateOutTensor); in SVDF() 46 output_ = GetOutput(operation, operands, kOutputTensor); in SVDF() 53 const int num_inputs = NumInputsWithValues(operation, operands); in Prepare() 74 GetInput(operation, operands, SVDF::kWeightsFeatureTensor); in Prepare() [all …]
|
H A D | LSHProjection.cpp | 34 input_ = GetInput(operation, operands, kInputTensor); in LSHProjection() 35 weight_ = GetInput(operation, operands, kWeightTensor); in LSHProjection() 36 hash_ = GetInput(operation, operands, kHashTensor); in LSHProjection() 39 getScalarData<int32_t>(*GetInput(operation, operands, kTypeParam))); in LSHProjection() 41 output_ = GetOutput(operation, operands, kOutputTensor); in LSHProjection() 49 NN_RET_CHECK(!IsNullInput(GetInput(operation, operands, requiredInput))) in Prepare() 54 const RunTimeOperandInfo* hash = GetInput(operation, operands, kHashTensor); in Prepare() 59 const RunTimeOperandInfo* input = GetInput(operation, operands, kInputTensor); in Prepare() 62 const auto& typeOperand = operands[operation.inputs[kTypeParam]]; in Prepare() 68 NN_CHECK(NumInputsWithValues(operation, operands) == 3); in Prepare() [all …]
|
H A D | RNN.cpp | 30 RNN::RNN(const Operation& operation, RunTimeOperandInfo* operands) { in RNN() argument 32 input_ = GetInput(operation, operands, kInputTensor); in RNN() 33 weights_ = GetInput(operation, operands, kWeightsTensor); in RNN() 34 recurrent_weights_ = GetInput(operation, operands, kRecurrentWeightsTensor); in RNN() 35 hidden_state_in_ = GetInput(operation, operands, kHiddenStateInTensor); in RNN() 36 bias_ = GetInput(operation, operands, kBiasTensor); in RNN() 41 hidden_state_out_ = GetOutput(operation, operands, kHiddenStateOutTensor); in RNN() 42 output_ = GetOutput(operation, operands, kOutputTensor); in RNN() 49 const int num_inputs = NumInputsWithValues(operation, operands); in Prepare() 56 GetInput(operation, operands, kRecurrentWeightsTensor); in Prepare() [all …]
|
H A D | Multinomial.cpp | 56 Multinomial::Multinomial(const Operation& operation, RunTimeOperandInfo* operands) { in Multinomial() argument 58 input_ = GetInput(operation, operands, kInputTensor); in Multinomial() 59 sample_count_ = getScalarData<int>(*GetInput(operation, operands, kSampleCountParam)); in Multinomial() 60 random_seeds_ = GetInput(operation, operands, kRandomSeedsTensor); in Multinomial() 62 output_ = GetOutput(operation, operands, kOutputTensor); in Multinomial() 65 bool Multinomial::Prepare(const Operation& operation, RunTimeOperandInfo* operands, in Prepare() argument 68 NN_CHECK_EQ(NumInputsWithValues(operation, operands), 3); in Prepare() 71 const RunTimeOperandInfo* input = GetInput(operation, operands, Multinomial::kInputTensor); in Prepare() 76 getScalarData<int>(*GetInput(operation, operands, kSampleCountParam)); in Prepare()
|
H A D | HashtableLookup.cpp | 36 HashtableLookup::HashtableLookup(const Operation& operation, RunTimeOperandInfo* operands) { in HashtableLookup() argument 37 lookup_ = GetInput(operation, operands, kLookupTensor); in HashtableLookup() 38 key_ = GetInput(operation, operands, kKeyTensor); in HashtableLookup() 39 value_ = GetInput(operation, operands, kValueTensor); in HashtableLookup() 41 output_ = GetOutput(operation, operands, kOutputTensor); in HashtableLookup() 42 hits_ = GetOutput(operation, operands, kHitsTensor); in HashtableLookup()
|
H A D | LSTM.cpp | 54 LSTMCell::LSTMCell(const Operation& operation, RunTimeOperandInfo* operands) { in LSTMCell() argument 55 input_ = GetInput(operation, operands, kInputTensor); in LSTMCell() 75 input_gate_bias_ = GetInput(operation, operands, kInputGateBiasTensor); in LSTMCell() 77 cell_bias_ = GetInput(operation, operands, kCellGateBiasTensor); in LSTMCell() 83 output_state_in_ = GetInput(operation, operands, kOutputStateInTensor); in LSTMCell() 84 cell_state_in_ = GetInput(operation, operands, kCellStateInTensor); in LSTMCell() 125 cell_state_out_ = GetOutput(operation, operands, kCellStateOutTensor); in LSTMCell() 126 output_ = GetOutput(operation, operands, kOutputTensor); in LSTMCell() 128 scratch_buffer_ = GetOutput(operation, operands, kScratchBufferTensor); in LSTMCell() 307 NN_CHECK(NumInputsWithValues(operation, operands) >= 15 && in Prepare() [all …]
|
/aosp12/packages/modules/NeuralNetworks/common/ |
H A D | CpuExecutor.cpp | 70 : operation(operation), operands(operands) {} in OperationExecutionContext() 102 RunTimeOperandInfo* operands; member in android::nn::__anon6fdaa8540110::OperationExecutionContext 109 return &operands[operation->inputs[index]]; in getInputInfo() 114 return &operands[operation->outputs[index]]; in getOutputInfo() 530 auto& info = operands[i]; in consumeOperationInputs() 547 for (auto& info : *operands) { in freeUnusedSubgraphOperands() 575 operands.data()); in run() 577 freeUnusedSubgraphOperands(&operands); in run() 663 return operands; in initializeRunTimeInfo() 1089 SVDF svdf(operation, operands); in executeOperation() [all …]
|
H A D | AidlValidateHal.cpp | 49 std::vector<aidl_hal::Operand> operands; in validateMemoryDesc() local 50 operands.reserve(inputRoles.size() + outputRoles.size()); in validateMemoryDesc() 63 operands.push_back(model->main.operands[inputIndexes[role.ioIndex]]); in validateMemoryDesc() 77 operands.push_back(model->main.operands[outputIndexes[role.ioIndex]]); in validateMemoryDesc() 80 CHECK(!operands.empty()); in validateMemoryDesc() 81 const auto opType = operands[0].type; in validateMemoryDesc() 90 for (const auto& operand : operands) { in validateMemoryDesc() 91 NN_RET_CHECK(operand.type == operands[0].type) in validateMemoryDesc() 93 NN_RET_CHECK_EQ(operand.scale, operands[0].scale); in validateMemoryDesc() 98 const auto& rhsExtraParams = operands[0].extraParams; in validateMemoryDesc() [all …]
|
H A D | ValidateHal.cpp | 174 for (auto& versionedOperand : operands) { in validateOperands() 558 const size_t operandCount = operands.size(); in validateModelInputOutputs() 582 if (operands[i].lifetime == lifetime && in validateModelInputOutputs() 604 const auto& operand = model.operands[i]; in validateGraph() 880 std::vector<V1_3::Operand> operands; in validateMemoryDesc() local 894 operands.push_back(model->main.operands[inputIndexes[role.ioIndex]]); in validateMemoryDesc() 908 operands.push_back(model->main.operands[outputIndexes[role.ioIndex]]); in validateMemoryDesc() 911 CHECK(!operands.empty()); in validateMemoryDesc() 912 const auto opType = operands[0].type; in validateMemoryDesc() 916 for (const auto& operand : operands) { in validateMemoryDesc() [all …]
|
H A D | LegacyUtils.cpp | 189 operands(operands) {} in OperationValidationContext() 211 const Operand* operands; member in android::nn::__anon648133630110::OperationValidationContext 220 return &operands[inputIndexes[index]]; in getInputOperand() 225 return &operands[outputIndexes[index]]; in getOutputOperand() 770 auto inputType = operands[inputIndexes[0]].type; in validateOperation() 810 auto inputType = operands[inputIndexes[0]].type; in validateOperation() 850 auto inputType = operands[inputIndexes[0]].type; in validateOperation() 888 auto inputType = operands[inputIndexes[1]].type; in validateOperation() 946 auto hashType = operands[inputIndexes[0]].type; in validateOperation() 1389 auto inputOperand = operands[inputIndexes[0]]; in validateOperation() [all …]
|
H A D | Validation.cpp | 698 versions.reserve(operands.size()); in validateOperands() 814 std::transform(subgraph.operands.begin(), subgraph.operands.end(), in validateExecutionOrder() 878 NN_VALIDATE(!subgraph.operands.empty()); in validateModelSubgraph() 1276 std::vector<nn::Operand> operands; in validateMemoryDescImpl() local 1290 operands.push_back(model->main.operands[inputIndexes[role.ioIndex]]); in validateMemoryDescImpl() 1304 operands.push_back(model->main.operands[outputIndexes[role.ioIndex]]); in validateMemoryDescImpl() 1307 CHECK(!operands.empty()); in validateMemoryDescImpl() 1311 for (const auto& operand : operands) { in validateMemoryDescImpl() 1333 *combinedOperand = operands.front(); in validateMemoryDescImpl() 1349 operands(operands) {} in OperationValidationContext() [all …]
|
H A D | LegacyHalUtils.cpp | 1271 return {.operands = model.operands, in convertToV1_0() 1284 return {.operands = convertToV1_0(model.operands), in convertToV1_0() 1297 return {.operands = convertToV1_0(model.main.operands), in convertToV1_0() 1306 return {.operands = model.operands, in convertToV1_1() 1339 .operands = convertToV1_0(model.main.operands), in convertToV1_1() 1349 return {.operands = convertToV1_2(model.operands), in convertToV1_2() 1359 return {.operands = convertToV1_2(model.operands), in convertToV1_2() 1377 return {.operands = convertToV1_2(model.main.operands), in convertToV1_2() 1388 return {.main = {.operands = convertToV1_3(model.operands), in convertToV1_3() 1398 return {.main = {.operands = convertToV1_3(model.operands), in convertToV1_3() [all …]
|
/aosp12/packages/modules/NeuralNetworks/common/include/ |
H A D | CpuExecutor.h | 169 RunTimeOperandInfo* operands); 171 int executeSubgraph(const Model::Subgraph& subgraph, RunTimeOperandInfo* operands); 173 int executeOperation(const Operation& operation, RunTimeOperandInfo* operands); 174 int executeIfOperation(const Operation& operation, RunTimeOperandInfo* operands); 175 int executeWhileOperation(const Operation& operation, RunTimeOperandInfo* operands); 178 const std::vector<RunTimeOperandInfo>& operands); 268 [&operands](uint32_t i) { return !IsNullInput(&operands[i]); }); in NumInputsWithValues() 283 inline RunTimeOperandInfo* GetInput(const Operation& operation, RunTimeOperandInfo* operands, in GetInput() argument 285 return &operands[operation.inputs[index]]; in GetInput() 288 inline RunTimeOperandInfo* GetOutput(const Operation& operation, RunTimeOperandInfo* operands, in GetOutput() argument [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/1.0/vts/functional/ |
H A D | ValidateModel.cpp | 76 return hidl_vec_push_back(&model->operands, in addOperand() 90 model->operands[index].numberOfConsumers = 1; in addOperand() 91 model->operands[index].lifetime = lifetime; in addOperand() 219 size += sizeForBinder(model.operands); in sizeForBinder() 281 if (model.operands[output].numberOfConsumers > 0) { in mutateExecutionOrderTest() 374 model->operands[operand].scale = invalidScale; in mutateOperandScaleTest() 740 const uint32_t invalidOperand = model.operands.size(); in mutateOperationInputOperandIndexTest() 756 const uint32_t invalidOperand = model.operands.size(); in mutateOperationOutputOperandIndexTest() 810 hidl_vec_removeAt(&model->operands, index); in removeOperand() 831 model->operands[operand].numberOfConsumers--; in removeOperation() [all …]
|
H A D | GeneratedTestHarness.cpp | 46 hidl_vec<Operand> operands(testModel.main.operands.size()); in createModel() local 48 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 49 const auto& op = testModel.main.operands[i]; in createModel() 64 operands[i] = {.type = static_cast<OperandType>(op.type), in createModel() 84 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 85 const auto& op = testModel.main.operands[i]; in createModel() 89 std::copy(begin, end, operandValues.data() + operands[i].location.offset); in createModel() 106 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 107 const auto& op = testModel.main.operands[i]; in createModel() 111 std::copy(begin, end, mappedPtr + operands[i].location.offset); in createModel() [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/1.1/vts/functional/ |
H A D | ValidateModel.cpp | 95 return hidl_vec_push_back(&model->operands, in addOperand() 109 model->operands[index].numberOfConsumers = 1; in addOperand() 110 model->operands[index].lifetime = lifetime; in addOperand() 238 size += sizeForBinder(model.operands); in sizeForBinder() 301 if (model.operands[output].numberOfConsumers > 0) { in mutateExecutionOrderTest() 337 model->operands[operand].type = in mutateOperandTypeTest() 398 model->operands[operand].scale = invalidScale; in mutateOperandScaleTest() 774 const uint32_t invalidOperand = model.operands.size(); in mutateOperationInputOperandIndexTest() 791 const uint32_t invalidOperand = model.operands.size(); in mutateOperationOutputOperandIndexTest() 850 hidl_vec_removeAt(&model->operands, index); in removeOperand() [all …]
|
H A D | GeneratedTestHarness.cpp | 53 hidl_vec<Operand> operands(testModel.main.operands.size()); in createModel() local 55 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 56 const auto& op = testModel.main.operands[i]; in createModel() 71 operands[i] = {.type = static_cast<OperandType>(op.type), in createModel() 91 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 92 const auto& op = testModel.main.operands[i]; in createModel() 96 std::copy(begin, end, operandValues.data() + operands[i].location.offset); in createModel() 113 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in createModel() 114 const auto& op = testModel.main.operands[i]; in createModel() 118 std::copy(begin, end, mappedPtr + operands[i].location.offset); in createModel() [all …]
|
/aosp12/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/ |
H A D | Converter.cpp | 98 std::vector<TestOperand> convert(const android_nn_fuzz::Operands& operands) { in convert() argument 100 testOperands.reserve(operands.operand_size()); in convert() 101 const auto& repeatedOperand = operands.operand(); in convert() 130 std::vector<TestOperand>* operands) { in calculateNumberOfConsumers() argument 131 CHECK(operands != nullptr); in calculateNumberOfConsumers() 132 const auto addConsumer = [operands](uint32_t operand) { in calculateNumberOfConsumers() 133 if (operand < operands->size()) { in calculateNumberOfConsumers() 134 operands->at(operand).numberOfConsumers++; in calculateNumberOfConsumers() 144 std::vector<TestOperand> operands = convert(model.operands()); in convert() local 151 calculateNumberOfConsumers(operations, &operands); in convert() [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/1.1/utils/src/ |
H A D | Conversions.cpp | 103 NN_TRY(hal::utils::countNumberOfConsumers(model.operands.size(), operations)); in unvalidatedConvert() 104 CHECK(model.operands.size() == numberOfConsumers.size()); in unvalidatedConvert() 105 for (size_t i = 0; i < model.operands.size(); ++i) { in unvalidatedConvert() 106 if (model.operands[i].numberOfConsumers != numberOfConsumers[i]) { in unvalidatedConvert() 114 .operands = NN_TRY(unvalidatedConvert(model.operands)), in unvalidatedConvert() 222 auto operands = NN_TRY(unvalidatedConvert(model.main.operands)); in unvalidatedConvert() local 226 NN_TRY(hal::utils::countNumberOfConsumers(operands.size(), model.main.operations)); in unvalidatedConvert() 227 CHECK(operands.size() == numberOfConsumers.size()); in unvalidatedConvert() 228 for (size_t i = 0; i < operands.size(); ++i) { in unvalidatedConvert() 229 operands[i].numberOfConsumers = numberOfConsumers[i]; in unvalidatedConvert() [all …]
|
/aosp12/art/runtime/ |
H A D | method_handles.cc | 320 size_t src_reg = operands->GetOperand(i); in CopyArgumentsFromCallerFrame() 341 const InstructionOperands* const operands, in ConvertAndCopyArgumentsFromCallerFrame() argument 469 operands, in MethodHandleInvokeMethod() 734 uint32_t receiver_reg = (operands->GetNumberOfOperands() > 0) ? operands->GetOperand(0) : 0u; in DoInvokePolymorphicMethod() 774 operands, in DoInvokePolymorphicMethod() 994 DCHECK_EQ(operands->GetNumberOfOperands(), in DoVarHandleInvokeTranslationUnchecked() 1117 operands, in MethodHandleInvokeInternal() 1133 operands, in MethodHandleInvokeInternal() 1142 const InstructionOperands* const operands, in MethodHandleInvokeExactInternal() argument 1184 uint32_t receiver_reg = (operands->GetNumberOfOperands() > 0) ? operands->GetOperand(0) : 0u; in MethodHandleInvokeExactInternal() [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/1.2/vts/functional/ |
H A D | ValidateModel.cpp | 96 return hidl_vec_push_back(&model->operands, in addOperand() 110 model->operands[index].numberOfConsumers = 1; in addOperand() 111 model->operands[index].lifetime = lifetime; in addOperand() 276 size += sizeForBinder(model.operands); in sizeForBinder() 340 if (model.operands[output].numberOfConsumers > 0) { in mutateExecutionOrderTest() 376 model->operands[operand].type = in mutateOperandTypeTest() 456 model->operands[operand].scale = invalidScale; in mutateOperandScaleTest() 915 const uint32_t invalidOperand = model.operands.size(); in mutateOperationInputOperandIndexTest() 932 const uint32_t invalidOperand = model.operands.size(); in mutateOperationOutputOperandIndexTest() 991 hidl_vec_removeAt(&model->operands, index); in removeOperand() [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/1.3/vts/functional/ |
H A D | ValidateModel.cpp | 103 return hidl_vec_push_back(&model->main.operands, in addOperand() 117 model->main.operands[index].numberOfConsumers = 1; in addOperand() 118 model->main.operands[index].lifetime = lifetime; in addOperand() 273 size += sizeForBinder(subgraph.operands); in sizeForBinder() 358 if (model.main.operands[output].numberOfConsumers > 0) { in mutateExecutionOrderTest() 395 model->main.operands[operand].type = in mutateOperandTypeTest() 437 model->main.operands[operand].dimensions = in mutateOperandRankTest() 980 const uint32_t invalidOperand = model.main.operands.size(); in mutateOperationInputOperandIndexTest() 1059 hidl_vec_removeAt(&model->main.operands, index); in removeOperand() 1069 const Operand& operand = model.main.operands[operandIndex]; in removeOperandSkip() [all …]
|