Static Data Sharing Heterogeneous CPU GPU
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current heterogeneous systems face inefficiencies in sharing statically allocated data between CPUs and GPUs due to overhead from copying static data and relocating references, which is exacerbated by the need for separate executable images and linker relocations.
Innovation Solution
A method where a host compiler places shared statically allocated variables in a writable data segment and creates a table of pairs for relocation, while a target compiler marks shared static symbols as undefined, allowing the linker to group data segments and add markers, which are resolved at runtime by the offload library using a table from the host image.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If static data is physically shared between CPU and GPU executable images, then data access efficiency is improved, but reference relocation complexity increases due to separate executable images and linker requirements
Solution Approach 1:
The patent introduces a runtime resolution mechanism that acts as an intermediary between the target code references and the actual data locations. Instead of requiring complex linker-level coordination between CPU and GPU executable images, the system uses a runtime library to resolve references dynamically. This intermediary layer handles the complexity of mapping references across separate executable images while allowing the code to use simple global variable references, thus improving data access efficiency without exposing the relocation complexity to the programmer.
Solution Approach 2:
The patent segments the data and reference resolution process into distinct phases: compilation phase where target code is generated with placeholder references, and runtime phase where these references are resolved to actual data locations. This segmentation allows the compilation process to remain simple while deferring the complex relocation logic to runtime, where a dedicated resolution mechanism can handle the mapping between target code references and shared static data without affecting the overall system complexity.
2Adaptability or versatility
If static data is copied before/after offload region execution, then data sharing between CPU and GPU is achieved, but significant overhead is incurred
Solution Approach 1:
The patent extracts the data copying operation from the mandatory execution path by implementing a reference resolution mechanism that directly maps target code references to shared static data locations. Instead of copying data before and after offload execution, the system extracts the unnecessary copy operations and replaces them with direct references. The runtime resolution system resolves these references to the actual shared data, eliminating the time-consuming copy operations while maintaining the ability to share data between CPU and GPU executable images.
3Adaptability or versatility
If separate executable images are used for CPU and target code, then heterogeneous processing is enabled, but data sharing becomes inefficient due to linker relocation requirements
Solution Approach 1:
The patent introduces a runtime resolution mechanism that mediates between the separate executable images of CPU and target code. This intermediary system allows heterogeneous processing to proceed with independent executable images while providing an efficient path for data sharing. The runtime library resolves references from target code to shared static data without requiring complex linker-level integration, thus maintaining the benefits of separate executable images for heterogeneous processing while achieving efficient data sharing through dynamic reference resolution.
Data Source
AI summary
A processing apparatus is described. The apparatus includes a central processing unit (CPU), a graphics processing unit (GPU) and data sharing logic to perform static physical data sharing between the CPU and the GPU by changing code written for the GPU to operate with CPU variables.


