[][src]Function onednn_sys::dnnl_memory_create

pub unsafe extern "C" fn dnnl_memory_create(
    memory: *mut dnnl_memory_t,
    memory_desc: *const dnnl_memory_desc_t,
    engine: dnnl_engine_t,
    handle: *mut c_void
) -> dnnl_status_t

Creates a memory object.

Unless @p handle is equal to DNNL_MEMORY_NONE, the constructed memory object will have the underlying buffer set. In this case, the buffer will be initialized as if dnnl_memory_set_data_handle() had been called.

@sa dnnl_memory_set_data_handle()

@param memory Output memory object. @param memory_desc Memory descriptor. @param engine Engine to use. @param handle Handle of the memory buffer to use as an underlying storage. - A pointer to the user-allocated buffer. In this case the library doesn't own the buffer. - The DNNL_MEMORY_ALLOCATE special value. Instructs the library to allocate the buffer for the memory object. In this case the library owns the buffer. - DNNL_MEMORY_NONE to create dnnl_memory without an underlying buffer. @returns #dnnl_success on success and a status describing the error otherwise.