aclUpdateDataBuffer

Applicability

Product

Supported

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

Description

Updates the buffer and size of the data in the aclDataBuffer.

After the aclDataBuffer is updated, free the aclDataBuffer memory when it is no longer needed to avoid memory leak.

Prototype

aclError aclUpdateDataBuffer(aclDataBuffer *dataBuffer, void *data, size_t size)

Parameters

Parameter

Input/Output

Description

dataBuffer

Input

Pointer to data of the aclDataBuffer type.

Call aclCreateDataBuffer to create data of the aclDataBuffer type in advance.

The memory needs to be managed by users. You can call aclrtMalloc/aclrtFree or aclrtMallocHost/aclrtFreeHost to allocate/free memory.

data

Input

Pointer to the address of the memory that stores data.

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

0 on success; else, failure. For details, see aclError.