aclrtGetBufDataLen
Function
Obtains the length of the valid data in the shared buffer.
This API is effective only after aclrtSetBufDataLen is called to set the length of the valid data in the shared buffer. Otherwise, the length obtained by calling this API is 0.
Prototype
1 | aclError aclrtGetBufDataLen(aclrtMbuf buf, size_t *len) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
buf |
Input |
Shared buffer. For the type definition, see aclrtMbuf. The shared buffer must be obtained by calling aclrtAllocBuf or aclrtCopyBufRef. |
len |
Output |
Length of valid data, in bytes. |
Returns
0 on success; otherwise, failure. For details, see aclError.