diff options
author | Miao Wang <miaowang@google.com> | 2019-05-16 03:29:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-16 03:29:48 +0000 |
commit | 43ff46e388575ba39401af0b172153867481fa4b (patch) | |
tree | 881fb6a33519ba2e3041dacc7b09b2aa3681e821 | |
parent | 4363637cbd8ca9b782a9ab5e2bfdc95404649910 (diff) | |
parent | e76f098e9c4dbaf52ec0253f487bede6abe7b62f (diff) | |
download | ml-43ff46e388575ba39401af0b172153867481fa4b.tar.gz |
Merge "Update the documentation to specify required alignment for operands in a memory pool." into qt-dev
-rw-r--r-- | nn/runtime/include/NeuralNetworks.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h index c25e3518f..ead75f320 100644 --- a/nn/runtime/include/NeuralNetworks.h +++ b/nn/runtime/include/NeuralNetworks.h @@ -4928,8 +4928,8 @@ enum { ANEURALNETWORKS_BYTE_SIZE_OF_CACHE_TOKEN = 32 }; * runtime and drivers the tensors that define a model. See * {@link ANeuralNetworksModel_setOperandValueFromMemory}. An application * should typically create one shared memory object that contains every constant tensor - * needed to define a model. {@link ANeuralNetworksMemory_createFromFd} can be - * used to create shared memory from a file handle. + * needed to define a model. {@link ANeuralNetworksMemory_createFromFd} can be used to + * create shared memory from a file handle. * {@link ANeuralNetworksMemory_createFromAHardwareBuffer} can be used to * create shared memory from an AHardwareBuffer handle. * @@ -4937,6 +4937,13 @@ enum { ANEURALNETWORKS_BYTE_SIZE_OF_CACHE_TOKEN = 32 }; * an execution. See {@link ANeuralNetworksExecution_setInputFromMemory} * and {@link ANeuralNetworksExecution_setOutputFromMemory}. * + * When calling {@link ANeuralNetworksModel_setOperandValueFromMemory}, + * {@link ANeuralNetworksExecution_setInputFromMemory} and + * {@link ANeuralNetworksExecution_setOutputFromMemory}, each operand in the shared + * memory object must be aligned on a boundary of a byte size that is a multiple + * of the element type byte size, e.g., a tensor with + * {@link ANEURALNETWORKS_TENSOR_FLOAT32} type must be aligned on 4-byte boundary. + * * Available since API level 27. */ typedef struct ANeuralNetworksMemory ANeuralNetworksMemory; |