Skip to main content

araclient

Struct araclient 

Source
pub struct araclient {
Show 40 fields pub dv_stringify_status_code: Result<unsafe extern "C" fn(status_code: dv_status_code_t) -> *const c_char, Error>, pub dv_session_create_via_unix_socket: Result<unsafe extern "C" fn(socket_file_path: *const c_char, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>, pub dv_session_create_via_named_pipe: Result<unsafe extern "C" fn(named_pipe: *const c_char, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>, pub dv_session_create_via_tcp_ipv4_socket: Result<unsafe extern "C" fn(tcp_ip_addr: *const c_char, port: c_int, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>, pub dv_session_close: Result<unsafe extern "C" fn(session: *mut dv_session_t) -> dv_status_code_t, Error>, pub dv_shmfd_register: Result<unsafe extern "C" fn(session: *mut dv_session_t, fd: c_int, size: u32, offset: u32, fd_type: c_int, shm_desc: *mut *mut dv_shm_descriptor_t) -> dv_status_code_t, Error>, pub dv_shmfd_unregister: Result<unsafe extern "C" fn(shm_desc: *mut dv_shm_descriptor_t) -> dv_status_code_t, Error>, pub dv_endpoint_get_list: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: *mut c_int) -> dv_status_code_t, Error>, pub dv_endpoint_get_default_group: Result<unsafe extern "C" fn(session: *mut dv_session_t, grp: dv_endpoint_default_group_t, ep_grp: *mut *mut dv_endpoint_t) -> dv_status_code_t, Error>, pub dv_endpoint_create_group: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: c_int, ep_grp: *mut *mut dv_endpoint_t) -> dv_status_code_t, Error>, pub dv_endpoint_free_group: Result<unsafe extern "C" fn(ep_grp: *mut dv_endpoint_t) -> dv_status_code_t, Error>, pub dv_endpoint_check_status: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, state: *mut dv_endpoint_state_t) -> dv_status_code_t, Error>, pub dv_endpoint_get_dram_statistics: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_dram_stats: *mut *mut dv_endpoint_dram_statistics_t, ep_count: *mut c_int) -> dv_status_code_t, Error>, pub dv_endpoint_free_dram_statistics: Result<unsafe extern "C" fn(ep_dram_stats: *mut dv_endpoint_dram_statistics_t, count: c_int) -> dv_status_code_t, Error>, pub dv_endpoint_get_statistics: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_stats: *mut *mut dv_endpoint_statistics_t, ep_count: *mut c_int) -> dv_status_code_t, Error>, pub dv_endpoint_free_statistics: Result<unsafe extern "C" fn(ep_stats: *mut dv_endpoint_statistics_t, count: c_int) -> dv_status_code_t, Error>, pub dv_model_load_from_file: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_load_from_blob: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_blob: *mut dv_blob_t, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_unload: Result<unsafe extern "C" fn(model: *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_get_parameters_from_file: Result<unsafe extern "C" fn(model_file_path: *const c_char, model: *mut *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_get_parameters_from_blob: Result<unsafe extern "C" fn(model_blob: *mut dv_blob_t, model: *mut *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_free_parameters: Result<unsafe extern "C" fn(model: *mut dv_model_t) -> dv_status_code_t, Error>, pub dv_model_set_llm_cfg_params: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, model: *mut dv_model_t, llm_cfg_update: *mut dv_llm_cfg_upd_req_t) -> dv_status_code_t, Error>, pub dv_infer_sync: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>, pub dv_infer_async: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>, pub dv_infer_wait_for_all_completion: Result<unsafe extern "C" fn(session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, completed_inf_list: *mut *mut dv_infer_request_t, completed_inf_count: *mut c_int) -> dv_status_code_t, Error>, pub dv_infer_wait_for_completion: Result<unsafe extern "C" fn(session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>, pub dv_infer_get_req_id: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t, req_id: *mut u64) -> dv_status_code_t, Error>, pub dv_infer_free: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t) -> dv_status_code_t, Error>, pub dv_infer_get_inflight_count: Result<unsafe extern "C" fn(session: *mut dv_session_t, count: *mut c_int) -> dv_status_code_t, Error>, pub dv_get_endpoint_busyness: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, is_busy: *mut bool) -> dv_status_code_t, Error>, pub dv_infer_sync_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t) -> dv_status_code_t, Error>, pub dv_infer_async_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t) -> dv_status_code_t, Error>, pub dv_fetch_outputs_by_layer_name: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t, src_op_layer_name: *mut c_char, op_blobs: *mut *mut dv_blob_t, num_op_blobs: *mut c_int) -> dv_status_code_t, Error>, pub dv_model_load_from_file_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t) -> dv_status_code_t, Error>, pub dv_model_load_from_blob_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, blob: *mut dv_blob_t, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t) -> dv_status_code_t, Error>, pub dv_exchange_current_version_details: Result<unsafe extern "C" fn(session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8) -> dv_status_code_t, Error>, pub dv_retrieve_version_details: Result<unsafe extern "C" fn(session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8) -> dv_status_code_t, Error>, pub dv_get_client_lib_version: Result<unsafe extern "C" fn(client_lib_version: *mut dv_version_t) -> dv_status_code_t, Error>, pub dv_free_version_details: Result<unsafe extern "C" fn(product_version: *mut dv_product_version_t) -> dv_status_code_t, Error>, /* private fields */
}

Fields§

§dv_stringify_status_code: Result<unsafe extern "C" fn(status_code: dv_status_code_t) -> *const c_char, Error>§dv_session_create_via_unix_socket: Result<unsafe extern "C" fn(socket_file_path: *const c_char, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>§dv_session_create_via_named_pipe: Result<unsafe extern "C" fn(named_pipe: *const c_char, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>§dv_session_create_via_tcp_ipv4_socket: Result<unsafe extern "C" fn(tcp_ip_addr: *const c_char, port: c_int, session: *mut *mut dv_session_t) -> dv_status_code_t, Error>§dv_session_close: Result<unsafe extern "C" fn(session: *mut dv_session_t) -> dv_status_code_t, Error>§dv_shmfd_register: Result<unsafe extern "C" fn(session: *mut dv_session_t, fd: c_int, size: u32, offset: u32, fd_type: c_int, shm_desc: *mut *mut dv_shm_descriptor_t) -> dv_status_code_t, Error>§dv_shmfd_unregister: Result<unsafe extern "C" fn(shm_desc: *mut dv_shm_descriptor_t) -> dv_status_code_t, Error>§dv_endpoint_get_list: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: *mut c_int) -> dv_status_code_t, Error>§dv_endpoint_get_default_group: Result<unsafe extern "C" fn(session: *mut dv_session_t, grp: dv_endpoint_default_group_t, ep_grp: *mut *mut dv_endpoint_t) -> dv_status_code_t, Error>§dv_endpoint_create_group: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: c_int, ep_grp: *mut *mut dv_endpoint_t) -> dv_status_code_t, Error>§dv_endpoint_free_group: Result<unsafe extern "C" fn(ep_grp: *mut dv_endpoint_t) -> dv_status_code_t, Error>§dv_endpoint_check_status: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, state: *mut dv_endpoint_state_t) -> dv_status_code_t, Error>§dv_endpoint_get_dram_statistics: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_dram_stats: *mut *mut dv_endpoint_dram_statistics_t, ep_count: *mut c_int) -> dv_status_code_t, Error>§dv_endpoint_free_dram_statistics: Result<unsafe extern "C" fn(ep_dram_stats: *mut dv_endpoint_dram_statistics_t, count: c_int) -> dv_status_code_t, Error>§dv_endpoint_get_statistics: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_stats: *mut *mut dv_endpoint_statistics_t, ep_count: *mut c_int) -> dv_status_code_t, Error>§dv_endpoint_free_statistics: Result<unsafe extern "C" fn(ep_stats: *mut dv_endpoint_statistics_t, count: c_int) -> dv_status_code_t, Error>§dv_model_load_from_file: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_load_from_blob: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_blob: *mut dv_blob_t, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_unload: Result<unsafe extern "C" fn(model: *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_get_parameters_from_file: Result<unsafe extern "C" fn(model_file_path: *const c_char, model: *mut *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_get_parameters_from_blob: Result<unsafe extern "C" fn(model_blob: *mut dv_blob_t, model: *mut *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_free_parameters: Result<unsafe extern "C" fn(model: *mut dv_model_t) -> dv_status_code_t, Error>§dv_model_set_llm_cfg_params: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, model: *mut dv_model_t, llm_cfg_update: *mut dv_llm_cfg_upd_req_t) -> dv_status_code_t, Error>§dv_infer_sync: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>§dv_infer_async: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>§dv_infer_wait_for_all_completion: Result<unsafe extern "C" fn(session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, completed_inf_list: *mut *mut dv_infer_request_t, completed_inf_count: *mut c_int) -> dv_status_code_t, Error>§dv_infer_wait_for_completion: Result<unsafe extern "C" fn(session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t) -> dv_status_code_t, Error>§dv_infer_get_req_id: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t, req_id: *mut u64) -> dv_status_code_t, Error>§dv_infer_free: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t) -> dv_status_code_t, Error>§dv_infer_get_inflight_count: Result<unsafe extern "C" fn(session: *mut dv_session_t, count: *mut c_int) -> dv_status_code_t, Error>§dv_get_endpoint_busyness: Result<unsafe extern "C" fn(session: *mut dv_session_t, ep: *mut dv_endpoint_t, is_busy: *mut bool) -> dv_status_code_t, Error>§dv_infer_sync_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t) -> dv_status_code_t, Error>§dv_infer_async_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t) -> dv_status_code_t, Error>§dv_fetch_outputs_by_layer_name: Result<unsafe extern "C" fn(inf_obj: *mut dv_infer_request_t, src_op_layer_name: *mut c_char, op_blobs: *mut *mut dv_blob_t, num_op_blobs: *mut c_int) -> dv_status_code_t, Error>§dv_model_load_from_file_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t) -> dv_status_code_t, Error>§dv_model_load_from_blob_with_options: Result<unsafe extern "C" fn(session: *mut dv_session_t, endpt: *mut dv_endpoint_t, blob: *mut dv_blob_t, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t) -> dv_status_code_t, Error>§dv_exchange_current_version_details: Result<unsafe extern "C" fn(session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8) -> dv_status_code_t, Error>§dv_retrieve_version_details: Result<unsafe extern "C" fn(session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8) -> dv_status_code_t, Error>§dv_get_client_lib_version: Result<unsafe extern "C" fn(client_lib_version: *mut dv_version_t) -> dv_status_code_t, Error>§dv_free_version_details: Result<unsafe extern "C" fn(product_version: *mut dv_product_version_t) -> dv_status_code_t, Error>

Implementations§

Source§

impl araclient

Source

pub unsafe fn new<P>(path: P) -> Result<Self, Error>
where P: AsRef<OsStr>,

Source

pub unsafe fn from_library<L>(library: L) -> Result<Self, Error>
where L: Into<Library>,

Source

pub unsafe fn dv_stringify_status_code( &self, status_code: dv_status_code_t, ) -> *const c_char

Stringify status code \param[in] status_code : status code \param[out] status : status code as string

Source

pub unsafe fn dv_session_create_via_unix_socket( &self, socket_file_path: *const c_char, session: *mut *mut dv_session_t, ) -> dv_status_code_t

Create a session to the server using unix file socket Returns DV_SUCCESS on success, else error \param[in] socket_file_path : server unix socket path \param[out] session : session handle returned by api

Source

pub unsafe fn dv_session_create_via_named_pipe( &self, named_pipe: *const c_char, session: *mut *mut dv_session_t, ) -> dv_status_code_t

Create a session to the server using windows named pipe Returns DV_SUCCESS on success, else error \param[in] named_pipe : server pipe \param[out] session : session handle returned by api

Source

pub unsafe fn dv_session_create_via_tcp_ipv4_socket( &self, tcp_ip_addr: *const c_char, port: c_int, session: *mut *mut dv_session_t, ) -> dv_status_code_t

Create a session to the server using TCP/IPv4 sockets Returns DV_SUCCESS on success, else error \param[in] tcp_ip_addr : server ipv4 address \param[in] port : server port \param[out] session : session handle returned by api

Source

pub unsafe fn dv_session_close( &self, session: *mut dv_session_t, ) -> dv_status_code_t

Close the session to the server Returns DV_SUCCESS on success, else error \param[in] session : session handle

Source

pub unsafe fn dv_shmfd_register( &self, session: *mut dv_session_t, fd: c_int, size: u32, offset: u32, fd_type: c_int, shm_desc: *mut *mut dv_shm_descriptor_t, ) -> dv_status_code_t

DV SharedFD API *************************************/ / Register a file descriptor with the server Returns DV_SUCCESS on success, else error \param[in] session : session object \param[in] fd : file fd to share \param[in] size : size to mmap \param[in] offset : file offset \param[in] fd_type : fd type to provide hint to server (reserved) \param[out] shm_desc : shared memory descriptor

Source

pub unsafe fn dv_shmfd_unregister( &self, shm_desc: *mut dv_shm_descriptor_t, ) -> dv_status_code_t

Un-register shared file with the server Returns DV_SUCCESS on success, else error \param[in] shm_desc : shared buffer descriptor

Source

pub unsafe fn dv_endpoint_get_list( &self, session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: *mut c_int, ) -> dv_status_code_t

Get the list of endpoints connected to the server Endpoint list memory is allocated by the api. It also returns the endpoint count connected to server Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[out] ep_list : connected endpoint list returned by server \param[out] ep_count : number of endpoint connected to server

Source

pub unsafe fn dv_endpoint_get_default_group( &self, session: *mut dv_session_t, grp: dv_endpoint_default_group_t, ep_grp: *mut *mut dv_endpoint_t, ) -> dv_status_code_t

Get the default endpoint group supported by server. Type of default group supported is defined in enum DV_ENDPOINT_DEFAULT_GROUP. API allocates the memory for the endpoint configuration of the group. Application needs to free the memory using dv_endpoint_free_group() Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] grp : enum as defined in enum DV_ENDPOINT_DEFAULT_GROUP \param[out] ep_grp : endpoint group handle

Source

pub unsafe fn dv_endpoint_create_group( &self, session: *mut dv_session_t, ep_list: *mut *mut dv_endpoint_t, ep_count: c_int, ep_grp: *mut *mut dv_endpoint_t, ) -> dv_status_code_t

Create custom endpoint group from the endpoints connected to the server API allocates the memory for the endpoint configuration of the group. Application needs to free the memory using dv_endpoint_free_group() Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] ep_list : endpoint list for which custom group needs to be created \param[in] ep_count : number of endpoint in the list \param[out] ep_grp : endpoint group handle

Source

pub unsafe fn dv_endpoint_free_group( &self, ep_grp: *mut dv_endpoint_t, ) -> dv_status_code_t

Free the default/custom endpoint group Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[out] ep_list : connected endpoint list returned by server \param[out] ep_count : number of endpoint connected to server

Source

pub unsafe fn dv_endpoint_check_status( &self, session: *mut dv_session_t, ep: *mut dv_endpoint_t, state: *mut dv_endpoint_state_t, ) -> dv_status_code_t

Detects endpoint state \param[in] session : session handle \param[in] ep : endpoint handle \param[out] state : endpoint state

Source

pub unsafe fn dv_endpoint_get_dram_statistics( &self, session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_dram_stats: *mut *mut dv_endpoint_dram_statistics_t, ep_count: *mut c_int, ) -> dv_status_code_t

Get the dram usage statistics for the endpoint/endpoint group Server provides the snapshot of the endpoint dram usage at the time of request. Passing NULL to endpoint handle will provide dram statistics for all the endpoint connected to the server Memory for the statistics is allocated by API and dv_endpoint_free_dram_statistics() is needed to free up the memory Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] ep : endpoint/endpoint group handle for particular endpoint or endpoint group or NULL for all endpoints \param[out] ep_dram_stats : list of endpoint dram statistics \param[out] ep_count : number of endpoint for which dram statistics is provided

Source

pub unsafe fn dv_endpoint_free_dram_statistics( &self, ep_dram_stats: *mut dv_endpoint_dram_statistics_t, count: c_int, ) -> dv_status_code_t

Free the endpoint dram stats memory allocated in dv_endpoint_get_dram_statistics() Returns DV_SUCCESS on success, else error \param[in] ep_dram_stats : endpoint dram statistics to free \param[in] count : number of items to free

Source

pub unsafe fn dv_endpoint_get_statistics( &self, session: *mut dv_session_t, ep: *mut dv_endpoint_t, ep_stats: *mut *mut dv_endpoint_statistics_t, ep_count: *mut c_int, ) -> dv_status_code_t

Get all the statistics for the endpoint/endpoint group Server provides the snapshot of the endpoint statistics at the time of request. Passing NULL to endpoint handle will provide statistics for all the endpoint connected to the server Memory for the statistics is allocated by API and dv_endpoint_free_statistics() is needed to free up the memory Returns DV_SUCCESS on success, else error

§Notes on usage

dv_model_statistics_t member of dv_endpoint_statistics_t contains 2 fields - uint32_t model and void* model_handle. This API will return stats of all models loaded across all clients - the uint32_t model will always hold a value and is an server generated id. The value of the void* model_handle member can be compared to the handle member of dv_model_t to map dv_model_t objects to their corresponding dv_model_statistics_t objects.

\param[in] session : session handle \param[in] ep : endpoint/endpoint group handle for particular endpoint or endpoint group or NULL for all endpoints \param[out] ep_stats : list of endpoint statistics \param[out] ep_count : number of endpoint for which statistics is provided

Source

pub unsafe fn dv_endpoint_free_statistics( &self, ep_stats: *mut dv_endpoint_statistics_t, count: c_int, ) -> dv_status_code_t

Free the endpoint stats memory allocated in dv_endpoint_get_statistics() Returns DV_SUCCESS on success, else error \param[in] ep_stats : endpoint statistics list to free \param[in] count : number of items to free

Source

pub unsafe fn dv_model_load_from_file( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t, ) -> dv_status_code_t

Creates a model object and load model contents from file and transfer it to endpoint Model object contains the model handle and model parameters. dv_model_get_loaded_endpoint_list returns the list of endpoints (individual device dv_endpoint_t handles) on which the model was successfully loaded.

If model load fails on all individual devices representing endpt, the API call will error out.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model_file_path : model file path \param[in] priority : model priority [unused] \param[in] model_name : model name [unused] \param[out] model_handle : model handle returned by server

Source

pub unsafe fn dv_model_load_from_blob( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_blob: *mut dv_blob_t, model_name: *const c_char, priority: dv_model_priority_level_t, model_handle: *mut *mut dv_model_t, ) -> dv_status_code_t

Creates a model object and load model contents from blob and transfer it to endpoint Model object contains the model handle and model parameters. dv_model_get_loaded_endpoint_list returns the list of endpoints (individual device dv_endpoint_t handles) on which the model was successfully loaded.

If model load fails on all individual devices representing endpt, the API call will error out.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model_blob : model blob \param[in] priority : model priority [unused] \param[in] model_name : model name [unused] \param[out] model_handle : model handle returned by server

Source

pub unsafe fn dv_model_unload(&self, model: *mut dv_model_t) -> dv_status_code_t

Unloads a model from the endpoint Returns DV_SUCCESS on success, else error \param[in] model : model handle

Source

pub unsafe fn dv_model_get_parameters_from_file( &self, model_file_path: *const c_char, model: *mut *mut dv_model_t, ) -> dv_status_code_t

Get the model parameters from model file without loading the model to endpoint(s) API allocates memory for the parameters. Application can free it by calling dv_model_free_paramaters This is a utility function, useful to get model parameters without loading the model to endpoint(s). The model object returned by the api cannot be used Returns DV_SUCCESS on success, else error \param[in] model_file_path : model file path \param[in] model : model parameters

Source

pub unsafe fn dv_model_get_parameters_from_blob( &self, model_blob: *mut dv_blob_t, model: *mut *mut dv_model_t, ) -> dv_status_code_t

Get the model parameters from model blob without loading the model onto endpoint(s) API allocates memory for the parameters. Application can free it by calling dv_model_free_paramaters This is a utility function, useful to get model parameters without loading the model to endpoint(s) Returns DV_SUCCESS on success, else error \param[in] model_blob : model blob \param[in] model : model parameters

Source

pub unsafe fn dv_model_free_parameters( &self, model: *mut dv_model_t, ) -> dv_status_code_t

Free the memory allocations for model parameter made by dv_model_get_parameters_* call Returns DV_SUCCESS on success, else error \param[in] model : model handle

Source

pub unsafe fn dv_model_set_llm_cfg_params( &self, session: *mut dv_session_t, ep: *mut dv_endpoint_t, model: *mut dv_model_t, llm_cfg_update: *mut dv_llm_cfg_upd_req_t, ) -> dv_status_code_t

Pass pre/post processing flags and params to proxy/mcp \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model : model handle // currently unused by proxy \param[in] llm_cfg_update : dv_llm_cfg_upd_req_t type representing pre/post processing flags and params

Source

pub unsafe fn dv_infer_sync( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t, ) -> dv_status_code_t

Submit an synchronous inference for a model to an endpoint(group) This is a blocking call, it returns when inference is completed (success/error) or a timeout has occurred Input and output blobs should be provided as per input and output parameter provided by model Inference object memory will be allocated by API and can be freed upon calling dv_infer_free() Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model : model handle \param[in] ip_array : an array of input blob descriptor \param[in] op_array : an array of output blob descriptor \param[in] timeout : maximum time in mili seconds to wait for request to complete \param[in] enable_stats : enable stats for the inference request (deprecated) \param[out] inf_obj : inference object

Source

pub unsafe fn dv_infer_async( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, enable_stats: bool, inf_obj: *mut *mut dv_infer_request_t, ) -> dv_status_code_t

Submit an asynchronous inference for a model to an endpoint(group) Server returns a inference request id which can be used to get the completion status or wait upon for compleetion after the call. Input and output blobs should be provided as per input and output parameter provided by model Inference object memory will be allocated by API and can be freed upon calling dv_infer_free() Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model : model handle \param[in] ip_array : an array of input blob descriptor \param[in] op_array : an array of output blob descriptor \param[in] enable_stats : enable stats for the inference request (deprecated) \param[out] inf_obj : inference object

Source

pub unsafe fn dv_infer_wait_for_all_completion( &self, session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, completed_inf_list: *mut *mut dv_infer_request_t, completed_inf_count: *mut c_int, ) -> dv_status_code_t

Monitor multiple inference request object and wait until, all of the request updates/changes run status If the list is empty it waits until, atleast one inference request submitted in the session changes run status and API keeps track of status change for a inference request and run status is reported only once.

For non-empty request list, application needs to remove the completed inference object from the list. Request completion status can be reported multiple times.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] inf_id_list : inference request object list \param[in] inf_id_count : number of inference request to monitor \param[in] timeout : maximum time in mili seconds to wait for inference request to change status; defaults to 60 seconds in case timeout is passed as -1

Source

pub unsafe fn dv_infer_wait_for_completion( &self, session: *mut dv_session_t, inf_obj_list: *mut *mut dv_infer_request_t, inf_obj_count: c_int, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t, ) -> dv_status_code_t

Monitor multiple inference request object and wait until, atleast one of the request updates/changes run status If the list is empty it waits until, atleast one inference request submitted in the session changes run status and API keeps track of status change for a inference request and run status is reported only once.

For non-empty request list, application needs to remove the completed inference object from the list. Request completion status can be reported multiple times.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] inf_id_list : inference request object list \param[in] inf_id_count : number of inference request to monitor \param[in] timeout : maximum time in mili seconds to wait for inference request to change status; defaults to 60 seconds in case timeout is passed as -1 \param[out] inf_obj : inference id for which the state is changed

Source

pub unsafe fn dv_infer_get_req_id( &self, inf_obj: *mut dv_infer_request_t, req_id: *mut u64, ) -> dv_status_code_t

Returns the request id of an inference that is sent by the client. The request id returned will be the same printed in logs if the proxy is passed the -t flag.

If the inf_obj is null or if inf_obj->handle is null, DV_INVALID_HOST_PTR is returned. The req_id argument is not set to any value in this case.

If return value is DV_SUCCESS req_id will contain the request id of the inference request sent to kinara inference proxy.

This api is not thread safe. Calling this API on an inference handle that has already been dv_infer_free’d is incorrect and will result in undefined behaviour.

\param[in] inf_obj : inference request handle \param[out] req_id : request id of the inference request \since r6.1.1

Source

pub unsafe fn dv_infer_free( &self, inf_obj: *mut dv_infer_request_t, ) -> dv_status_code_t

Finish the life cycle for the inference request. API will free up the associated memory for the inference request and will no longer be accessible. After completion, any operation on the inference request will be invalid. Returns DV_SUCCESS on success, else error \param[in] inf_obj : inference object

Source

pub unsafe fn dv_infer_get_inflight_count( &self, session: *mut dv_session_t, count: *mut c_int, ) -> dv_status_code_t

Returns the number of inflight inference requests for the session object for which the client library has not recieved a response from the proxy server. \param[in] session : session handle \param[out] count : number of inference requests in flight \since r5.3

Source

pub unsafe fn dv_get_endpoint_busyness( &self, session: *mut dv_session_t, ep: *mut dv_endpoint_t, is_busy: *mut bool, ) -> dv_status_code_t

§Get the busyness for the endpoint Server provides busyness of any one endpoint at the time of request Memory for is_busy bool variable should be provided by client app Returns DV_SUCCESS on success, else error Notes on usage

\param[in] session : session handle \param[in] ep : endpoint handle for particular endpoint \param[out] is_busy : will return true if endpoint is busy else false

Source

pub unsafe fn dv_infer_sync_with_options( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, timeout: c_int, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t, ) -> dv_status_code_t

Source

pub unsafe fn dv_infer_async_with_options( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model: *mut dv_model_t, ip_array: *mut dv_blob_t, op_array: *mut dv_blob_t, inf_obj: *mut *mut dv_infer_request_t, infer_options: *mut dv_infer_options_t, ) -> dv_status_code_t

Source

pub unsafe fn dv_fetch_outputs_by_layer_name( &self, inf_obj: *mut dv_infer_request_t, src_op_layer_name: *mut c_char, op_blobs: *mut *mut dv_blob_t, num_op_blobs: *mut c_int, ) -> dv_status_code_t

Get output blob for given output layer names

API is available from r1.2 release onwards Returns an array of output blobs for a given layer name Api should be called by passing infer handle for a successfully run inference Freeing infer handle will free memory pointed by output_blobs \param[in] inf_obj infer request handle received after running inference successfully \param[in] src_op_layer_name source graph output layer name, as specified in model output layer params struct \param[out] op_blobs array of output blobs for given src_op_layer_name \param[out] num_op_blobs number of output blobs in op_blobs

Source

pub unsafe fn dv_model_load_from_file_with_options( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, model_file_path: *const c_char, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t, ) -> dv_status_code_t

Creates a model object and load model contents from blob and transfer it to endpoint Model object contains the model handle and model parameters. dv_model_get_loaded_endpoint_list returns the list of endpoints (individual device dv_endpoint_t handles) on which the model was successfully loaded.

If model load fails on all individual devices representing endpt, the API call will error out.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model_file_path : path to model file \param[out] model_handle : model handle returned by server \param[in] options : model load options \since r6.0

Source

pub unsafe fn dv_model_load_from_blob_with_options( &self, session: *mut dv_session_t, endpt: *mut dv_endpoint_t, blob: *mut dv_blob_t, model_handle: *mut *mut dv_model_t, options: *mut dv_model_load_options_t, ) -> dv_status_code_t

Creates a model object and load model contents from blob and transfer it to endpoint Model object contains the model handle and model parameters. dv_model_get_loaded_endpoint_list returns the list of endpoints (individual device dv_endpoint_t handles) on which the model was successfully loaded.

If model load fails on all individual devices representing endpt, the API call will error out.

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[in] endpt : endpoint handle \param[in] model_blob : dv_blob_t of the model \param[in] options : model load options \param[out] model_handle : model handle returned by server \since r6.0

Source

pub unsafe fn dv_exchange_current_version_details( &self, session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8, ) -> dv_status_code_t

api gives current version details of model, driver, proxy, firmware version to client

Returns DV_SUCCESS on success, else error \param[in] session : session handle \param[out] product_version : product versions \param[out] product_count : number of product version sent

Source

pub unsafe fn dv_retrieve_version_details( &self, session: *mut dv_session_t, product_version: *mut *mut dv_product_version_t, product_count: *mut u8, ) -> dv_status_code_t

api gives all supported version details of model, driver, proxy, firmware version to client

Returns DV_SUCCESS on success, else error \param[in] product_version : list of versions

Source

pub unsafe fn dv_get_client_lib_version( &self, client_lib_version: *mut dv_version_t, ) -> dv_status_code_t

api gives current running version of client library

Returns DV_SUCCESS on success, else error \param[in] client_lib_version : fill struct with client library version

Source

pub unsafe fn dv_free_version_details( &self, product_version: *mut dv_product_version_t, ) -> dv_status_code_t

api deletes memory created by dv_exchange_current_version_details or dv_retrieve_version_details apis

Returns DV_SUCCESS on success, else error \param[in] product_version : list of versions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.