acltdtAllocBuf
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
☓ |
☓ |
|
☓ |
|
√ |
|
☓ |
|
☓ |
Description
Allocates the shared buffer.
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.
Prototype
1 | aclError acltdtAllocBuf(size_t size, uint32_t type, acltdtBuf *buf) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
size |
Input |
Memory size of a specified 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;
Currently, only ACL_TDT_NORMAL_MEM is supported. |
buf |
Output |
Shared buffer to be output when the allocation is successful. For details about the type definition, see acltdtBuf. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
For the