[][src]Function onednn_sys::dnnl_memory_map_data

pub unsafe extern "C" fn dnnl_memory_map_data(
    memory: const_dnnl_memory_t,
    mapped_ptr: *mut *mut c_void
) -> dnnl_status_t

Maps a memory object and returns a host-side pointer to a memory buffer with a copy of its contents.

Mapping enables explicit direct access to memory contents for the engines that do not support it implicitly.

Mapping is an exclusive operation - a memory object cannot be used in other operations until this memory object is unmapped.

@note Any primitives working with @p memory should be completed before the memory is mapped. Use dnnl_stream_wait to synchronize the corresponding execution stream.

@note The dnnl_memory_map_data() and dnnl_memory_unmap_data() functions are mainly provided for debug and testing purposes, and their performance may be suboptimal.

@param memory Memory object. @param mapped_ptr Output pointer to the mapped buffer. @returns #dnnl_success on success and a status describing the error otherwise.