Dynamic Precision FIXED Class for Multi-Architecture Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for generating platform-dependent code are time-consuming and prone to errors, requiring explicit creation of code for each target architecture, with changes needing to be propagated across all targets, increasing the risk of bugs during maintenance.
Innovation Solution
The implementation of a FIXED class that supports variable precision fixed-point arithmetic, allowing dynamic precision changes and mixed precision operations, enabling code to be compiled for both floating-point and fixed-point architectures with ease, and facilitating mixed-mode execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If explicit code is created for each target architecture, then platform-specific optimization is achieved, but code maintenance time and error propagation increase
Solution Approach 1:
The patent implements a universal code base that can be compiled for multiple target architectures (floating-point processors, fixed-point DSPs, GPUs, FPGAs) without requiring separate code versions. The FIXED class provides architecture-agnostic fixed-point arithmetic that automatically adapts to different hardware platforms, eliminating the need to maintain separate code trees for each platform while still achieving platform-specific optimization through compiler directives and template specialization.
2Productivity
If separate code trees are maintained for different architectures, then architecture-specific performance is optimized, but development time and complexity increase
Solution Approach 1:
The patent merges previously separate code trees for different architectures into a single unified code base. By combining floating-point and fixed-point implementations into one project with architecture-specific compilation flags, the patent reduces code structure complexity while maintaining the ability to optimize for specific architectures through the FIXED class and compiler directives.
3Stability of the object's composition
If bug fixes are propagated across all target architectures, then consistency is maintained, but the risk of introducing new bugs increases
Solution Approach 1:
The patent uses a universal code base where a single bug fix automatically propagates to all target architectures through the compilation process. The FIXED class provides a consistent interface across platforms, and template metaprogramming ensures that corrections made in the source code are uniformly applied to floating-point, fixed-point, and hybrid implementations without manual copying or adaptation, thereby maintaining consistency while reducing the risk of introduction errors.
4Speed
If developers rewrite source code to use hardware accelerators, then execution speed is improved, but development time and precision loss increase
Solution Approach 1:
The patent introduces the FIXED class as an intermediary layer between the source code and hardware accelerators. This abstraction layer provides fixed-point arithmetic operations that can be automatically optimized by the compiler for specific hardware (DSPs, FPGAs, GPUs) without requiring developers to manually rewrite code. The intermediary handles precision management and hardware-specific optimizations, allowing developers to achieve execution speed improvements while maintaining original source code integrity.
Data Source
AI summary
In an embodiment, a method performs computer operations using a first fractional precision and a second fractional precision. A computer program has a source variable, a destination variable, and an operation. The source variable has a first dynamic fractional precision, the destination variable has a second dynamic fractional precision that differs from the first dynamic fractional precision, and the operation is related to the source variable and the destination variable. The source variable is aligned to a format of the destination variable, according to the first dynamic fractional precision and the second dynamic fractional precision. The operation is performed using the destination variable and the source variable. A value is assigned to the destination variable according to the operation. In this manner, a single codebase may be written that operates on various hardware that each have different bit precision capabilities, without requiring additional development and verification effort.


