/* automatically generated by rust-bindgen 0.71.1 */
use crate::*;
pub mod dnnl_sycl_interop_memory_kind_t {
#[doc = " Memory allocation kind."]
pub type Type = ::std::os::raw::c_uint;
#[doc = " USM (device, shared, host, or unknown) memory allocation kind - default."]
pub const dnnl_sycl_interop_usm: Type = 0;
#[doc = " Buffer memory allocation kind."]
pub const dnnl_sycl_interop_buffer: Type = 1;
}
unsafe extern "C" {
#[doc = " Creates an engine associated with a SYCL device and a SYCL context.\n\n @param engine Output engine.\n @param device Pointer to the SYCL device to use for the engine.\n @param context Pointer to the SYCL context to use for the engine.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_engine_create(
engine: *mut dnnl_engine_t,
device: *const ::std::os::raw::c_void,
context: *const ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Returns the SYCL context associated with an engine.\n\n @param engine Engine to query.\n @param context Pointer to the underlying SYCL context of the engine.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_engine_get_context(
engine: dnnl_engine_t,
context: *mut *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Returns the SYCL device associated with an engine.\n\n @param engine Engine to query.\n @param device Pointer to the underlying SYCL device of the engine.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_engine_get_device(
engine: dnnl_engine_t,
device: *mut *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Creates a memory object.\n\n Unless @p handle is equal to DNNL_MEMORY_NONE or DNNL_MEMORY_ALLOCATE, the\n constructed memory object will have the underlying buffer set. In this\n case, the buffer will be initialized as if:\n - dnnl_memory_set_data_handle() had been called, if @p memory_kind is equal\n to dnnl_sycl_interop_usm, or\n - dnnl_sycl_interop_memory_set_buffer() has been called, if @p memory_kind\n is equal to dnnl_sycl_interop_buffer.\n\n @param memory Output memory object.\n @param memory_desc Memory descriptor.\n @param engine Engine to use.\n @param memory_kind Memory allocation kind to specify the type of handle.\n @param handle Handle of the memory buffer to use as an underlying storage.\n - A USM pointer to the user-allocated buffer. In this case the library\n doesn't own the buffer. Requires @p memory_kind to be equal to\n dnnl_sycl_interop_usm.\n - A pointer to SYCL buffer. In this case the library doesn't own the\n buffer. Requires @p memory_kind be equal to be equal to\n dnnl_sycl_interop_buffer.\n - The DNNL_MEMORY_ALLOCATE special value. Instructs the library to\n allocate the buffer that corresponds to the memory allocation kind\n @p memory_kind for the memory object. In this case the library\n owns the buffer.\n - The DNNL_MEMORY_NONE specific value. Instructs the library to\n create memory object without an underlying buffer.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_memory_create(
memory: *mut dnnl_memory_t,
memory_desc: const_dnnl_memory_desc_t,
engine: dnnl_engine_t,
memory_kind: dnnl_sycl_interop_memory_kind_t::Type,
handle: *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Returns the memory allocation kind associated with a memory object.\n\n @param memory Memory to query.\n @param memory_kind Output underlying memory allocation kind of the memory\n object.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_memory_get_memory_kind(
memory: const_dnnl_memory_t,
memory_kind: *mut dnnl_sycl_interop_memory_kind_t::Type,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Sets a SYCL buffer for a memory object.\n\n @param memory Memory object.\n @param buffer SYCL buffer to be set in the memory object.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_memory_set_buffer(
memory: dnnl_memory_t,
buffer: *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Creates an execution stream for a given engine associated with a SYCL\n queue.\n\n @param stream Output execution stream.\n @param engine Engine to create the execution stream on.\n @param queue SYCL queue to use.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_stream_create(
stream: *mut dnnl_stream_t,
engine: dnnl_engine_t,
queue: *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Returns the SYCL queue associated with an execution stream.\n\n @param stream Execution stream to query.\n @param queue Output SYCL command queue.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_stream_get_queue(
stream: dnnl_stream_t,
queue: *mut *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}
unsafe extern "C" {
#[doc = " Executes computations specified by the primitive in a specified stream and\n returns a SYCL event.\n\n @param primitive Primitive to execute.\n @param stream Stream to use.\n @param nargs Number of arguments.\n @param args Array of arguments. Each argument is an\n <index, #dnnl_memory_t> pair. The index is one of the `DNNL_ARG_*`\n values such as `DNNL_ARG_SRC`. Unless runtime shapes are used (see\n #DNNL_RUNTIME_DIM_VAL), the memory object must have the same memory\n descriptor as that returned by\n #dnnl_primitive_desc_query_md(#dnnl_query_exec_arg_md, index).\n @param deps A pointer to std::vector<sycl::event> that contains\n dependencies.\n @param return_event Output event.\n @returns #dnnl_success on success and a status describing the error\n otherwise."]
pub fn dnnl_sycl_interop_primitive_execute(
primitive: const_dnnl_primitive_t,
stream: dnnl_stream_t,
nargs: ::std::os::raw::c_int,
args: *const dnnl_exec_arg_t,
deps: *const ::std::os::raw::c_void,
return_event: *mut ::std::os::raw::c_void,
) -> dnnl_status_t::Type;
}