aclGetIntArraySize
Description
Obtains the size of the aclIntArray created by calling aclCreateIntArray.
Prototype
aclnnStatus aclGetIntArraySize(const aclIntArray *array, uint64_t *size)
Parameter Description
Parameter |
Input/Output |
Description |
|---|---|---|
array |
Input |
Source aclIntArray. |
size |
Output |
Size of aclIntArray. |
Return Value
0 on success; otherwise, failure. For details about the return codes, see Common API Return Codes.
Possible causes:
- Error code 161001: array or size is a null pointer.
Constraints
None.
Example
The following sample code is for reference only. Do not copy and run it.
1 2 3 4 5 6 7 8 9 10 | // Create an aclIntArray. std::vector<int64_t> valueData = {1, 1, 2, 3}; aclIntArray *valueArray = aclCreateIntArray(valueData.data(), valueData.size()); ... // Obtain the size of valueArray by calling aclGetIntArraySize. uint64_t size = 0; auto ret = aclGetIntArraySize(valueArray, &size); // The obtained size of valueArray is 4. ... // Destroy the aclIntArray. ret = aclDestroyIntArray(valueArray); |
Parent topic: Common APIs