Home
last modified time | relevance | path

Searched refs:operandType (Results 1 – 25 of 35) sorted by relevance

12

/packages/modules/NeuralNetworks/runtime/include/
DNeuralNetworksWrapperExtensions.h52 ANeuralNetworksOperandType operandType; member
57 : operandType(other.operandType), in OperandType()
60 operandType.dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr; in OperandType()
65 operandType = other.operandType;
68 operandType.dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr;
76 operandType = { in dimensions()
118 if (ANeuralNetworksModel_addOperand(mModel, &(type->operandType)) != in addOperand()
DNeuralNetworksWrapper.h127 ANeuralNetworksOperandType operandType; member
132 : operandType(other.operandType), in OperandType()
135 operandType.dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr; in OperandType()
140 operandType = other.operandType;
143 operandType.dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr;
150 operandType = { in dimensions()
163 operandType = { in OperandType()
174 operandType.dimensions = dimensions.size() > 0 ? dimensions.data() : nullptr; in updateDimensions()
305 if (NNAPI_CALL(ANeuralNetworksModel_addOperand(mModel, &(type->operandType))) !=
/packages/modules/NeuralNetworks/runtime/test/
DTestOperandExtraParams.cpp119 ANeuralNetworksOperandType operandType = createOperand(dataType); in testAddingWithSymmPerChannelQuantParams() local
120 EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &operandType), ANEURALNETWORKS_NO_ERROR); in testAddingWithSymmPerChannelQuantParams()
242 ANeuralNetworksOperandType operandType = createOperand(dataType); in TEST_F() local
243 operandType.scale = 1.0f; in TEST_F()
244 EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &operandType), ANEURALNETWORKS_BAD_DATA); in TEST_F()
250 ANeuralNetworksOperandType operandType = createOperand(dataType); in TEST_F() local
251 operandType.zeroPoint = 1; in TEST_F()
252 EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &operandType), ANEURALNETWORKS_BAD_DATA); in TEST_F()
DTestValidateOperations.cpp74 OperandTypeWithExtraParams(const ANeuralNetworksOperandType& operandType) in OperandTypeWithExtraParams()
75 : operandType(operandType), channelQuant(std::nullopt), valueModel(std::nullopt) {} in OperandTypeWithExtraParams()
77 ANeuralNetworksOperandType operandType; member
82 if (operandType.type != that.operandType.type || in operator ==()
83 operandType.scale != that.operandType.scale || in operator ==()
84 operandType.zeroPoint != that.operandType.zeroPoint || in operator ==()
85 operandType.dimensionCount != that.operandType.dimensionCount) { in operator ==()
100 if (operandType.dimensions) { in operator ==()
101 if (!that.operandType.dimensions) { in operator ==()
104 if (!std::equal(operandType.dimensions, in operator ==()
[all …]
DTestUnknownDimensions.cpp264 return &matrixTypeBothOther.operandType; in TestOne()
267 return &matrixTypeFirstOther.operandType; in TestOne()
270 return &matrixTypeSecondOther.operandType; in TestOne()
273 return &matrixTypeIntended.operandType; in TestOne()
278 return &matrixTypeIntended.operandType; in TestOne()
DTestPartitioning.cpp2143 auto TestType = [](V1_3::OperandType operandType) { in TEST_F() argument
2144 if (operandType == V1_3::OperandType::SUBGRAPH) { in TEST_F()
2148 SCOPED_TRACE(toString(operandType)); in TEST_F()
2153 uint32_t opndIn = model.addOperand(static_cast<WrapperType>(operandType)); in TEST_F()
2164 update(&goodCapabilities, operandType, 0.25); in TEST_F()
2185 update(&badCapabilities, operandType, 0.75); in TEST_F()
2439 e.setInput(0, &padTensorValue, &padTensorValueType.operandType); in executeCompilationAndCompareOutput()
2443 e.setInput(1, &paddings, &paddingsType.operandType); in executeCompilationAndCompareOutput()
2454 e.setOutput(index, buffer, elts * sizeof(float), &outputType.operandType); in executeCompilationAndCompareOutput()
3092 V1_3::OperandType operandType = static_cast<V1_3::OperandType>(type); in TEST_F() local
[all …]
DTestValidation.cpp74 ANeuralNetworksOperandType operandType = { in addScalarOperand() local
76 EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &operandType), ANEURALNETWORKS_NO_ERROR); in addScalarOperand()
80 uint32_t addOperand(const ANeuralNetworksOperandType& operandType) { in addOperand() argument
81 EXPECT_EQ(ANeuralNetworksModel_addOperand(mModel, &operandType), ANEURALNETWORKS_NO_ERROR); in addOperand()
90 ANeuralNetworksOperandType operandType = { in addTensorOperand() local
95 return addOperand(operandType); in addTensorOperand()
329 ANeuralNetworksOperandType operandType = { in addScalarOperand() local
331 EXPECT_EQ(ANeuralNetworksModel_addOperand(model, &operandType), ANEURALNETWORKS_NO_ERROR); in addScalarOperand()
336 ANeuralNetworksOperandType operandType = { in addTensorOperand() local
341 EXPECT_EQ(ANeuralNetworksModel_addOperand(model, &operandType), ANEURALNETWORKS_NO_ERROR); in addTensorOperand()
[all …]
DTestNeuralNetworksWrapper.h152 if (ANeuralNetworksModel_addOperand(mModel, &(type->operandType)) != in addOperand()
177 OperandType operandType(Type::MODEL, {}); in addModelOperand()
178 uint32_t operand = addOperand(&operandType); in addModelOperand()
/packages/modules/NeuralNetworks/common/cpu_operations/
DCast.cpp46 #define ANDROID_NN_COPY_CAST(operandType, dataType) \ in copyToTensor() argument
47 case operandType: { \ in copyToTensor()
77 #define ANDROID_NN_COPY_TO_TENSOR(operandType, dataType) \ in eval() argument
78 case operandType: { \ in eval()
DArgMinMax.cpp58 #define NNAPI_IMPL_ARG_MIN_MAX(operandType, dataType) \ in argMinMaxGeneric() argument
59 if (inputShape.type == operandType) { \ in argMinMaxGeneric()
DTile.cpp93 #define ANDROID_NN_IMPL_TILE(operandType, dataType) \ in eval() argument
94 case operandType: { \ in eval()
DMirrorPad.cpp219 #define MIRROR_PAD_CASE(operandType, dataType) \ in eval() argument
220 case OperandType::operandType: { \ in eval()
/packages/modules/NeuralNetworks/common/types/src/
DTypeUtils.cpp120 bool isNonExtensionScalar(OperandType operandType) { in isNonExtensionScalar() argument
121 CHECK(!isExtension(operandType)); in isNonExtensionScalar()
122 switch (operandType) { in isNonExtensionScalar()
147 size_t getNonExtensionSize(OperandType operandType) { in getNonExtensionSize() argument
148 CHECK(!isExtension(operandType)); in getNonExtensionSize()
149 switch (operandType) { in getNonExtensionSize()
176 std::optional<size_t> getNonExtensionSize(OperandType operandType, const Dimensions& dimensions) { in getNonExtensionSize() argument
177 CHECK(!isExtension(operandType)) << "Size of extension operand data is unknown"; in getNonExtensionSize()
178 size_t size = getNonExtensionSize(operandType); in getNonExtensionSize()
179 if (isNonExtensionScalar(operandType)) { in getNonExtensionSize()
[all …]
DTypes.cpp102 OperandType operandType) const { in lookup()
105 const auto it = std::lower_bound(mSorted.begin(), mSorted.end(), operandType, cmp); in lookup()
108 if (it != mSorted.end() && it->type == operandType) { in lookup()
/packages/modules/NeuralNetworks/common/
DLegacyHalUtils.cpp1069 static bool compliantWithV1_0(const V1_2::OperandType& operandType) { in compliantWithV1_0() argument
1070 return validOperandType(static_cast<V1_0::OperandType>(operandType)); in compliantWithV1_0()
1073 static bool compliantWithV1_0(const V1_3::OperandType& operandType) { in compliantWithV1_0() argument
1074 return validOperandType(static_cast<V1_0::OperandType>(operandType)); in compliantWithV1_0()
1077 static bool compliantWithV1_2(const V1_3::OperandType& operandType) { in compliantWithV1_2() argument
1078 return validOperandType(static_cast<V1_2::OperandType>(operandType)); in compliantWithV1_2()
1081 V1_0::OperandType convertToV1_0(const V1_2::OperandType& operandType) { in convertToV1_0() argument
1082 if (!compliantWithV1_0(operandType)) { in convertToV1_0()
1083 LOG(ERROR) << "Upcasting non-compliant operand type " << toString(operandType) in convertToV1_0()
1086 return static_cast<V1_0::OperandType>(operandType); in convertToV1_0()
[all …]
DValidateHal.cpp960 bool validOperandType(V1_0::OperandType operandType) { in validOperandType() argument
961 switch (operandType) { in validOperandType()
976 bool validOperandType(V1_2::OperandType operandType) { in validOperandType() argument
977 switch (operandType) { in validOperandType()
996 return isExtensionOperandType(static_cast<V1_3::OperandType>(operandType)); in validOperandType()
1000 bool validOperandType(V1_3::OperandType operandType) { in validOperandType() argument
1001 switch (operandType) { in validOperandType()
1022 return isExtensionOperandType(operandType); in validOperandType()
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/
DFuzzHarness.cpp40 const auto operandType = static_cast<OperandType>(operand.type); in operandOverflows() local
41 return !getNonExtensionSize(operandType, operand.dimensions).has_value(); in operandOverflows()
/packages/modules/NeuralNetworks/shim_and_sl/
DShimDevice.cpp125 .type = static_cast<OperandType>(info.operandType), in getCapabilities()
384 auto operandType = static_cast<::android::nn::OperandType>(op.operandType.type); in allocate() local
386 type = operandType; in allocate()
421 auto operandType = static_cast<::android::nn::OperandType>(op.operandType.type); in allocate() local
423 type = operandType; in allocate()
DShimPreparedModel.cpp96 ::android::nn::wrapper::OperandType operandType = model.getOperands()[model.getInputs()[i]]; in parseInputs()
99 operandType.updateDimensions(::android::nn::toUnsigned(input.dimensions).value()); in parseInputs()
103 input.location.offset, input.location.length, &operandType.operandType); in parseInputs()
121 ::android::nn::wrapper::OperandType operandType = in parseInputs()
126 operandType.updateDimensions(::android::nn::toUnsigned(output.dimensions).value()); in parseInputs()
130 output.location.offset, output.location.length, &operandType.operandType); in parseInputs()
DShimConverter.cpp82 ::android::nn::wrapper::OperandType operandType( in convertSubgraphFromHAL()
88 operandType.channelQuant = ::android::nn::wrapper::SymmPerChannelQuantParams( in convertSubgraphFromHAL()
105 &operandType.operandType.type); in convertSubgraphFromHAL()
113 uint32_t operandIndex = resultModel.addOperand(&operandType); in convertSubgraphFromHAL()
/packages/modules/NeuralNetworks/runtime/
DModelBuilder.cpp83 OperandType operandType = static_cast<OperandType>(type.type); in addOperand() local
84 if (isExtension(operandType) && !TypeManager::get()->areExtensionsAllowed()) { in addOperand()
89 operandType == OperandType::OEM || operandType == OperandType::TENSOR_OEM_BYTE; in addOperand()
95 if (isExtension(operandType) && in addOperand()
96 !TypeManager::get()->getExtensionOperandTypeInfo(operandType, &info)) { in addOperand()
97 LOG(ERROR) << "Extension operand type " << operandType << " is not registered"; in addOperand()
102 .type = operandType, in addOperand()
124 mHasControlFlow |= (operandType == OperandType::SUBGRAPH); in addOperand()
DTypeManager.cpp257 uint32_t operandType = static_cast<uint32_t>(type); in getExtensionOperandTypeInfo() local
258 uint16_t prefix = operandType >> kExtensionTypeBits; in getExtensionOperandTypeInfo()
259 uint16_t typeWithinExtension = operandType & ((1 << kExtensionTypeBits) - 1); in getExtensionOperandTypeInfo()
/packages/modules/NeuralNetworks/common/types/include/nnapi/
DTypeUtils.h39 bool isNonExtensionScalar(OperandType operandType);
41 size_t getNonExtensionSize(OperandType operandType);
51 std::optional<size_t> getNonExtensionSize(OperandType operandType, const Dimensions& dimensions);
93 std::ostream& operator<<(std::ostream& os, const OperandType& operandType);
/packages/modules/NeuralNetworks/shim_and_sl/include/
DSupportLibraryWrapper.h199 if (mNnApi->getFL5()->ANeuralNetworksModel_addOperand(mModel, &type->operandType) != in addOperand()
228 OperandType operandType(Type::MODEL, {}); in addModelOperand()
229 uint32_t operand = addOperand(&operandType); in addModelOperand()
/packages/modules/NeuralNetworks/extensions/
DREADME.md123 ANeuralNetworksOperandType operandType{
128 CHECK_EQ(ANeuralNetworksModel_addOperand(model, &operandType), ANEURALNETWORKS_NO_ERROR);

12