CUDA Shared Memory Initialization via Compiler and Driver Hooks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Memory initialization in CUDA programs consumes significant time and computing resources due to the inaccessibility of reserved shared memory until GPU threads have begun execution.
Innovation Solution
A compiler and GPU driver collaborate to initialize reserved shared memory by inserting at-entry and at-exit code, ensuring that shared memory is prepared before thread execution and cleaned up after, thereby optimizing memory initialization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If memory initialization is performed using conventional CUDA techniques, then shared memory is properly initialized, but significant time and computing resources are consumed
Solution Approach 1:
The patent applies preliminary action by having the host CPU initialize the shared memory space before transferring control to the GPU. The host performs the initialization operation synchronously before the GPU kernel executes, so that when the GPU needs the shared memory, it is already prepared and accessible, eliminating the time loss associated with initialization during GPU execution.
2Reliability
If memory initialization is performed using conventional CUDA techniques, then shared memory is properly initialized, but significant computing resources are consumed
Solution Approach 1:
The patent applies preliminary action by having the host CPU initialize the shared memory space before transferring control to the GPU. The host performs the initialization operation synchronously before the GPU kernel executes, so that when the GPU needs the shared memory, it is already prepared and accessible, eliminating the time loss associated with initialization during GPU execution.
Solution Approach 2:
The patent uses the host CPU as an intermediary to perform the memory initialization task. Instead of having the GPU perform initialization (which consumes GPU computing resources), the host CPU acts as a mediator that prepares the memory space beforehand, thereby conserving GPU computing resources for actual computation tasks.
3Reliability
If reserved shared memory is made inaccessible until thread execution begins, then thread safety is maintained, but early access to shared memory is prevented
Solution Approach 1:
The patent applies preliminary action by having the host CPU initialize the shared memory space before transferring control to the GPU. The host performs the initialization operation synchronously before the GPU kernel executes, so that when the GPU needs the shared memory, it is already prepared and accessible, eliminating the time loss associated with initialization during GPU execution.
Data Source
AI summary
Apparatuses, systems, and techniques to compile and modify software programs. In at least one embodiment, a software program is to be modified to initialize information to be used by one or more application programming interfaces (APIs).


