Revert "Deprecate NNAPI functions in API level 35" This reverts commit ee8f5ffd3e2d42fcf8105b9a2ff0d9312f646b2d. Reason for revert: removing from 24Q2-release, inteded to Q3 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c1e39fbc396491835845b5a95f3f6e683a33aacb) Bug: 283927643 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f11a18f2ead1390acae62ca38b5652dc3531b10e) Merged-In: I253630ea16ec7c4e40447b2ef3151c32da617a32 Change-Id: I253630ea16ec7c4e40447b2ef3151c32da617a32
diff --git a/runtime/include/NeuralNetworks.h b/runtime/include/NeuralNetworks.h index b986e09..4e54f85 100644 --- a/runtime/include/NeuralNetworks.h +++ b/runtime/include/NeuralNetworks.h
@@ -51,22 +51,15 @@ #ifdef __ANDROID__ #include <android/hardware_buffer.h> -#else #endif // __ANDROID__ -#if !defined(__DEPRECATED_IN) -#define __DEPRECATED_IN(api_level) __attribute__((annotate("deprecated_in=" #api_level))) -#endif - // This is required for building libneuralnetworks_cl, // the symbols have same names as in NDK, but // they are not bounded by API availability. #ifdef NN_COMPATIBILITY_LIBRARY_BUILD #define __NNAPI_INTRODUCED_IN(x) -#define __NNAPI_DEPRECATED_IN(x) #else #define __NNAPI_INTRODUCED_IN(x) __INTRODUCED_IN(x) -#define __NNAPI_DEPRECATED_IN(x) __DEPRECATED_IN(x) #endif #ifndef __NNAPI_FL5_MIN_ANDROID_API__ @@ -94,12 +87,8 @@ * Set to NULL if unsuccessful. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksMemoryDesc_create(ANeuralNetworksMemoryDesc** desc) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksMemoryDesc_create(ANeuralNetworksMemoryDesc** desc) __NNAPI_INTRODUCED_IN(30); /** * Destroy a memory descriptor. @@ -113,12 +102,8 @@ * * @param desc The memory descriptor to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksMemoryDesc_free(ANeuralNetworksMemoryDesc* desc) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksMemoryDesc_free(ANeuralNetworksMemoryDesc* desc) __NNAPI_INTRODUCED_IN(30); /** * Specify that a memory object will be playing the role of an input to an execution created from a @@ -161,14 +146,11 @@ * layouts. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemoryDesc_addInputRole(ANeuralNetworksMemoryDesc* desc, const ANeuralNetworksCompilation* compilation, uint32_t index, float frequency) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Specify that a memory object will be playing the role of an output to an execution created from a @@ -211,14 +193,11 @@ * layouts. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemoryDesc_addOutputRole(ANeuralNetworksMemoryDesc* desc, const ANeuralNetworksCompilation* compilation, uint32_t index, float frequency) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Set the dimensional information of the memory descriptor. @@ -242,13 +221,9 @@ * corresponding axis has an unknown size. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemoryDesc_setDimensions(ANeuralNetworksMemoryDesc* desc, uint32_t rank, - const uint32_t* dimensions) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); + const uint32_t* dimensions) __NNAPI_INTRODUCED_IN(30); /** * Indicate that we have finished modifying a memory descriptor. Required before calling @@ -263,12 +238,8 @@ * @param desc The memory descriptor to be finished. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksMemoryDesc_finish(ANeuralNetworksMemoryDesc* desc) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksMemoryDesc_finish(ANeuralNetworksMemoryDesc* desc) __NNAPI_INTRODUCED_IN(30); /** * Creates a memory object from a memory descriptor. @@ -322,13 +293,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful; ANEURALNETWORKS_OP_FAILED if the memory is * created with unspecified dimensions or rank and it is not supported for this set of * roles. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemory_createFromDesc(const ANeuralNetworksMemoryDesc* desc, - ANeuralNetworksMemory** memory) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksMemory** memory) __NNAPI_INTRODUCED_IN(30); /** * Copies data from one memory object to another. @@ -365,12 +332,9 @@ * @param dst The destination memory object. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemory_copy(const ANeuralNetworksMemory* src, const ANeuralNetworksMemory* dst) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Get the number of available devices. @@ -380,12 +344,8 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworks_getDeviceCount(uint32_t* numDevices) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworks_getDeviceCount(uint32_t* numDevices) __NNAPI_INTRODUCED_IN(29); /** * Get the representation of the specified device. @@ -399,12 +359,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworks_getDevice(uint32_t devIndex, ANeuralNetworksDevice** device) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the name of the specified device. @@ -422,12 +379,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksDevice_getName(const ANeuralNetworksDevice* device, const char** name) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the type of a given device. @@ -444,12 +398,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksDevice_getType(const ANeuralNetworksDevice* device, int32_t* type) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the version of the driver implementation of the specified device. @@ -477,12 +428,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksDevice_getVersion(const ANeuralNetworksDevice* device, const char** version) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the NNAPI feature level of the specified NNAPI device. @@ -507,13 +455,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksDevice_getFeatureLevel(const ANeuralNetworksDevice* device, - int64_t* featureLevel) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); + int64_t* featureLevel) __NNAPI_INTRODUCED_IN(29); /** * Wait until the device is in a live state. @@ -528,12 +472,8 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksDevice_wait(const ANeuralNetworksDevice* device) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksDevice_wait(const ANeuralNetworksDevice* device) __NNAPI_INTRODUCED_IN(30); /** * Get the supported operations for a specified set of devices. If multiple devices @@ -551,14 +491,10 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_getSupportedOperationsForDevices( const ANeuralNetworksModel* model, const ANeuralNetworksDevice* const* devices, - uint32_t numDevices, bool* supportedOps) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); + uint32_t numDevices, bool* supportedOps) __NNAPI_INTRODUCED_IN(29); /** * Create a {@link ANeuralNetworksCompilation} to compile the given model for a specified set @@ -586,15 +522,12 @@ * if the model is invalid. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_createForDevices(ANeuralNetworksModel* model, const ANeuralNetworksDevice* const* devices, uint32_t numDevices, ANeuralNetworksCompilation** compilation) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Sets the compilation caching signature and the cache directory. @@ -620,13 +553,10 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_setCaching(ANeuralNetworksCompilation* compilation, const char* cacheDir, const uint8_t* token) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Schedule synchronous evaluation of the execution. @@ -666,12 +596,8 @@ * @return ANEURALNETWORKS_NO_ERROR if the execution completed normally. * ANEURALNETWORKS_UNMAPPABLE if the execution input or output memory cannot * be properly mapped. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksExecution_compute(ANeuralNetworksExecution* execution) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksExecution_compute(ANeuralNetworksExecution* execution) __NNAPI_INTRODUCED_IN(29); /** * Get the dimensional information of the specified output operand of the model of the @@ -693,13 +619,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is invalid. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_getOutputOperandRank(ANeuralNetworksExecution* execution, int32_t index, uint32_t* rank) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the dimensional information of the specified output operand of the model of the @@ -722,13 +645,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is invalid or if the target is a scalar. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_getOutputOperandDimensions(ANeuralNetworksExecution* execution, int32_t index, uint32_t* dimensions) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Create a {@link ANeuralNetworksBurst} to apply the given compilation. @@ -745,13 +665,9 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA * if the compilation is invalid. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, - ANeuralNetworksBurst** burst) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksBurst** burst) __NNAPI_INTRODUCED_IN(29); /** * Destroys the burst object. @@ -760,12 +676,8 @@ * * @param burst The burst object to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksBurst_free(ANeuralNetworksBurst* burst) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksBurst_free(ANeuralNetworksBurst* burst) __NNAPI_INTRODUCED_IN(29); /** * Schedule synchronous evaluation of the execution on a burst object. @@ -810,13 +722,9 @@ * ANeuralNetworksCompilation} as the burst object. * * @return ANEURALNETWORKS_NO_ERROR if the execution completed normally. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_burstCompute(ANeuralNetworksExecution* execution, - ANeuralNetworksBurst* burst) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksBurst* burst) __NNAPI_INTRODUCED_IN(29); /** * Creates a shared memory object from an AHardwareBuffer handle. @@ -850,14 +758,11 @@ * @return ANEURALNETWORKS_NO_ERROR if the request completed normally. * * @see AHardwareBuffer - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ #ifdef __ANDROID__ int ANeuralNetworksMemory_createFromAHardwareBuffer(const AHardwareBuffer* ahwb, ANeuralNetworksMemory** memory) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); #endif // __ANDROID__ /** @@ -884,12 +789,9 @@ * @param measure 'true' if duration is to be measured, 'false' if not. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setMeasureTiming(ANeuralNetworksExecution* execution, bool measure) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Get the time spent in the latest computation evaluated on the specified @@ -912,13 +814,10 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 3. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_getDuration(const ANeuralNetworksExecution* execution, int32_t durationCode, uint64_t* duration) - __NNAPI_INTRODUCED_IN(29) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(29); /** * Creates a shared memory object from a file descriptor. @@ -943,13 +842,9 @@ * Set to NULL if unsuccessful. * * @return ANEURALNETWORKS_NO_ERROR if the request completed normally. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t offset, - ANeuralNetworksMemory** memory) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksMemory** memory) __NNAPI_INTRODUCED_IN(27); /** * Delete a memory object. @@ -962,12 +857,8 @@ * * @param memory The memory object to be freed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksMemory_free(ANeuralNetworksMemory* memory) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksMemory_free(ANeuralNetworksMemory* memory) __NNAPI_INTRODUCED_IN(27); /** * Create an empty {@link ANeuralNetworksModel}. @@ -994,12 +885,8 @@ * Set to NULL if unsuccessful. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksModel_create(ANeuralNetworksModel** model) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksModel_create(ANeuralNetworksModel** model) __NNAPI_INTRODUCED_IN(27); /** * Destroy a model. @@ -1013,12 +900,8 @@ * * @param model The model to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksModel_free(ANeuralNetworksModel* model) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksModel_free(ANeuralNetworksModel* model) __NNAPI_INTRODUCED_IN(27); /** * Indicate that we have finished modifying a model. Required before @@ -1037,12 +920,8 @@ * @param model The model to be finished. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) __NNAPI_INTRODUCED_IN(27); /** * Add an operand to a model. @@ -1093,13 +972,10 @@ * {@link ANeuralNetworksModel_addOperand}. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model, const ANeuralNetworksOperandType* type) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Sets an operand to a constant value. @@ -1135,13 +1011,10 @@ * @param length The size in bytes of the data value. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel* model, int32_t index, const void* buffer, size_t length) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Sets an operand's per channel quantization parameters. @@ -1161,14 +1034,10 @@ * this function. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_setOperandSymmPerChannelQuantParams( ANeuralNetworksModel* model, int32_t index, - const ANeuralNetworksSymmPerChannelQuantParams* channelQuant) __NNAPI_INTRODUCED_IN(29) - __NNAPI_DEPRECATED_IN(35); + const ANeuralNetworksSymmPerChannelQuantParams* channelQuant) __NNAPI_INTRODUCED_IN(29); /** * Sets an operand to a value stored in a memory object. @@ -1207,14 +1076,11 @@ * @param length The size in bytes of the data value. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel* model, int32_t index, const ANeuralNetworksMemory* memory, size_t offset, size_t length) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Sets an operand to a value that is a reference to another NNAPI model. @@ -1240,13 +1106,10 @@ * @param value The model to be referenced. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_setOperandValueFromModel(ANeuralNetworksModel* model, int32_t index, const ANeuralNetworksModel* value) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Add an operation to a model. @@ -1269,15 +1132,11 @@ * Available since NNAPI feature level 1. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_addOperation(ANeuralNetworksModel* model, ANeuralNetworksOperationType type, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, - const uint32_t* outputs) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + const uint32_t* outputs) __NNAPI_INTRODUCED_IN(27); /** * Specifies which operands will be the model's inputs and @@ -1302,14 +1161,11 @@ * * Available since NNAPI feature level 1. * - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, uint32_t inputCount, const uint32_t* inputs, uint32_t outputCount, - const uint32_t* outputs) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + const uint32_t* outputs) + __NNAPI_INTRODUCED_IN(27); /** * Specifies whether {@link ANEURALNETWORKS_TENSOR_FLOAT32} is allowed to be @@ -1335,12 +1191,9 @@ * Available since NNAPI feature level 2. * * See {@link ANeuralNetworksModel} for information on multithreaded usage. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksModel_relaxComputationFloat32toFloat16(ANeuralNetworksModel* model, bool allow) - __NNAPI_INTRODUCED_IN(28) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(28); /** * Create a {@link ANeuralNetworksCompilation} to compile the given model. @@ -1372,13 +1225,10 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA * if the model is invalid. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_create(ANeuralNetworksModel* model, ANeuralNetworksCompilation** compilation) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Destroy a compilation. @@ -1392,12 +1242,9 @@ * * @param compilation The compilation to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation* compilation) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Sets the execution preference. @@ -1415,13 +1262,9 @@ * {@link ANEURALNETWORKS_PREFER_SUSTAINED_SPEED}. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation* compilation, - int32_t preference) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + int32_t preference) __NNAPI_INTRODUCED_IN(27); /** * Indicate that we have finished modifying a compilation. Required before @@ -1445,12 +1288,9 @@ * @param compilation The compilation to be finished. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) - __NNAPI_INTRODUCED_IN(27) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(27); /** * Set the execution priority. @@ -1474,12 +1314,9 @@ * ANEURALNETWORKS_PRIORITY_*. * * @return ANEURALNETWORKS_NO_ERROR if successful. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_setPriority(ANeuralNetworksCompilation* compilation, int priority) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Set the maximum expected duration for compiling the model. @@ -1520,13 +1357,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_setTimeout(ANeuralNetworksCompilation* compilation, - uint64_t duration) __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); + uint64_t duration) __NNAPI_INTRODUCED_IN(30); /** * Create a {@link ANeuralNetworksExecution} to apply the given compilation. @@ -1547,13 +1380,9 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA * if the compilation is invalid. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_create(ANeuralNetworksCompilation* compilation, - ANeuralNetworksExecution** execution) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksExecution** execution) __NNAPI_INTRODUCED_IN(27); /** * Destroy an execution. @@ -1575,12 +1404,8 @@ * * @param execution The execution to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksExecution_free(ANeuralNetworksExecution* execution) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksExecution_free(ANeuralNetworksExecution* execution) __NNAPI_INTRODUCED_IN(27); /** * Associate a user buffer with an input of the model of the @@ -1637,14 +1462,10 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the * name is not recognized or the buffer is too small for the input. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const void* buffer, - size_t length) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + size_t length) __NNAPI_INTRODUCED_IN(27); /** * Associate a region of a memory object with an input of the model of the @@ -1711,15 +1532,11 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the * name is not recognized or the buffer is too small for the input. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setInputFromMemory(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const ANeuralNetworksMemory* memory, size_t offset, - size_t length) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + size_t length) __NNAPI_INTRODUCED_IN(27); /** * Associate a user buffer with an output of the model of the @@ -1780,14 +1597,10 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the * name is not recognized or the buffer is too small for the output. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setOutput(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, void* buffer, - size_t length) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + size_t length) __NNAPI_INTRODUCED_IN(27); /** * Associate a region of a memory object with an output of the model of the @@ -1859,15 +1672,11 @@ * * @return ANEURALNETWORKS_NO_ERROR if successful, ANEURALNETWORKS_BAD_DATA if the * name is not recognized or the buffer is too small for the output. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setOutputFromMemory(ANeuralNetworksExecution* execution, int32_t index, const ANeuralNetworksOperandType* type, const ANeuralNetworksMemory* memory, size_t offset, - size_t length) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + size_t length) __NNAPI_INTRODUCED_IN(27); /** * Schedule asynchronous evaluation of the execution. @@ -1920,13 +1729,9 @@ * NULL if there's an error. * * @return ANEURALNETWORKS_NO_ERROR if the evaluation is successfully scheduled. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution* execution, - ANeuralNetworksEvent** event) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); + ANeuralNetworksEvent** event) __NNAPI_INTRODUCED_IN(27); /** * Set the maximum expected duration of the specified execution. @@ -1973,12 +1778,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setTimeout(ANeuralNetworksExecution* execution, uint64_t duration) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Set the maximum duration of WHILE loops in the specified execution. @@ -2007,12 +1809,9 @@ * ANEURALNETWORKS_UNEXPECTED_NULL if execution is NULL. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setLoopTimeout(ANeuralNetworksExecution* execution, uint64_t duration) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Get the default timeout value for WHILE loops. @@ -2020,12 +1819,8 @@ * @return The default timeout value in nanoseconds. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -uint64_t ANeuralNetworks_getDefaultLoopTimeout() __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +uint64_t ANeuralNetworks_getDefaultLoopTimeout() __NNAPI_INTRODUCED_IN(30); /** * Get the maximum timeout value for WHILE loops. @@ -2033,12 +1828,8 @@ * @return The maximum timeout value in nanoseconds. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -uint64_t ANeuralNetworks_getMaximumLoopTimeout() __NNAPI_INTRODUCED_IN(30) - __NNAPI_DEPRECATED_IN(35); +uint64_t ANeuralNetworks_getMaximumLoopTimeout() __NNAPI_INTRODUCED_IN(30); /** * Waits until the execution completes. @@ -2064,12 +1855,8 @@ * @return ANEURALNETWORKS_NO_ERROR if the execution completed normally. * ANEURALNETWORKS_UNMAPPABLE if the execution input or output memory cannot * be properly mapped. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) __NNAPI_INTRODUCED_IN(27); /** * Destroys the event. @@ -2080,12 +1867,8 @@ * * @param event The event object to be destroyed. Passing NULL is acceptable and * results in no operation. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -void ANeuralNetworksEvent_free(ANeuralNetworksEvent* event) __NNAPI_INTRODUCED_IN(27) - __NNAPI_DEPRECATED_IN(35); +void ANeuralNetworksEvent_free(ANeuralNetworksEvent* event) __NNAPI_INTRODUCED_IN(27); /** * Create a {@link ANeuralNetworksEvent} from a sync_fence file descriptor. @@ -2099,12 +1882,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksEvent_createFromSyncFenceFd(int sync_fence_fd, ANeuralNetworksEvent** event) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Get sync_fence file descriptor from the event. @@ -2126,12 +1906,9 @@ * @return ANEURALNETWORKS_NO_ERROR if successful. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksEvent_getSyncFenceFd(const ANeuralNetworksEvent* event, int* sync_fence_fd) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Schedule asynchronous evaluation of the execution with dependencies. @@ -2208,14 +1985,11 @@ * @return ANEURALNETWORKS_NO_ERROR if the evaluation is successfully scheduled. * * Available since NNAPI feature level 4. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_startComputeWithDependencies( ANeuralNetworksExecution* execution, const ANeuralNetworksEvent* const* dependencies, uint32_t num_dependencies, uint64_t duration, ANeuralNetworksEvent** event) - __NNAPI_INTRODUCED_IN(30) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(30); /** * Get the NNAPI runtime feature level. @@ -2251,12 +2025,8 @@ * It is NOT an Android API level. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ -int64_t ANeuralNetworks_getRuntimeFeatureLevel() __NNAPI_INTRODUCED_IN(31) - __NNAPI_DEPRECATED_IN(35); +int64_t ANeuralNetworks_getRuntimeFeatureLevel() __NNAPI_INTRODUCED_IN(31); /** * Specifies whether the {@link ANeuralNetworksExecution} is able to accept padded input and output @@ -2291,13 +2061,9 @@ * {@link ANeuralNetworksExecution_setOutputFromMemory} has been called on the execution. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_enableInputAndOutputPadding(ANeuralNetworksExecution* execution, - bool enable) __NNAPI_INTRODUCED_IN(31) - __NNAPI_DEPRECATED_IN(35); + bool enable) __NNAPI_INTRODUCED_IN(31); /** * Get the preferred buffer and memory alignment of an input to an execution created from a @@ -2326,13 +2092,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is out of range. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_getPreferredMemoryAlignmentForInput( const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment) - __NNAPI_INTRODUCED_IN(31) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(31); /** * Get the preferred buffer and memory end padding of an input to an execution created from a @@ -2367,13 +2130,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is out of range. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_getPreferredMemoryPaddingForInput( const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding) - __NNAPI_INTRODUCED_IN(31) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(31); /** * Get the preferred buffer and memory alignment of an output to an execution created from a @@ -2402,13 +2162,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is out of range. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_getPreferredMemoryAlignmentForOutput( const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment) - __NNAPI_INTRODUCED_IN(31) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(31); /** * Get the preferred memory end padding of an output to an execution created from a particular @@ -2443,13 +2200,10 @@ * ANEURALNETWORKS_BAD_DATA if the index is out of range. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksCompilation_getPreferredMemoryPaddingForOutput( const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding) - __NNAPI_INTRODUCED_IN(31) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(31); /** * Specifies whether the {@link ANeuralNetworksExecution} can be reused for multiple computations. @@ -2475,12 +2229,9 @@ * ANEURALNETWORKS_BAD_STATE if the execution is not in the preparation state. * * Available since NNAPI feature level 5. - * @deprecated NNAPI is deprecated. See - * <a href="https://developer.android.com/ndk/guides/neuralnetworks">this webpage</a> - * for more details. */ int ANeuralNetworksExecution_setReusable(ANeuralNetworksExecution* execution, bool reusable) - __NNAPI_INTRODUCED_IN(31) __NNAPI_DEPRECATED_IN(35); + __NNAPI_INTRODUCED_IN(31); __END_DECLS