Function: update_data_buffer

C Prototype

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

Python Function

ret = acl.update_data_buffer(data_buffer, data, size)

Function Usage

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.

Input Description

data_buffer: int, pointer address of aclDataBuffer.

Call acl.create_data_buffer to create data of the aclDataBuffer type in advance.

The memory needs to be managed by users. You can call acl.rt.malloc/acl.rt.free or acl.rt.malloc_host/acl.rt.free_host to allocate/free memory.

data: int, pointer address for storing the data memory address.

size: int, memory size, in bytes. If an empty tensor is needed, allocate at least 1 byte buffer.

Return Value

ret: int, error code.

Restrictions

None