Skip to main content

Crate ohos_libqos_sys

Crate ohos_libqos_sys 

Source
Expand description

Bindings to the OpenHarmony QoS (Quality of Service) thread scheduling APIs.

See also the QoS development guide and the Gewu development guide for the on-device LLM inference surface that ships in the same library.

§Feature flags

  • api-12 — Enables bindings for OpenHarmony API-level 12. This is the lowest API level at which any QoS APIs are available — selecting this feature is required to use OH_QoS_SetThreadQoS / OH_QoS_ResetThreadQoS / OH_QoS_GetThreadQoS.
  • api-20 — Enables bindings for OpenHarmony API-level 20, which adds the Gewu on-device LLM inference APIs (OH_QoS_GewuCreateSession, OH_QoS_GewuSubmitRequest, etc.) alongside the existing thread QoS surface.
  • api-21 — Enables bindings for OpenHarmony API-level 21.
  • api-22 — Enables bindings for OpenHarmony API-level 22.
  • api-23 — Enables bindings for OpenHarmony API-level 23.
  • document-features — Document available features when building the documentation

Structs§

OH_QoS_GewuCreateSessionResultapi-12 and api-20
Arguments
OH_QoS_GewuErrorCodeapi-12 and api-20
Gewu error codes.
OH_QoS_GewuSubmitRequestResultapi-12 and api-20
Arguments
QoS_Levelapi-12
Describes the level of QoS.

Constants§

OH_QOS_GEWU_INVALID_REQUEST_IDapi-12 and api-20
OH_QOS_GEWU_INVALID_SESSION_IDapi-12 and api-20

Functions§

OH_QoS_GetThreadQoSapi-12
Obtains the QoS level of the current thread.
OH_QoS_GewuAbortRequestapi-20
Abort the specified request. Note that after calling this function successfully, the client will not receive further responses for this request, and the request object cannot be used by the user code any more.
OH_QoS_GewuCreateSessionapi-20
Create a gewu session for inference. The lifecycle of the returned session object spans from the return of CreateSession to the call to DestroySession.
OH_QoS_GewuDestroySessionapi-20
Destroy the specified session. It is recommended that the client shall wait until all ongoing requests are done before calling this interface to destroy the session. If there are remaining requests in the session when this interface is called, those requests will be aborted and no further responses for those requests will be sent to the client. Note that after calling this function successfully, the session cannot be used by the user code any more.
OH_QoS_GewuSubmitRequestapi-20
Submit a request.
OH_QoS_ResetThreadQoSapi-12
Cancel the QoS level of the current thread.
OH_QoS_SetThreadQoSapi-12
Set the QoS level of the current thread.

Type Aliases§

OH_QoS_GewuOnResponseapi-12 and api-20
Callback to receive response of the request.
OH_QoS_GewuRequestapi-12 and api-20
Request id
OH_QoS_GewuResultapi-12 and api-20
OH_QoS_GewuSessionapi-12 and api-20
Session id