aclGetFloatArraySize

Description

Obtains the size of the aclFloatArray created by calling aclCreateFloatArray.

Prototype

aclnnStatus aclGetFloatArraySize(const aclFloatArray *array, uint64_t *size)

Parameter Description

Parameter

Input/Output

Description

array

Input

Source aclFloatArray.

size

Output

Returned size of an aclFloatArray.

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 aclFloatArray.
std::vector<float> scalesData = {1.0, 1.0, 2.0, 2.0};
aclFloatArray *scales = aclCreateFloatArray(scalesData.data(), scalesData.size());
...
// Obtain the size of scales by calling aclGetFloatArraySize.
uint64_t size = 0;
auto ret = aclGetFloatArraySize(scales, &size); // The obtained size of scales is 4.
...
// Destroy the aclFloatArray.
ret = aclDestroyFloatArray(scales);