Creates data of the aclDataBuffer type to describe the buffer address and size. This API is synchronous.
To destroy data of the aclDataBuffer type, call aclDestroyDataBuffer.
aclDataBuffer *aclCreateDataBuffer(void *data, size_t size)
Parameter |
Input/Output |
Description |
|---|---|---|
data |
Input |
Pointer to the address of the memory that stores data. The memory is managed by the user. Call aclrtMalloc/aclrtFree or aclrtMallocHost/aclrtFreeHost for memory allocation/deallocation. |
size |
Input |
Buffer size in bytes. If you need to use an empty tensor, set the minimum memory size to 1 byte during memory allocation to ensure normal running of subsequent services. |
Pointer to data of the aclDataBuffer type.