pub unsafe fn enqueue_map_buffer<T, M, En, Ewl>(
    command_queue: &CommandQueue,
    buffer: M,
    block: bool,
    map_flags: MapFlags,
    offset: usize,
    len: usize,
    wait_list: Option<Ewl>,
    new_event: Option<En>
) -> Result<MemMap<T>>where
    T: OclPrm,
    En: ClNullEventPtr,
    Ewl: ClWaitListPtr,
    M: AsMem<T> + MemCmdAll,
Expand description

Enqueues a command to map a region of the buffer object given by buffer into the host address space and returns a pointer to this mapped region.

SDK Docs

Safety

Caller must ensure that the returned pointer is not used until the map is complete. Use new_event to monitor it. It also must be ensured that memory referred to by the returned pointer is not dropped, reused, or otherwise interfered with until enqueue_unmap_mem_object is called.