/packages/modules/NeuralNetworks/runtime/test/fuzzing/operation_signatures/ |
D | Convolutions.cpp | 26 RandomOperation* op) { in conv2DExplicitConstructor() argument 30 int32_t paddingLeft = op->inputs[3]->value<int32_t>(); in conv2DExplicitConstructor() 31 int32_t paddingRight = op->inputs[4]->value<int32_t>(); in conv2DExplicitConstructor() 32 int32_t paddingTop = op->inputs[5]->value<int32_t>(); in conv2DExplicitConstructor() 33 int32_t paddingBottom = op->inputs[6]->value<int32_t>(); in conv2DExplicitConstructor() 34 int32_t strideWidth = op->inputs[7]->value<int32_t>(); in conv2DExplicitConstructor() 35 int32_t strideHeight = op->inputs[8]->value<int32_t>(); in conv2DExplicitConstructor() 38 if (op->inputs.size() > 10) { in conv2DExplicitConstructor() 39 useNchw = op->inputs[10]->value<bool8>(); in conv2DExplicitConstructor() 40 if (op->inputs.size() > 11) { in conv2DExplicitConstructor() [all …]
|
D | Reshape.cpp | 26 static void spaceToDepthConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in spaceToDepthConstructor() argument 30 if (op->inputs.size() > 2) useNchw = op->inputs[2]->value<bool8>(); in spaceToDepthConstructor() 35 op->inputs[0]->dimensions = {RandomVariableType::FREE, RandomVariableType::FREE, in spaceToDepthConstructor() 37 int32_t blockSize = op->inputs[1]->value<int32_t>(); in spaceToDepthConstructor() 38 auto outHeight = op->inputs[0]->dimensions[heightIndex].exactDiv(blockSize); in spaceToDepthConstructor() 39 auto outWidth = op->inputs[0]->dimensions[widthIndex].exactDiv(blockSize); in spaceToDepthConstructor() 40 auto outDepth = op->inputs[0]->dimensions[depthIndex] * (blockSize * blockSize); in spaceToDepthConstructor() 43 op->outputs[0]->dimensions = {op->inputs[0]->dimensions[0], outDepth, outHeight, outWidth}; in spaceToDepthConstructor() 45 op->outputs[0]->dimensions = {op->inputs[0]->dimensions[0], outHeight, outWidth, outDepth}; in spaceToDepthConstructor() 47 setSameQuantization(op->outputs[0], op->inputs[0]); in spaceToDepthConstructor() [all …]
|
D | Selection.cpp | 27 static void embeddingLookupConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in embeddingLookupConstructor() argument 28 setFreeDimensions(op->inputs[0], /*rank=*/1); in embeddingLookupConstructor() 29 setFreeDimensions(op->inputs[1], rank); in embeddingLookupConstructor() 30 op->outputs[0]->dimensions.resize(rank); in embeddingLookupConstructor() 31 op->outputs[0]->dimensions[0] = op->inputs[0]->dimensions[0]; in embeddingLookupConstructor() 33 op->outputs[0]->dimensions[i] = op->inputs[1]->dimensions[i]; in embeddingLookupConstructor() 35 setSameQuantization(op->outputs[0], op->inputs[1]); in embeddingLookupConstructor() 38 static void embeddingLookupFinalizer(RandomOperation* op) { in embeddingLookupFinalizer() argument 39 uint32_t dimValue = op->inputs[1]->dimensions[0].getValue(); in embeddingLookupFinalizer() 40 uint32_t numElements = op->inputs[0]->getNumberOfElements(); in embeddingLookupFinalizer() [all …]
|
D | OperationSignatureUtils.h | 121 inline void uniform(T low, T up, T zeroPoint, RandomOperand* op) { 122 T* data = reinterpret_cast<T*>(op->buffer.data()); 123 uint32_t len = op->getNumberOfElements(); 125 data[i] = getUniformValue<T>(op->valueProperties, low, up, zeroPoint); 131 inline void uniformFinalizer(RandomOperand* op) { 132 switch (op->dataType) { 135 uniform<float>(kMinFloat32, kMaxFloat32, 0.0f, op); 139 uniform<int32_t>(0, 255, op->zeroPoint, op); 142 uniform<uint8_t>(0, 255, op->zeroPoint, op); 145 uniform<int8_t>(-128, 127, op->zeroPoint, op); [all …]
|
D | BoundingBox.cpp | 28 static void roiTensorConstructor(TestOperandType dataType, uint32_t, RandomOperand* op) { in roiTensorConstructor() argument 29 op->dataType = dataType; in roiTensorConstructor() 31 op->dataType = TestOperandType::TENSOR_QUANT16_ASYMM; in roiTensorConstructor() 32 op->scale = 0.125f; in roiTensorConstructor() 33 op->zeroPoint = 0; in roiTensorConstructor() 42 static void roiConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in roiConstructor() argument 45 if (op->opType == TestOperationType::ROI_ALIGN) { in roiConstructor() 46 useNchw = op->inputs[9]->value<bool8>(); in roiConstructor() 48 useNchw = op->inputs[7]->value<bool8>(); in roiConstructor() 51 op->inputs[0]->dimensions = {RandomVariableType::FREE, RandomVariableType::FREE, in roiConstructor() [all …]
|
D | Poolings.cpp | 24 static void poolingExplicitOpConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in poolingExplicitOpConstructor() argument 28 int32_t paddingLeft = op->inputs[1]->value<int32_t>(); in poolingExplicitOpConstructor() 29 int32_t paddingRight = op->inputs[2]->value<int32_t>(); in poolingExplicitOpConstructor() 30 int32_t paddingTop = op->inputs[3]->value<int32_t>(); in poolingExplicitOpConstructor() 31 int32_t paddingBottom = op->inputs[4]->value<int32_t>(); in poolingExplicitOpConstructor() 32 int32_t strideWidth = op->inputs[5]->value<int32_t>(); in poolingExplicitOpConstructor() 33 int32_t strideHeight = op->inputs[6]->value<int32_t>(); in poolingExplicitOpConstructor() 34 auto filterWidth = op->inputs[7]->value<RandomVariable>(); in poolingExplicitOpConstructor() 35 auto filterHeight = op->inputs[8]->value<RandomVariable>(); in poolingExplicitOpConstructor() 37 if (op->inputs.size() > 10) useNchw = op->inputs[10]->value<bool8>(); in poolingExplicitOpConstructor() [all …]
|
D | Resize.cpp | 23 static void resizeOpConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in resizeOpConstructor() argument 25 setFreeDimensions(op->inputs[0], rank); in resizeOpConstructor() 27 bool useNchw = op->inputs.size() > 3 ? static_cast<bool>(op->inputs[3]->value<bool8>()) : false; in resizeOpConstructor() 33 switch (op->inputs[1]->dataType) { in resizeOpConstructor() 36 outWidth = op->inputs[1]->value<RandomVariable>(); in resizeOpConstructor() 37 outHeight = op->inputs[2]->value<RandomVariable>(); in resizeOpConstructor() 41 outWidth = op->inputs[0]->dimensions[widthIndex] * op->inputs[1]->value<float>(); in resizeOpConstructor() 42 outHeight = op->inputs[0]->dimensions[heightIndex] * op->inputs[2]->value<float>(); in resizeOpConstructor() 45 outWidth = op->inputs[0]->dimensions[widthIndex] * in resizeOpConstructor() 46 static_cast<float>(op->inputs[1]->value<_Float16>()); in resizeOpConstructor() [all …]
|
D | Broadcast.cpp | 25 static void broadcastOpConstructor(TestOperandType dataType, uint32_t rank, RandomOperation* op) { in broadcastOpConstructor() argument 27 op->inputs[0]->dimensions.resize(rank); in broadcastOpConstructor() 28 op->inputs[1]->dimensions.resize(rank2); in broadcastOpConstructor() 29 op->outputs[0]->dimensions.resize(rank); in broadcastOpConstructor() 31 op->outputs[0]->dimensions[i] = RandomVariableType::FREE; in broadcastOpConstructor() 33 op->inputs[0]->dimensions[i] = op->outputs[0]->dimensions[i]; in broadcastOpConstructor() 37 op->inputs[0]->dimensions[i] = op->outputs[0]->dimensions[i]; in broadcastOpConstructor() 38 op->inputs[1]->dimensions[i - rankDiff] = op->outputs[0]->dimensions[i]; in broadcastOpConstructor() 41 op->inputs[0]->dimensions[i] = 1; in broadcastOpConstructor() 42 op->inputs[1]->dimensions[i - rankDiff] = op->outputs[0]->dimensions[i]; in broadcastOpConstructor() [all …]
|
D | ConcatSplit.cpp | 24 static void concatConstructor(uint32_t numInputs, bool isV1_0, uint32_t rank, RandomOperation* op) { in concatConstructor() argument 26 op->inputs[i]->dimensions.resize(rank); in concatConstructor() 27 if (isV1_0) setSameQuantization(op->inputs[i], op->inputs[0]); in concatConstructor() 29 op->outputs[0]->dimensions.resize(rank); in concatConstructor() 32 op->inputs[numInputs]->setScalarValue<int32_t>(axis); in concatConstructor() 34 op->inputs[0]->dimensions[i] = RandomVariableType::FREE; in concatConstructor() 35 op->outputs[0]->dimensions[i] = op->inputs[0]->dimensions[i]; in concatConstructor() 38 op->inputs[j]->dimensions[i] = RandomVariableType::FREE; in concatConstructor() 39 op->outputs[0]->dimensions[i] = in concatConstructor() 40 op->outputs[0]->dimensions[i] + op->inputs[j]->dimensions[i]; in concatConstructor() [all …]
|
D | Reduce.cpp | 23 static void reduceOpConstructor(TestOperandType, uint32_t rank, RandomOperation* op) { in reduceOpConstructor() argument 24 setFreeDimensions(op->inputs[0], rank); in reduceOpConstructor() 31 op->inputs[1]->dimensions = {numAxis}; in reduceOpConstructor() 32 op->inputs[1]->resizeBuffer<int32_t>(numAxis); in reduceOpConstructor() 35 op->inputs[1]->value<int32_t>(i) = dim; in reduceOpConstructor() 41 if (op->inputs[2]->dataType == TestOperandType::BOOL) { in reduceOpConstructor() 42 keepDims = op->inputs[2]->value<bool8>(); in reduceOpConstructor() 44 keepDims = op->inputs[2]->value<int32_t>() > 0; in reduceOpConstructor() 49 op->outputs[0]->dimensions.emplace_back(op->inputs[0]->dimensions[i]); in reduceOpConstructor() 51 op->outputs[0]->dimensions.emplace_back(1); in reduceOpConstructor() [all …]
|
D | Elementwise.cpp | 23 static void elementwiseOpConstructor(TestOperandType dataType, uint32_t rank, RandomOperation* op) { in elementwiseOpConstructor() argument 24 sameShapeOpConstructor(dataType, rank, op); in elementwiseOpConstructor() 26 switch (op->opType) { in elementwiseOpConstructor() 29 op->outputs[0]->valueProperties = RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 32 op->outputs[0]->valueProperties = RandomOperand::NON_ZERO | RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 35 op->outputs[0]->valueProperties = RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 38 op->outputs[0]->valueProperties = RandomOperand::NON_ZERO | RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 41 op->inputs[0]->valueProperties = RandomOperand::NON_ZERO | RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 44 op->inputs[0]->valueProperties = RandomOperand::NON_ZERO | RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() 45 op->outputs[0]->valueProperties = RandomOperand::NON_ZERO | RandomOperand::NON_NEGATIVE; in elementwiseOpConstructor() [all …]
|
D | FullyConnected.cpp | 26 RandomOperation* op) { in fullyConnectedConstructor() argument 28 op->inputs[0]->dimensions.resize(rank); in fullyConnectedConstructor() 31 op->inputs[0]->dimensions[i] = RandomVariableType::FREE; in fullyConnectedConstructor() 32 numElements = numElements * op->inputs[0]->dimensions[i]; in fullyConnectedConstructor() 36 op->inputs[1]->dimensions = {RandomVariableType::FREE, RandomVariableType::FREE}; in fullyConnectedConstructor() 39 op->inputs[2]->dimensions = {op->inputs[1]->dimensions[0]}; in fullyConnectedConstructor() 42 op->outputs[0]->dimensions = {numElements.exactDiv(op->inputs[1]->dimensions[1]), in fullyConnectedConstructor() 43 op->inputs[1]->dimensions[0]}; in fullyConnectedConstructor() 45 setConvFCScale(/*applyOutputScaleBound=*/ver == TestHalVersion::V1_0, op); in fullyConnectedConstructor()
|
/packages/modules/NeuralNetworks/tools/test_generator/ |
D | spec_visualizer.py | 74 def GetOperandInfo(op): argument 75 op_info = {"lifetime": op.lifetime, "type": op.type.type} 77 if not op.type.IsScalar(): 78 op_info["dimensions"] = FormatArray(op.type.dimensions) 80 if op.type.scale != 0: 81 op_info["scale"] = op.type.scale 82 op_info["zero point"] = op.type.zeroPoint 83 if op.type.type == "TENSOR_QUANT8_SYMM_PER_CHANNEL": 84 op_info["scale"] = FormatArray(op.type.extraParams.scales) 85 op_info["channel dim"] = op.type.extraParams.channelDim [all …]
|
D | test_generator.py | 520 return sorted(list(set(op.type for op in self.operands))) 529 return [i for i,op in enumerate(self.operands) if isinstance(op, Input)] 532 return [o for o,op in enumerate(self.operands) if isinstance(op, Output)] 560 for ind, op in enumerate(self.operands): 561 op.model_index = ind 565 for op in self.operands: 566 op.ins = list() 567 op.outs = list() 568 for op in self.operations: 569 op.ins = self.GetEquivalentOperands(op.ins) [all …]
|
D | example_generator.py | 124 "inputs": [op.model_index for op in operation.ins], 125 "outputs": [op.model_index for op in operation.outs], 132 "operands": [GetOperandStruct(op) for op in subgraph.operands], 133 "operations": [GetOperationStruct(op) for op in subgraph.operations], 134 "inputIndexes": [op.model_index for op in subgraph.GetInputs()], 135 "outputIndexes": [op.model_index for op in subgraph.GetOutputs()],
|
/packages/providers/MediaProvider/src/com/android/providers/media/scan/ |
D | ModernMediaScanner.java | 798 final ContentProviderOperation.Builder op; in visitFile() local 801 op = scanItem(existingId, realFile, attrs, actualMimeType, actualMediaType, in visitFile() 806 if (op != null) { in visitFile() 807 op.withValue(FileColumns._MODIFIER, FileColumns._MODIFIER_MEDIA_SCAN); in visitFile() 809 if (op.build().isInsert() && !attrs.isDirectory() && mOwnerPackage != null) { in visitFile() 810 op.withValue(MediaColumns.OWNER_PACKAGE_NAME, mOwnerPackage); in visitFile() 815 op.withValue(MediaColumns.IS_DRM, 1); in visitFile() 817 addPending(op.build()); in visitFile() 902 private void addPending(ContentProviderOperation op) { in addPending() argument 903 mPending.add(op); in addPending() [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/avrcp/ |
D | AvrcpBipObexServerTest.java | 176 Operation op = mock(Operation.class); in makeOperation() local 177 when(op.getReceivedHeader()).thenReturn(requestHeaders); in makeOperation() 178 when(op.getMaxPacketSize()).thenReturn(256); in makeOperation() 179 when(op.openOutputStream()).thenReturn(os); in makeOperation() 180 return op; in makeOperation() 235 Operation op = makeOperation(null, mOutputStream); in testOnGetNoHeaders() local 236 int responseCode = mAvrcpBipObexServer.onGet(op); in testOnGetNoHeaders() 246 Operation op = makeOperation(mRequest, mOutputStream); in testOnGetBadType() local 247 int responseCode = mAvrcpBipObexServer.onGet(op); in testOnGetBadType() 257 Operation op = makeOperation(mRequest, mOutputStream); in testOnGetNoType() local [all …]
|
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/ |
D | DriverFuzzTest.cpp | 67 const auto& op = testSubgraph.operands[i]; in createSubgraph() local 70 if (op.lifetime == TestOperandLifeTime::CONSTANT_COPY) { in createSubgraph() 74 .length = static_cast<uint32_t>(op.data.size()), in createSubgraph() 76 constCopies->push_back(&op.data); in createSubgraph() 77 *constCopySize += op.data.alignedSize(); in createSubgraph() 78 } else if (op.lifetime == TestOperandLifeTime::CONSTANT_REFERENCE) { in createSubgraph() 82 .length = static_cast<uint32_t>(op.data.size()), in createSubgraph() 84 constReferences->push_back(&op.data); in createSubgraph() 85 *constRefSize += op.data.alignedSize(); in createSubgraph() 86 } else if (op.lifetime == TestOperandLifeTime::SUBGRAPH) { in createSubgraph() [all …]
|
/packages/modules/NeuralNetworks/tools/test_generator/test_harness/ |
D | TestHarness.cpp | 62 uint32_t getNumberOfElements(const TestOperand& op) { in getNumberOfElements() argument 63 return std::reduce(op.dimensions.begin(), op.dimensions.end(), 1u, std::multiplies<uint32_t>()); in getNumberOfElements() 68 void expectNear(const TestOperand& op, const TestBuffer& result, const AccuracyCriterion& criterion, in expectNear() argument 72 const T* expectedBuffer = op.data.get<T>(); in expectNear() 73 uint32_t len = getNumberOfElements(op), numErrors = 0, numSkip = 0; in expectNear() 115 void expectBooleanNearlyEqual(const TestOperand& op, const TestBuffer& result, in expectBooleanNearlyEqual() argument 118 const bool8* expectedBuffer = op.data.get<bool8>(); in expectBooleanNearlyEqual() 119 uint32_t len = getNumberOfElements(op), numErrors = 0; in expectBooleanNearlyEqual() 279 [](const TestOperand& op) { in checkResults() argument 280 return op.type == TestOperandType::TENSOR_FLOAT16; in checkResults() [all …]
|
/packages/apps/Bluetooth/src/com/android/bluetooth/mapclient/obex/ |
D | Request.java | 83 ClientOperation op = null; in executeGet() local 86 op = (ClientOperation) session.get(mHeaderSet); in executeGet() 95 op.setGetFinalFlag(true); in executeGet() 101 op.continueOperation(true, false); in executeGet() 103 readResponseHeaders(op.getReceivedHeader()); in executeGet() 105 InputStream is = op.openInputStream(); in executeGet() 109 op.close(); in executeGet() 111 mResponseCode = op.getResponseCode(); in executeGet() 120 Operation op = null; in executePut() local 125 op = session.put(mHeaderSet); in executePut() [all …]
|
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcp/ |
D | AvrcpBipObexServer.java | 131 public int onGet(final Operation op) { in onGet() argument 134 HeaderSet request = op.getReceivedHeader(); in onGet() 140 return handleGetImageThumbnail(op); in onGet() 142 return handleGetImageProperties(op); in onGet() 144 return handleGetImage(op); in onGet() 159 public int onPut(final Operation op) { in onPut() argument 200 private int handleGetImageThumbnail(Operation op)throws IOException { in handleGetImageThumbnail() argument 201 HeaderSet request = op.getReceivedHeader(); in handleGetImageThumbnail() 229 return sendResponse(op, replyHeaders, thumbnail); in handleGetImageThumbnail() 232 private int handleGetImageProperties(Operation op) throws IOException { in handleGetImageProperties() argument [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/data/ |
D | UserPresetsManager.java | 91 SaveOperation op = new SaveOperation(); in save() local 92 op.json = preset.getJsonString(ImagePreset.JASON_SAVED); in save() 93 op.name = name; in save() 94 msg.obj = op; in save() 111 UpdateOperation op = new UpdateOperation(); in update() local 112 op.id = representation.getId(); in update() 113 op.name = representation.getName(); in update() 114 msg.obj = op; in update() 132 SaveOperation op = (SaveOperation) msg.obj; in processSave() local 133 mUserPresets.insertStack(op.name, op.json.getBytes()); in processSave() [all …]
|
/packages/providers/MediaProvider/tests/src/com/android/providers/media/ |
D | PermissionActivityTest.java | 249 for (String op : enableAppOpsList) { in setupPermissions() 250 modifyAppOp(uid, op, AppOpsManager.MODE_ALLOWED); in setupPermissions() 253 for (String op : disableAppOpsList) { in setupPermissions() 254 modifyAppOp(uid, op, AppOpsManager.MODE_ERRORED); in setupPermissions() 262 for (String op : DEFAULT_OP_PERMISSION_LIST) { in restoreDefaultAppOpPermissions() 263 modifyAppOp(uid, op, AppOpsManager.MODE_DEFAULT); in restoreDefaultAppOpPermissions() 266 for (String op : ALLOWED_OP_PERMISSION_LIST) { in restoreDefaultAppOpPermissions() 267 modifyAppOp(uid, op, AppOpsManager.MODE_ALLOWED); in restoreDefaultAppOpPermissions() 287 private static void modifyAppOp(int uid, @NonNull String op, int mode) { in modifyAppOp() argument 288 getContext().getSystemService(AppOpsManager.class).setUidMode(op, uid, mode); in modifyAppOp() [all …]
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/permission/model/ |
D | AppPermissionUsage.java | 157 return lastAccessAggregate((op) -> op.getLastAccessTime(PRIVACY_HUB_FLAGS)); in getLastAccessTime() 165 return lastAccessAggregate((op) -> op.getLastAccessForegroundTime(PRIVACY_HUB_FLAGS)); in getLastAccessForegroundTime() 173 return lastAccessAggregate((op) -> op.getLastAccessBackgroundTime(PRIVACY_HUB_FLAGS)); in getLastAccessBackgroundTime() 181 return extractAggregate((HistoricalOp op) in getForegroundAccessCount() 182 -> op.getForegroundAccessCount(PRIVACY_HUB_FLAGS)); in getForegroundAccessCount() 190 return extractAggregate((HistoricalOp op) in getBackgroundAccessCount() 191 -> op.getBackgroundAccessCount(PRIVACY_HUB_FLAGS)); in getBackgroundAccessCount() 199 return extractAggregate((HistoricalOp op) -> in getAccessCount() 200 op.getForegroundAccessCount(PRIVACY_HUB_FLAGS) in getAccessCount() 201 + op.getBackgroundAccessCount(PRIVACY_HUB_FLAGS) in getAccessCount() [all …]
|
/packages/apps/Settings/src/com/android/settings/applications/appops/ |
D | AppOpsState.java | 240 public void addOp(AppOpEntry entry, AppOpsManager.OpEntry op) { in addOp() argument 241 mOps.put(op.getOp(), op); in addOp() local 242 mOpSwitches.put(AppOpsManager.opToSwitch(op.getOp()), entry); in addOp() 245 public boolean hasOp(int op) { in hasOp() argument 246 return mOps.indexOfKey(op) >= 0; in hasOp() 249 public AppOpEntry getOpSwitch(int op) { in getOpSwitch() argument 250 return mOpSwitches.get(AppOpsManager.opToSwitch(op)); in getOpSwitch() 316 public AppOpEntry(AppOpsManager.PackageOps pkg, AppOpsManager.OpEntry op, AppEntry app, in AppOpEntry() argument 321 mApp.addOp(this, op); in AppOpEntry() 322 mOps.add(op); in AppOpEntry() [all …]
|