aclUpdateDataBuffer

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Updates the memory and size of the data in aclDataBuffer.

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

Prototype

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

data

Input

Pointer to the address of the memory that stores data.

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

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