aclCreateIntArray
Description
Creates an aclIntArray object as the input parameter for single-operator API calls.
aclCreateIntArray is a built-in array for managing and storing integer data. You can use it without knowing how it works inside.
Prototype
aclIntArray *aclCreateIntArray(const int64_t *value, uint64_t size)
Parameter Description
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. |
Return Value
Created aclIntArray on success; otherwise, 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.
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> sizeData = {1, 1, 2, 3}; aclIntArray *size = aclCreateIntArray(sizeData.data(),sizeData.size()); ... // Use the aclIntArray as the input parameter for single-operator API calls. auto ret = aclxxXxxGetWorkspaceSize(srcTensor, size, ..., outTensor, ..., &workspaceSize, &executor); ret = aclxxXxx(...); ... // Destroy the aclIntArray. ret = aclDestroyIntArray(size); |
Parent topic: Common APIs