# QAPE subsystem APIs

Source: [https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_apis.html](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_apis.html)

These APIs are powerful and allow for application specific workload hinting. It can help
    provide a good balance between performance and power on the SoC. With these APIs, application
    developers can ensure the best performance across the Qualcomm devices without any SoC
    specific knowledge for CPU topology, CPU frequency, GPU frequency, etc.

Keep in mind the following while using these APIs.

- These APIs can be used in combination on any thread. For instance a thread can be hinted
        as a pipeline thread using [hint_thread_pipeline()](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_thread_pipeline.html) and can be marked as high utilization
        using [hint_high_cpuutil()](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_high_cpu_util.html). However, marking all pipeline threads as high utililization can cause an
        increase in SoC power/thermals (see [query_thermal_headroom_status](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_query_thermal_headroom_status.html)); hence high utilization needs to be used with caution.
- These are sticky APIs. When any thread is marked as low latency or high utilization or a
        pipeline thread, the hint will be kept for the lifecycle of the thread.
- Threads marked as low latency are expected to run for short durations (low CPU util) but
        with tighter latency requirements.

- **[Constructor](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_manager.html)**  

Constructor for the primary link into the QAPE subsystem.
- **[set_pkg](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_set_pkg.html)**  

Binds the package name with the current session, if this API is not called,     then a session with performance API is not established and any call to the performance API and error will     return as `-2`.
- **[boost_cpu](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_boost_cpu.html)**  

Adds the virtual utilization on all available CPUs by a     percentage specified by the input parameter. This load is used to calculate the CPU frequency,     and a higher load result in a higher CPU frequency. The API call lasts for a duration of     2 sec.     This helps to provide a pulse boost (higher CPU frequency) for the application when a sudden     increase in CPU load is expected. For example, scene changes in a CPU heavy game.
- **[boost_gpu](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_boost_gpu.html)**  

Boosts the GPU load on the GPU by a percentage specified by the input     parameter boost\_val. The API call lasts for a duration of 2 sec. This API needs      to be used when the application expects an instantaneous increase in the GPU       load. For example, scene changes in a GPU heavy game.
- **[get_gpu_headroom](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_get_gpu_headroom.html)**  

Returns the available average/minimum GPU headroom in percentage for last ‘duration’ seconds. The get\_gpu\_headroom() API is used by applications to get feedback on the historical application rendering workload to know if the workload is GPU bound on the SoC. The purpose of this API is to help provide GPU performance information for the application content and help drive the workload, and other APIs to ensure smooth and sustained UX performance (minimize frame drops, reduce UI sluggishness). The application can monitor thermal. If the mobile device is approaching thermal limits; it can further check if the workload is GPU bound to decide if reducing the GPU load helps to reduce thermal status (&lt;= LIGHT) and hence improve sustained performance.
- **[hint_low_latency](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_low_latency.html)**  

Informs the system about a short-running critical application thread that must be     scheduled immediately on a CPU. The system marks the thread specified by the application as a     low latency thread. This hint does not impact thread placement on power vs. performance cores.     Also, if any thread is hinted at as low latency thread, the kernel scheduler will try to     immediately allocate CPU and hence avoid scheduling delay. This hint is beneficial for the     threads for any critical task (low-latency requirements) that needs to finish at the earliest on     a CPU, like for Async I/O thread, which may need immediate attention as soon as their waiting     time is done. The expectation is that the thread CPU workload is small in nature; but needs to     run at the earliest as soon as it is ready to run.
- **[hint_high_cpuutil](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_high_cpu_util.html)**  

Informs the system about a     specific high CPU utilization thread that requires a high-performance core on the SoC. This     thread is placed accordingly onto a big CPU core. It does not set the frequency of the core in     which the thread runs, but instead, the choice is left to the scheduler-DCVS directly or     indirectly via the boost\_cpu API.
- **[hint_low_cpuutil](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_low_cpu_util.html)**  

Informs the system about a specific low     CPU utilization thread that does not require the high-performance core. For example, threads     doing background work, and not requiring high performance cores even if the load can go     sporadically high. It does not set the frequency of the core where the thread is scheduled     runs, but instead, the choice is left to the scheduler-DCVS directly or indirectly via the     boost\_cpu API.
- **[hint_thread_pipeline](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_hint_thread_pipeline.html)**  

Provides a list of threads required to run every Vsync/draw cycle. This API hints the     underlying system to treat these pipeline threads with higher priority CPU scheduling. It tells     the system that these pipeline threads are important and need some SoC system assurance every     Vsync period in the application rendering cycle.
- **[release_thread_hints](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_release_thread_hints.html)**  

Hints to release if any hint is provided for the thread, this     is to reset any thread to the default. release\_hint will work for any thread.
- **[register_thermal_zone_callback](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_register_thermal_zone_callback.html)**  

Registers a callback to monitor device temperature changes. The registered callback         is called when the thermal zone gets changes. If the thermal zone switches from one level to         another, the client will be notified with the changed zone level.
- **[unregister_thermal_zone_callback](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_unregister_thermal_zone_callback.html)**  

Unregisters a thermal headroom callback. No callback will be triggered when the         thermal zone changes after calling this API.
- **[query_thermal_headroom_status](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_query_thermal_headroom_status.html)**  

Queries for current thermal status and returns how much headroom is left from thermal         mitigation.
- **[get_max_number_of_pipeline_thread](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_get_max_number_of_pipeline_thread.html)**  

Gets details on the maximum number of pipeline threads supported by this platform,         this result depends on the specific platform.
- **[set_number_pipeline](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_set_number_pipeline.html)**  

Sets the pipeline number. By calling this API the system will pick up the number of         top threads to do their task placement and schedule.
- **[reset_number_pipeline](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_reset_number_pipeline.html)**  

Resets the pipeline thread number to zero.
- **[set_desired_content_rate](https://docs.qualcomm.com/doc/80-PK177-134/topic/qape_set_desired_content_rate.html)**  

Sets the desired content rate; used by the platform to adjust display strategy.

**Parent Topic:** [Performance API](https://docs.qualcomm.com/doc/80-PK177-134/topic/performance_api_qape.html)

Last Published: Nov 14, 2024

[Previous Topic
Google ADPF and QAPE](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/google_adpf_and_qape.md) [Next Topic
Constructor](https://docs.qualcomm.com/bundle/publicresource/80-PK177-134/topics/qape_manager.md)