GPU Kernel Launch via Compiler API Mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional solutions for launching kernels on graphics processing units (GPUs) require transferring significant data between GPU and CPU, making it expensive and limiting the ability to perform iterative tasks and irregular computations, such as recursive algorithms, due to the lack of direct kernel launch capability from GPU code.
Innovation Solution
The solution enables compiler support for launching kernels directly on a GPU by mapping kernel launch syntax to API calls, reducing the number of API calls required and checking for access to private resources, allowing for iterative applications and correct resource management.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If kernel launch involves transferring data from host memory to GPU memory, then kernel can be launched from host, but data transfer cost increases significantly
Solution Approach 1:
The patent introduces device-side kernel launch mechanisms that act as intermediaries, allowing kernels to be launched from device code without requiring repeated data transfers from host memory. The device can maintain its own execution context and launch kernels using locally available data, eliminating the need for expensive host-to-device data transfers for each kernel launch.
2Ease of operation
If conventional host-based kernel launch is used, then kernel can be launched from host, but iterative applications become difficult to implement
Solution Approach 1:
The patent enables dynamic kernel launch capabilities from device code, allowing the GPU to dynamically select and launch different kernels based on runtime conditions. This dynamic launch mechanism from within device code enables iterative applications and complex control flows that were previously only possible from host code, significantly improving adaptability.
3Ease of operation
If conventional host-based kernel launch is used, then kernel can be launched from host, but irregular computation such as recursive algorithms cannot be performed
Solution Approach 1:
The patent implements dynamic kernel launch capabilities that allow recursive and irregular computations directly from device code. The device can launch kernels dynamically based on runtime conditions, enabling recursive algorithms and complex control flows that were previously only possible from host code, significantly improving adaptability.
4Reliability
If multiple API calls are used for kernel launch, then kernel can be launched with proper resource management, but the number of API calls increases
Solution Approach 1:
The patent merges multiple kernel launch API calls into a single unified launch mechanism. By combining resource allocation, parameter passing, and kernel execution into a single API call, the patent reduces the number of API calls required while maintaining proper resource management and memory allocation correctness.
Data Source
AI summary
A system and method for compiling source code (e.g., with a compiler). The method includes accessing a portion of device source code and determining whether the portion of the device source code comprises a piece of work to be launched on a device from the device. The method further includes determining a plurality of application programming interface (API) calls based on the piece of work to be launched on the device and generating compiled code based on the plurality of API calls. The compiled code comprises a first portion operable to execute on a central processing unit (CPU) and a second portion operable to execute on the device (e.g., GPU).


