aclCreateDataBuffer
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Creates data of the aclDataBuffer type to describe the buffer address and size.
To destroy data of the aclDataBuffer type, call aclDestroyDataBuffer.
Prototype
aclDataBuffer *aclCreateDataBuffer(void *data, size_t size)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
data |
Input |
Pointer to the address of the memory that stores data. data can be set to nullptr, indicating that an empty data type is created. In this case, the value of size must be set to 0. The memory needs to be managed by users. You can call aclrtMalloc/aclrtFree or aclrtMallocHost/aclrtFreeHost to allocate/free memory. |
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. |
Returns
Pointer to data of the aclDataBuffer type.