aclrtGetBufData
Description
Obtains the pointer to and length of the data area within the shared buffer. You can use this pointer to fill in data.
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 aclrtGetBufData(const aclrtMbuf buf, void **dataPtr, size_t *size) |
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. |
dataPtr |
Output |
Pointer to the data area (address on the device). |
size |
Output |
Length of the data area, in bytes. |
Returns
0 on success; otherwise, failure. For details, see aclError.