| 147 | } |
| 148 | |
| 149 | Status CLCommandQueue::EnqueueReadBuffer(cl_mem memory, size_t size_in_bytes, |
| 150 | void* data) { |
| 151 | auto error_code = clEnqueueReadBuffer( |
| 152 | queue_, memory, CL_TRUE, 0, size_in_bytes, data, 0, nullptr, nullptr); |
| 153 | if (error_code != CL_SUCCESS) { |
| 154 | return UnknownError( |
| 155 | absl::StrCat("Failed to read data from GPU (clEnqueueReadBuffer) - ", |
| 156 | CLErrorCodeToString(error_code))); |
| 157 | } |
| 158 | return OkStatus(); |
| 159 | } |
| 160 | |
| 161 | Status CLCommandQueue::WaitForCompletion() { |
| 162 | auto error_code = clFinish(queue_); |
no test coverage detected