| 9358 | #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 |
| 9359 | |
| 9360 | inline cl_int enqueueUnmapMemObject( |
| 9361 | const Memory& memory, |
| 9362 | void* mapped_ptr, |
| 9363 | const vector<Event>* events = nullptr, |
| 9364 | Event* event = nullptr) |
| 9365 | { |
| 9366 | cl_int error; |
| 9367 | CommandQueue queue = CommandQueue::getDefault(&error); |
| 9368 | detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); |
| 9369 | if (error != CL_SUCCESS) { |
| 9370 | return error; |
| 9371 | } |
| 9372 | |
| 9373 | cl_event tmp; |
| 9374 | cl_int err = detail::errHandler( |
| 9375 | ::clEnqueueUnmapMemObject( |
| 9376 | queue(), memory(), mapped_ptr, |
| 9377 | (events != nullptr) ? (cl_uint)events->size() : 0, |
| 9378 | (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, |
| 9379 | (event != nullptr) ? &tmp : nullptr), |
| 9380 | __ENQUEUE_UNMAP_MEM_OBJECT_ERR); |
| 9381 | |
| 9382 | if (event != nullptr && err == CL_SUCCESS) |
| 9383 | *event = tmp; |
| 9384 | |
| 9385 | return err; |
| 9386 | } |
| 9387 | |
| 9388 | #if CL_HPP_TARGET_OPENCL_VERSION >= 200 |
| 9389 | /** |
nothing calls this directly
no test coverage detected