Embedded Device Code Linking Across Multiple Host Objects
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional host linkers are unable to create an executable file from multiple host objects each containing respective host code for execution by the CPU and device code for execution by the GPU, as they cannot properly link device code embedded in each host object.
Innovation Solution
A method and system for generating an executable file by uniquely identifying and linking device code portions within host objects, allowing them to be executed by different processor types, such as a CPU and GPU, using a Compute Unified Device Architecture programming language (CUDA), and employing unique identifiers to prevent duplicate linking.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If conventional host linkers are used to generate executable files from multiple host objects, then host code can be linked together, but device code embedded in multiple host objects cannot be properly linked
Solution Approach 1:
The patent segments the linking process into two independent phases: a device code linking phase that processes all host objects to extract and link device code portions, and a host code linking phase that processes the same host objects for CPU execution. This segmentation allows device code to be properly linked from multiple host objects without interfering with host code linking, resolving the contradiction between versatility and reliability.
Solution Approach 2:
The patent introduces a device code linker as an intermediary component between the host linker and the device code portions. This intermediary extracts device code from host objects, links them together using unique identifiers, and produces linked device code that can be embedded in the final executable. The intermediary handles the complexity of device code linking separately from host code linking.
2Adaptability or versatility
If device code is embedded in multiple host objects, then code reuse and modularity are improved, but the ability to link device code correctly is lost
Solution Approach 1:
The patent performs preliminary extraction and identification of device code portions from host objects before the final linking process. By pre-processing host objects to identify and separate device code using unique identifiers, the system prepares linked device code portions that can be correctly assembled in the final executable, making the linking process easier despite code modularity.
Solution Approach 2:
The patent creates a representation or copy of device code portions with unique identifiers that track their origin and usage. These identified device code portions are then linked together and embedded in host objects, allowing correct linking while maintaining the modularity benefits of having device code in multiple host objects.
3Reliability
If unique identifiers are assigned to device code portions, then duplicate linking is prevented, but the complexity of the linking process increases
Solution Approach 1:
The patent implements self-service through automatic unique identifier generation and assignment by the device code linker. The system automatically tracks which device code portions have been linked and prevents duplicate linking without requiring manual intervention or complex user-configurable mechanisms, thus preventing duplicates while keeping the process manageable.
Solution Approach 2:
The patent uses feedback mechanisms where the device code linker tracks linked device code portions through unique identifiers and uses this information to prevent duplicate linking. The linker maintains state information about which device code has been processed and returns this feedback to prevent re-linking, ensuring reliability while managing complexity through automated tracking.
Data Source
AI summary
Embodiments of the present invention provide a novel solution to generate multiple linked device code portions within a final executable file. Embodiments of the present invention are operable to extract device code from their respective host object filesets and then link them together to form multiple linked device code portions. Also, using the identification process described by embodiments of the present invention, device code embedded within host objects may also be uniquely identified and linked in accordance with the protocols of conventional programming languages. Furthermore, these multiple linked device code portions may be then converted into distinct executable forms of code that may be encapsulated within a single executable file.


