aclrtSetBufDataLen
Description
Sets the length of the valid data in the shared buffer.
API call sequence: Call aclrtAllocBuf or aclrtCopyBufRef to allocate the shared buffer, call aclrtGetBufData to obtain the memory pointer to and length of the shared buffer, and fill valid data in the memory. Then, call aclrtSetBufDataLen to set the length of the valid data in the shared buffer to a value less than that obtained by aclrtGetBufData.
Prototype
1 | aclError aclrtSetBufDataLen(aclrtMbuf buf, size_t len) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
buf |
Input |
Shared buffer. For details about the type definition, see aclrtMbuf. The shared buffer must be obtained by calling aclrtAllocBuf or aclrtCopyBufRef. |
len |
Input |
Length of valid data, in bytes. |
Returns
0 on success; otherwise, failure. For details, see aclError.