aclGetIntArraySize
Function
Obtains the size of the aclIntArray created by calling aclCreateIntArray.
Prototype
aclnnStatus aclGetIntArraySize(const aclIntArray *array, uint64_t *size)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
array |
Input |
Source aclIntArray. |
size |
Output |
Size of aclIntArray. |
Returns
0 on success; otherwise, failure. For details about the return codes, see Common APIs and Return Codes.
Possible causes:
- If error code 161001 is returned, array or size is a null pointer.
Constraints
None
Call 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 the valueArray is 4. ... // Destroy the aclIntArray. ret = aclDestroyIntArray(valueArray); |
Parent topic: Basic APIs