acltdtAllocBuf
Applicability
|
Product |
Supported |
|---|---|
|
|
x |
|
|
x |
|
|
√ |
|
|
x |
|
|
x |
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.
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; |
|
buf |
Output |
Shared buffer to be output when the allocation is successful. |
Returns
0 on success; else, failure. For details, see aclError.
Restrictions
- For the
Atlas 200I/500 A2 inference products , this API can be used only in theAscend RC .