CUDA Device Code Pruning Using Host Reference Information

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dead code in heterogeneous computing environments, where code elements are not referenced in both host and device code, leads to inefficiencies such as increased memory usage and processing time due to unnecessary code execution.

Innovation Solution

Utilizing reference information from host code to prune dead code elements from device code, ensuring only referenced functions and variables are included in the device code execution, thereby optimizing computational efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If dead code is included in device code to ensure all possible code paths are covered, then code completeness is improved, but memory usage and processing time increase

Engineering Contradiction:
Improvecode completenessVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent extracts dead code elements from device code by comparing reference information from host code against device code elements. The linker removes unreferenced functions, variables, and other code elements, keeping only those that are actually needed for device code execution. This extraction process eliminates unnecessary code while preserving code completeness for referenced elements.

Inventive Principle:
Principle #2Taking out (Extraction)

2Reliability

If dead code is included in device code to ensure all possible code paths are covered, then code completeness is improved, but processing time increases

Engineering Contradiction:
Improvecode completenessVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts dead code elements from device code by comparing reference information from host code against device code elements. The linker removes unreferenced functions, variables, and other code elements, keeping only those that are actually needed for device code execution. This extraction process eliminates unnecessary code while preserving code completeness for referenced elements.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If all code elements are included in device code to handle ambiguous references, then code reliability is improved, but device complexity increases

Engineering Contradiction:
Improvecode reliabilityVSAvoiddevice code complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts dead code elements from device code by comparing reference information from host code against device code elements. The linker removes unreferenced functions, variables, and other code elements, keeping only those that are actually needed for device code execution. This extraction process eliminates unnecessary code while preserving code completeness for referenced elements.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by generating reference information for only those code elements that are actually referenced in host code, rather than analyzing all possible code elements. This partial analysis approach reduces device code complexity while maintaining reliability for the subset of code that is actually needed.

Inventive Principle:
Principle #16Partial or excessive action

4Manufacturing precision

If reference information is generated for all code elements to ensure accurate pruning, then pruning accuracy is improved, but compilation time increases

Engineering Contradiction:
Improvepruning accuracyVSAvoidcompilation time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent applies partial action by generating reference information for only those code elements that are actually referenced in host code, rather than analyzing all possible code elements. This partial analysis approach reduces device code complexity while maintaining reliability for the subset of code that is actually needed.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS20260072661A1Code generation based on processor usage
Publication Date: 2026.03.12 NVIDIA CORP
  • US20260072661A1 patent drawing
  • US20260072661A1 patent drawing
  • US20260072661A1 patent drawing

AI summary

Apparatuses, systems, and techniques to generate code to be performed by one or more first processors based, at least in part, on one or more indications of data to be used by one or more second processors. In at least one embodiment, a CUDA program includes host code and device code, and a linker uses references for code elements in host code to link or prune code elements from device code.