aclCreateDataBuffer

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function

Creates data of the aclDataBuffer type to describe the memory address and size.

To destroy data of the aclDataBuffer type, call aclDestroyDataBuffer.

Prototype

1
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 is managed by the user. Call aclrtMalloc/aclrtFree or aclrtMallocHost/aclrtFreeHost for memory allocation/deallocation.

size

Input

Memory 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.