acltdtAllocBuf
The
Description
Allocates the shared buffer.
Restrictions
- After the acltdtAllocBuf API is used to allocate a buffer, the length of the data area is the value of the size parameter. Before valid data is entered, the initial value of the valid data size of the buffer is 0. After valid data is entered into the buffer, set the valid data size by calling acltdtSetBufDataLen.
- The buffer allocated by the acltdtAllocBuf call needs to be freed by the acltdtFreeBuf call.
- For the
Atlas 200/300/500 Inference Product , this API can be used only in the following modes:Ascend RC Form
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
size |
Input |
Size of the requested data area, in bytes. The value cannot exceed 4 GB. |
|
type |
Input |
Type of the shared buffer. The options are as follows: typedef enum {
ACL_TDT_NORMAL_MEM = 0,
ACL_TDT_DVPP_MEM
} acltdtAllocBufType; |
|
buf |
Output |
Pointer to the output shared buffer when the allocation is successful. |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.
Parent topic: Shared Buffer Management