Loading neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ parcelable PrepareModelConfig { long deadlineNs; ParcelFileDescriptor[] modelCache; ParcelFileDescriptor[] dataCache; byte[] cacheToken; byte[32] cacheToken; android.hardware.neuralnetworks.TokenValuePair[] compilationHints; android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; const int BYTE_SIZE_OF_CACHE_TOKEN = 32; } neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ interface IDevice { /** * The byte size of the cache token. */ const int BYTE_SIZE_OF_CACHE_TOKEN = 32; const int BYTE_SIZE_OF_CACHE_TOKEN = PrepareModelConfig.BYTE_SIZE_OF_CACHE_TOKEN; /** * The maximum number of files for each type of cache in compilation caching. */ Loading neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +14 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,12 @@ interface IPreparedModel { * appropriate ErrorStatus value. If the inputs to the function are valid and there is no error, * createReusableExecution must construct a reusable execution. * * This method will be called when a client requests a reusable execution with consistent * request and execution config. For single-time execution, * {@link IPreparedModel::executeSynchronouslyWithConfig} or * {@link IPreparedModel::executeFencedWithConfig} is preferred, because the overhead of * setting up a reusable execution can be avoided. * * @param request The input and output information on which the prepared model is to be * executed. * @param config Specifies the execution configuration parameters. Loading @@ -223,6 +229,10 @@ interface IPreparedModel { * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains * more configuration parameters than are passed to executeSynchronously. * * This method is preferred when a client requests a single-time synchronous execution. * For reusable execution with consistent request and execution config, * {@link IPreparedModel::createReusableExecution} must be called. * * @param request The input and output information on which the prepared model is to be * executed. * @param config Specifies the execution configuration parameters. Loading @@ -246,6 +256,10 @@ interface IPreparedModel { * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains * more configuration parameters than are passed to executeFenced. * * This method is preferred when a client requests a single-time fenced execution. * For reusable execution with consistent request and execution config, * {@link IPreparedModel::createReusableExecution} must be called. * * @param request The input and output information on which the prepared model is to be * executed. The outputs in the request must have fully specified dimensions. * @param waitFor A vector of sync fence file descriptors. Execution must not start until all Loading neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl +7 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,11 @@ import android.hardware.neuralnetworks.TokenValuePair; */ @VintfStability parcelable PrepareModelConfig { /** * The byte size of the cache token. */ const int BYTE_SIZE_OF_CACHE_TOKEN = 32; /** * Indicates the intended execution behavior of a prepared model. */ Loading Loading @@ -66,7 +71,7 @@ parcelable PrepareModelConfig { */ ParcelFileDescriptor[] dataCache; /** * A caching token of length IDevice::BYTE_SIZE_OF_CACHE_TOKEN identifying * A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying * the prepared model. The same token will be provided when * retrieving the prepared model from the cache files with * IDevice::prepareModelFromCache. Tokens should be chosen to have a low Loading @@ -77,7 +82,7 @@ parcelable PrepareModelConfig { * indicating that caching information is not provided, this * token must be ignored. */ byte[] cacheToken; byte[BYTE_SIZE_OF_CACHE_TOKEN] cacheToken; /** * A vector of token / value pairs represent vendor specific * compilation hints or metadata. The provided TokenValuePairs must not Loading neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <aidl/android/hardware/neuralnetworks/Extension.h> #include <aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.h> #include <aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.h> #include <aidl/android/hardware/neuralnetworks/IDevice.h> #include <aidl/android/hardware/neuralnetworks/Memory.h> #include <aidl/android/hardware/neuralnetworks/Model.h> #include <aidl/android/hardware/neuralnetworks/Operand.h> Loading Loading @@ -219,6 +220,7 @@ nn::GeneralResult<std::vector<TokenValuePair>> convert( #endif // NN_AIDL_V4_OR_ABOVE nn::GeneralResult<std::vector<int32_t>> toSigned(const std::vector<uint32_t>& vec); std::vector<uint8_t> toVec(const std::array<uint8_t, IDevice::BYTE_SIZE_OF_CACHE_TOKEN>& token); } // namespace aidl::android::hardware::neuralnetworks::utils Loading Loading
neuralnetworks/aidl/aidl_api/android.hardware.neuralnetworks/current/android/hardware/neuralnetworks/PrepareModelConfig.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ parcelable PrepareModelConfig { long deadlineNs; ParcelFileDescriptor[] modelCache; ParcelFileDescriptor[] dataCache; byte[] cacheToken; byte[32] cacheToken; android.hardware.neuralnetworks.TokenValuePair[] compilationHints; android.hardware.neuralnetworks.ExtensionNameAndPrefix[] extensionNameToPrefix; const int BYTE_SIZE_OF_CACHE_TOKEN = 32; }
neuralnetworks/aidl/android/hardware/neuralnetworks/IDevice.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ interface IDevice { /** * The byte size of the cache token. */ const int BYTE_SIZE_OF_CACHE_TOKEN = 32; const int BYTE_SIZE_OF_CACHE_TOKEN = PrepareModelConfig.BYTE_SIZE_OF_CACHE_TOKEN; /** * The maximum number of files for each type of cache in compilation caching. */ Loading
neuralnetworks/aidl/android/hardware/neuralnetworks/IPreparedModel.aidl +14 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,12 @@ interface IPreparedModel { * appropriate ErrorStatus value. If the inputs to the function are valid and there is no error, * createReusableExecution must construct a reusable execution. * * This method will be called when a client requests a reusable execution with consistent * request and execution config. For single-time execution, * {@link IPreparedModel::executeSynchronouslyWithConfig} or * {@link IPreparedModel::executeFencedWithConfig} is preferred, because the overhead of * setting up a reusable execution can be avoided. * * @param request The input and output information on which the prepared model is to be * executed. * @param config Specifies the execution configuration parameters. Loading @@ -223,6 +229,10 @@ interface IPreparedModel { * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains * more configuration parameters than are passed to executeSynchronously. * * This method is preferred when a client requests a single-time synchronous execution. * For reusable execution with consistent request and execution config, * {@link IPreparedModel::createReusableExecution} must be called. * * @param request The input and output information on which the prepared model is to be * executed. * @param config Specifies the execution configuration parameters. Loading @@ -246,6 +256,10 @@ interface IPreparedModel { * ExecutionConfig} instead of a list of configuration parameters, and ExecutionConfig contains * more configuration parameters than are passed to executeFenced. * * This method is preferred when a client requests a single-time fenced execution. * For reusable execution with consistent request and execution config, * {@link IPreparedModel::createReusableExecution} must be called. * * @param request The input and output information on which the prepared model is to be * executed. The outputs in the request must have fully specified dimensions. * @param waitFor A vector of sync fence file descriptors. Execution must not start until all Loading
neuralnetworks/aidl/android/hardware/neuralnetworks/PrepareModelConfig.aidl +7 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,11 @@ import android.hardware.neuralnetworks.TokenValuePair; */ @VintfStability parcelable PrepareModelConfig { /** * The byte size of the cache token. */ const int BYTE_SIZE_OF_CACHE_TOKEN = 32; /** * Indicates the intended execution behavior of a prepared model. */ Loading Loading @@ -66,7 +71,7 @@ parcelable PrepareModelConfig { */ ParcelFileDescriptor[] dataCache; /** * A caching token of length IDevice::BYTE_SIZE_OF_CACHE_TOKEN identifying * A caching token of length BYTE_SIZE_OF_CACHE_TOKEN identifying * the prepared model. The same token will be provided when * retrieving the prepared model from the cache files with * IDevice::prepareModelFromCache. Tokens should be chosen to have a low Loading @@ -77,7 +82,7 @@ parcelable PrepareModelConfig { * indicating that caching information is not provided, this * token must be ignored. */ byte[] cacheToken; byte[BYTE_SIZE_OF_CACHE_TOKEN] cacheToken; /** * A vector of token / value pairs represent vendor specific * compilation hints or metadata. The provided TokenValuePairs must not Loading
neuralnetworks/aidl/utils/include/nnapi/hal/aidl/Conversions.h +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <aidl/android/hardware/neuralnetworks/Extension.h> #include <aidl/android/hardware/neuralnetworks/ExtensionNameAndPrefix.h> #include <aidl/android/hardware/neuralnetworks/ExtensionOperandTypeInformation.h> #include <aidl/android/hardware/neuralnetworks/IDevice.h> #include <aidl/android/hardware/neuralnetworks/Memory.h> #include <aidl/android/hardware/neuralnetworks/Model.h> #include <aidl/android/hardware/neuralnetworks/Operand.h> Loading Loading @@ -219,6 +220,7 @@ nn::GeneralResult<std::vector<TokenValuePair>> convert( #endif // NN_AIDL_V4_OR_ABOVE nn::GeneralResult<std::vector<int32_t>> toSigned(const std::vector<uint32_t>& vec); std::vector<uint8_t> toVec(const std::array<uint8_t, IDevice::BYTE_SIZE_OF_CACHE_TOKEN>& token); } // namespace aidl::android::hardware::neuralnetworks::utils Loading