What is hQ?
hQ (Heterogeneous Queuing), simply put, is a more streamlined approach to allocating computational tasks between the two types of processors within the accelerated processing unit (APU) – the central processing unit (CPU) and graphics processing unit (GPU).
Heterogeneous queuing helps to reduce latency within the APU and is the key to unlocking the full potential of the APU, resulting in higher levels of performance and power efficiency. It also enables application acceleration, which leads to all sorts of new, groundbreaking user experiences.
The Trouble With the Old Way of Queuing
In a traditional architecture, all of the processing tasks for the GPU are first routed to the CPU, which then dispatches them to the GPU. The CPU must communicate with the operating system, which puts the task in a queue for processing. Then the task is sent to a kernel driver to be translated into a vendor specific format so that the GPU can process it.
Unlike CPU processing tasks, which go directly to the CPU, the processing tasks for the GPU have to pass through extra software layers, resulting in higher levels of latency. Furthermore, the GPU can only consume tasks and doesn’t have the flexibility to dispatch new tasks to itself or to the CPU. This is known as the master/slave architecture.
Heterogeneous Queuing: From Master/Slave to Masterpiece
Heterogeneous queuing eliminates all the extra software layers and allows the GPU to interact directly with the applications and the CPU. hQ transforms the current processor ‘master/slave’ architecture of the APU and turns it into ‘all processor equal’ type of design. The CPU can place GPU work items directly in a task queue that the GPU can immediately access, without having to go through the OS or the kernel driver. Also, instead of being spoon-fed by the CPU, the GPU can create its own tasks and place them in a queue, where they are immediately dispatched to the GPU or the CPU via low-latency user mode-queuing. This results in a significant reduction in latency.
Reaping the Benefits of hQ and HSA
Reducing latency when performing work on the GPU, reducing software layers and more efficiently utilizing the GPU opens up many more opportunities to accelerate application performance, reduce power consumption and improve portability. HSA offers the following benefits that help unleash the full processing power the APU:
- Application Acceleration – Many more opportunities to accelerate application performance and enable new user experiences, such as gesture control, screen sharing and face login
- Power Efficiency – Easier utilization of the GPU and reducing software layers leads to phenomenal power savings
- Support for a Wide Range of Devices – hQ is based on HSA, a broadly endorsed industry standard that can be used across a wide range of platforms, including handheld devices, PCs and servers
- Programmability – Since the GPU has the flexibility to create and dispatch its own work items, programmers can use everyday programming languages and familiar programming models equivalent to those used for the CPU. Removing the vendor-specific software layers finally helps bring to life the slogan ‘write once, use everywhere’