/packages/modules/NeuralNetworks/shim_and_sl/ |
D | ShimConverter.cpp | 62 const auto& subgraph = subgraphIndex == 0 ? model.main : model.referenced[subgraphIndex - 1]; in convertSubgraphFromHAL() local 76 for (int i = 0; i < subgraph.operands.size(); ++i) { in convertSubgraphFromHAL() 77 const auto& operand = subgraph.operands[i]; in convertSubgraphFromHAL() 168 auto subgraph = convertSubgraphFromHAL(nnapi, memoryPools, model, allModels, in convertSubgraphFromHAL() local 171 if (subgraph) { in convertSubgraphFromHAL() 172 resultModel.setOperandValueFromModel(i, subgraph); in convertSubgraphFromHAL() 202 for (int i = 0; i < subgraph.operations.size(); ++i) { in convertSubgraphFromHAL() 203 const auto& operation = subgraph.operations[i]; in convertSubgraphFromHAL() 238 std::vector<uint32_t> inputIndexes(subgraph.inputIndexes.begin(), subgraph.inputIndexes.end()); in convertSubgraphFromHAL() 239 std::vector<uint32_t> outputIndexes(subgraph.outputIndexes.begin(), in convertSubgraphFromHAL() [all …]
|
/packages/modules/NeuralNetworks/runtime/ |
D | ModelArchHasher.cpp | 33 bool updateSubgraph(SHA256_CTX* hasher, const Model::Subgraph& subgraph) { in updateSubgraph() argument 35 for (auto& operand : subgraph.operands) { in updateSubgraph() 49 for (auto& operation : subgraph.operations) { in updateSubgraph() 60 hasher, static_cast<const void*>(subgraph.inputIndexes.data()), in updateSubgraph() 61 sizeof(decltype(subgraph.inputIndexes)::value_type) * subgraph.inputIndexes.size()); in updateSubgraph() 63 hasher, static_cast<const void*>(subgraph.outputIndexes.data()), in updateSubgraph() 64 sizeof(decltype(subgraph.outputIndexes)::value_type) * subgraph.outputIndexes.size()); in updateSubgraph() 78 for (auto& subgraph : model.referenced) { in calcModelArchHash() local 79 success &= updateSubgraph(&mHasher, subgraph); in calcModelArchHash()
|
D | FlatbufferModelBuilder.cpp | 84 const Model::Subgraph& subgraph) { in createSubGraphFlatbuffer() argument 86 NN_TRY(checkAllTensorOperandsHaveSpecifiedRank(subgraph.operands)); in createSubGraphFlatbuffer() 88 NN_TRY(checkNoSubgraphOutputOperandsHaveDynamicShape(subgraph.operands)); in createSubGraphFlatbuffer() 90 SubGraphContext context(&mModel, &subgraph, &mBuilder, &mOpCodesVector, in createSubGraphFlatbuffer() 92 for (const Operation& operation : subgraph.operations) { in createSubGraphFlatbuffer() 101 for (uint32_t idx : subgraph.inputIndexes) { in createSubGraphFlatbuffer() 104 for (uint32_t idx : subgraph.outputIndexes) { in createSubGraphFlatbuffer()
|
D | ModelBuilder.cpp | 906 void updateOperandLocations(const ModelBuilder* refModel, Model::Subgraph* subgraph); 951 Model::Subgraph subgraph; in makeSubgraph() local 952 subgraph.operands = model->mOperands; in makeSubgraph() 953 subgraph.operations = model->mOperations; in makeSubgraph() 954 subgraph.inputIndexes = model->mInputIndexes; in makeSubgraph() 955 subgraph.outputIndexes = model->mOutputIndexes; in makeSubgraph() 956 return subgraph; in makeSubgraph() 960 Model::Subgraph* subgraph) { in updateOperandLocations() argument 961 for (Operand& operand : subgraph->operands) { in updateOperandLocations() 973 for (Operand& operand : subgraph->operands) { in updateOperandLocations()
|
/packages/modules/NeuralNetworks/driver/sample_hidl/ |
D | SampleDriverFloatXNNPACK.cpp | 109 const V1_3::Subgraph& subgraph, const std::vector<RunTimePoolInfo>& modelPoolInfos, in initializeRunTimeInfo() argument 111 const size_t count = subgraph.operands.size(); in initializeRunTimeInfo() 114 const V1_3::Operand& from = subgraph.operands[i]; in initializeRunTimeInfo() 175 std::unique_ptr<xnn_subgraph, decltype(&xnn_delete_subgraph)> subgraph( in Create() local 245 subgraph.get(), xnn_datatype_fp32, dims.size(), dims.data(), data, in Create() 255 if (VisitNode(subgraph.get(), operation, operands.data(), xnnpackTensors) != in Create() 263 status = xnn_create_runtime_v2(subgraph.get(), threadpool, /*flags=*/0, &runtimePtr); in Create() 496 static V1_3::ErrorStatus VisitNode(xnn_subgraph_t subgraph, const V1_3::Operation& operation, in VisitNode() argument 501 return VisitAbsNode(subgraph, operation, operands, xnnpackTensors); in VisitNode() 503 return VisitAddNode(subgraph, operation, operands, xnnpackTensors); in VisitNode() [all …]
|
/packages/modules/NeuralNetworks/runtime/operation_converters/ |
D | DepthwiseConv2DOperationConverter.cpp | 29 const Model::Subgraph* subgraph = context->getSubgraph(); in convert() local 38 subgraph->operands[operation.inputs[8]].type == OperandType::BOOL); in convert() 53 const Operand& paddingTypeOperand = subgraph->operands[operation.inputs[3]]; in convert() 65 subgraph->operands[operation.inputs[baseOptionsIdx + kStrideWOffset]]; in convert() 67 subgraph->operands[operation.inputs[baseOptionsIdx + kStrideHOffset]]; in convert() 69 subgraph->operands[operation.inputs[baseOptionsIdx + kActivationOffset]]; in convert() 71 subgraph->operands[operation.inputs[baseOptionsIdx + kDepthwiseMultiplier]]; in convert() 87 const Operand& isNchwOperand = subgraph->operands[operation.inputs[isNchwIdx]]; in convert() 101 const Operand& dilationWOperand = subgraph->operands[operation.inputs[dilationWIdx]]; in convert() 107 const Operand& dilationHOperand = subgraph->operands[operation.inputs[dilationHIdx]]; in convert()
|
D | Conv2DOperationConverter.cpp | 54 const Model::Subgraph* subgraph = context->getSubgraph(); in decomposeExplicitPadding() local 55 const Operand& inputOperand = subgraph->operands[operation.inputs[0]]; in decomposeExplicitPadding() 64 const Operand& frontWidthPaddingOperand = subgraph->operands[operation.inputs[3]]; in decomposeExplicitPadding() 65 const Operand& backWidthPaddingOperand = subgraph->operands[operation.inputs[4]]; in decomposeExplicitPadding() 66 const Operand& frontHeightPaddingOperand = subgraph->operands[operation.inputs[5]]; in decomposeExplicitPadding() 67 const Operand& backHeightPaddingOperand = subgraph->operands[operation.inputs[6]]; in decomposeExplicitPadding() 145 const Model::Subgraph* subgraph = context->getSubgraph(); in convert() local 154 subgraph->operands[operation.inputs[7]].type == OperandType::BOOL) { in convert() 171 const Operand& paddingTypeOperand = subgraph->operands[operation.inputs[3]]; in convert() 183 subgraph->operands[operation.inputs[baseOptionsIdx + kStrideWOffset]]; in convert() [all …]
|
D | SubGraphContext.cpp | 28 SubGraphContext::SubGraphContext(const Model* model, const Model::Subgraph* subgraph, in SubGraphContext() argument 34 mSubgraph(subgraph), in SubGraphContext() 40 CHECK(subgraph != nullptr); in SubGraphContext() 45 mOperandToTensorIdx.resize(subgraph->operands.size(), -1); in SubGraphContext()
|
D | AddOperationConverter.cpp | 29 const Model::Subgraph* subgraph = context->getSubgraph(); in convert() local 41 subgraph->operands[operation.inputs[baseOptionsIdx + kActivationOffset]]; in convert()
|
/packages/modules/NeuralNetworks/common/ |
D | ModelUtils.cpp | 144 void identifyUsedPools(const Model::Subgraph& subgraph, std::vector<bool>* used) { in identifyUsedPools() argument 146 for (const auto& operand : subgraph.operands) { in identifyUsedPools() 158 for (const auto& subgraph : model.referenced) { in identifyUsedPools() local 159 identifyUsedPools(subgraph, &used); in identifyUsedPools() 220 for (auto& subgraph : model->referenced) { in fixOperandDataLocations() local 221 fixOperandDataLocations(&subgraph.operands, &model->operandValues, operandValues, in fixOperandDataLocations() 237 const auto collectPrefixes = [collectPrefix](const Model::Subgraph& subgraph) { in identifyUsedExtensions() argument 238 std::for_each(subgraph.operands.begin(), subgraph.operands.end(), collectPrefix); in identifyUsedExtensions() 239 std::for_each(subgraph.operations.begin(), subgraph.operations.end(), collectPrefix); in identifyUsedExtensions() 243 for (const auto& subgraph : model.referenced) { in identifyUsedExtensions() local [all …]
|
D | ValidateHal.cpp | 476 const Model::Subgraph& subgraph = *getSubgraph(modelOperand); in validateOperations() local 477 CHECK_LT(subgraph.inputIndexes[index], subgraph.operands.size()); in validateOperations() 478 return &subgraph.operands[subgraph.inputIndexes[index]]; in validateOperations() 482 const Model::Subgraph& subgraph = *getSubgraph(modelOperand); in validateOperations() local 483 CHECK_LT(subgraph.outputIndexes[index], subgraph.operands.size()); in validateOperations() 484 return &subgraph.operands[subgraph.outputIndexes[index]]; in validateOperations() 675 static bool checkNoReferenceCycles(const V1_3::Model& model, const V1_3::Subgraph& subgraph, in checkNoReferenceCycles() argument 677 auto [_, isNew] = path->insert(&subgraph); in checkNoReferenceCycles() 682 for (const V1_3::Operand& operand : subgraph.operands) { in checkNoReferenceCycles() 690 path->erase(&subgraph); in checkNoReferenceCycles() [all …]
|
/packages/modules/NeuralNetworks/tools/test_generator/test_harness/include/ |
D | TestHarness.h | 346 for (const TestSubgraph& subgraph : referenced) { in forEachSubgraph() local 347 handler(subgraph); in forEachSubgraph() 353 for (TestSubgraph& subgraph : referenced) { in forEachSubgraph() 354 handler(subgraph); in forEachSubgraph() 361 newTestModel.forEachSubgraph([](TestSubgraph& subgraph) { in copy() 362 for (TestOperand& operand : subgraph.operands) { in copy() 373 forEachSubgraph([&result](const TestSubgraph& subgraph) { in hasQuant8CoupledOperands() 377 for (const TestOperation& operation : subgraph.operations) { in hasQuant8CoupledOperands() 402 if (subgraph.operands[operandIndex].type == in hasQuant8CoupledOperands() 409 if (subgraph.operands[operandIndex].type == in hasQuant8CoupledOperands() [all …]
|
/packages/modules/NeuralNetworks/tools/test_generator/ |
D | example_generator.py | 131 def GetSubgraphStruct(subgraph): argument 134 COMMENT_KEY: subgraph.name, 135 "operands": [GetOperandStruct(op) for op in subgraph.operands], 136 "operations": [GetOperationStruct(op) for op in subgraph.operations], 137 "inputIndexes": [op.model_index for op in subgraph.GetInputs()], 138 "outputIndexes": [op.model_index for op in subgraph.GetOutputs()],
|
/packages/modules/NeuralNetworks/common/types/src/ |
D | SharedMemory.cpp | 36 bool hasNoPointerData(const Model::Subgraph& subgraph); 53 bool hasNoPointerData(const Model::Subgraph& subgraph) { in hasNoPointerData() argument 54 return hasNoPointerData(subgraph.operands); in hasNoPointerData() 76 void copyPointersToSharedMemory(Model::Subgraph* subgraph, ConstantMemoryBuilder* memoryBuilder) { in copyPointersToSharedMemory() argument 77 CHECK(subgraph != nullptr); in copyPointersToSharedMemory() 78 std::for_each(subgraph->operands.begin(), subgraph->operands.end(), in copyPointersToSharedMemory() 165 [&memoryBuilder](auto& subgraph) { in flushDataFromPointerToShared() argument 166 copyPointersToSharedMemory(&subgraph, &memoryBuilder); in flushDataFromPointerToShared()
|
D | Validation.cpp | 348 Result<Version> validateModelSubgraph(const Model::Subgraph& subgraph, 782 Result<void> validateExecutionOrder(const Model::Subgraph& subgraph) { in validateExecutionOrder() argument 786 operandValueKnown.reserve(subgraph.operands.size()); in validateExecutionOrder() 787 std::transform(subgraph.operands.begin(), subgraph.operands.end(), in validateExecutionOrder() 798 for (size_t i = 0; i < subgraph.operations.size(); ++i) { in validateExecutionOrder() 799 const auto& operation = subgraph.operations[i]; in validateExecutionOrder() 821 for (size_t i = 0; i < subgraph.operands.size(); ++i) { in validateExecutionOrder() 837 Result<Version> validateModelSubgraph(const Model::Subgraph& subgraph, in validateModelSubgraph() argument 853 NN_RET_CHECK(!subgraph.operands.empty()); in validateModelSubgraph() 854 NN_RET_CHECK(!subgraph.operations.empty()); in validateModelSubgraph() [all …]
|
/packages/modules/NeuralNetworks/runtime/test/ |
D | GeneratedTestUtils.cpp | 116 auto processSubgraph = [&size](const TestSubgraph& subgraph) { argument 117 for (const TestOperand& operand : subgraph.operands) { 125 for (const TestSubgraph& subgraph : testModel.referenced) { local 126 processSubgraph(subgraph); 135 static void createModelFromSubgraph(const TestSubgraph& subgraph, bool testDynamicOutputShape, argument 140 for (const auto& operand : subgraph.operands) { 180 for (const auto& operation : subgraph.operations) { 185 model->identifyInputsAndOutputs(subgraph.inputIndexes, subgraph.outputIndexes);
|
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/ |
D | Converter.cpp | 155 TestSubgraph convert(const Subgraph& subgraph) { in convert() argument 156 std::vector<TestOperand> operands = convert(subgraph.operands()); in convert() 157 std::vector<TestOperation> operations = convert(subgraph.operations()); in convert() 158 std::vector<uint32_t> inputIndexes = convert(subgraph.input_indexes()); in convert() 159 std::vector<uint32_t> outputIndexes = convert(subgraph.output_indexes()); in convert() 173 const auto& repeatedSubgraph = subgraphs.subgraph(); in convert() 176 [](const auto& subgraph) { return convert(subgraph); }); in convert() argument
|
D | GenerateCorpus.cpp | 138 Subgraph convert(const TestSubgraph& subgraph) { in convert() argument 140 *protoSubgraph.mutable_operands() = convert(subgraph.operands); in convert() 141 *protoSubgraph.mutable_operations() = convert(subgraph.operations); in convert() 142 *protoSubgraph.mutable_input_indexes() = convertIndexes(subgraph.inputIndexes); in convert() 143 *protoSubgraph.mutable_output_indexes() = convertIndexes(subgraph.outputIndexes); in convert() 149 for (const auto& subgraph : subgraphs) { in convert() local 150 *protoSubgraphs.add_subgraph() = convert(subgraph); in convert()
|
D | FuzzHarness.cpp | 44 bool hasOperandThatOverflows(const TestSubgraph& subgraph) { in hasOperandThatOverflows() argument 45 return std::any_of(subgraph.operands.begin(), subgraph.operands.end(), operandOverflows); in hasOperandThatOverflows()
|
D | FuzzTest.cpp | 67 const auto& subgraph = index == 0 ? testModel.main : testModel.referenced[index - 1]; in areSubgraphsAcyclic() local 68 for (const auto& operand : subgraph.operands) { in areSubgraphsAcyclic() 149 auto subgraph = CreateSubgraph(testModel, index, subgraphs); in CreateModels() local 150 if (!subgraph.has_value()) return std::nullopt; in CreateModels() 151 subgraphs[index] = std::move(subgraph).value(); in CreateModels()
|
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/corpus/ |
D | seed196 | 129 subgraph { 226 subgraph { 457 subgraph { 554 subgraph {
|
D | seed160 | 180 subgraph { 277 subgraph { 508 subgraph { 605 subgraph {
|
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/corpus_additional/ |
D | seed321 | 135 subgraph { 236 subgraph { 531 subgraph { 632 subgraph {
|
D | seed452 | 135 subgraph { 236 subgraph { 531 subgraph { 632 subgraph {
|
D | seed471 | 98 subgraph { 177 subgraph {
|