aclGetBoolArraySize

Function

Obtains the size of the aclBoolArray created by calling aclCreateBoolArray.

Prototype

aclnnStatus aclGetBoolArraySize(const aclBoolArray *array, uint64_t *size)

Parameters

Parameter

Input/Output

Description

array

Input

Source aclBoolArray.

size

Output

Size of an aclBoolArray.

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 aclBoolArray.
std::vector<bool> maskData = {true, false};
aclBoolArray *mask = aclCreateBoolArray(maskData.data(), maskData.size());
...
// Obtain the mask size by calling aclGetBoolArraySize.
uint64_t size = 0;
auto ret = aclGetBoolArraySize(mask, &size);     // The obtained mask size is 2.
...
// Destroy the aclBoolArray.
ret = aclDestroyBoolArray(mask);