aclCreateIntArray

Function Usage

Creates an aclIntArray object as the input parameter for single-operator API execution.

aclCreateIntArray is a framework-defined array structure used to manage and store integer data. You can directly use it without paying attention to its internal implementation.

Prototype

aclIntArray *aclCreateIntArray(const int64_t *value, uint64_t size)

Parameters

Parameter

Input/Output

Description

value

Input

Int64_t pointer on the host. Its value will be copied to the aclIntArray.

size

Input

Length of an integer array. The value is a positive integer.

Returns

Created aclIntArray on success; else, nullptr.

Constraints

  • This API must be used together with aclDestroyIntArray. They are used to create and destroy the aclIntArray, respectively.
  • The size of the aclIntArray can be obtained by calling aclGetIntArraySize.

Examples

The following code examples are for reference only and are not intended for direct copying and execution:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
// Create an aclIntArray.
std::vector<int64_t> sizeData = {1, 1, 2, 3};
aclIntArray *size = aclCreateIntArray(sizeData.data(),sizeData.size());
...
// Use the aclIntArray as the input parameter for single-operator API execution.
auto ret = aclxxXxxGetWorkspaceSize(srcTensor, size, ..., outTensor, ..., &workspaceSize, &executor);
ret = aclxxXxx(...);
...
//Destroy the aclIntArray.
ret = aclDestroyIntArray(size);