Visible to Intel only — GUID: fpg1612489178943
Ixiasoft
Visible to Intel only — GUID: fpg1612489178943
Ixiasoft
12.1.3. The ihc::math_dsp_control Function
Use the ihc::math_dsp_control function to control the hardware implementation for supported data types and math functions at a local-scope.
The ihc::math_dsp_control function is defined in the HLS/math_dsp_control.h header file. Include this header file in your component or task code to use the function.
Syntax
ihc::math_dsp_control<HW_impl_pref, lambda_expr_propagation>
where the template parameters are defined as follows:
HW_impl_pref
Value | Description |
---|---|
ihc::Preference::DSP | The compiler tries to implement supported math operations with DSP blocks. This value is the default. |
ihc::Preference::Softlogic | The compiler tries to implement supported math operations with soft logic using ALMs. |
ihc::Preference::Compiler_default | The compiler implements supported math operations with DSP blocks or soft logic (ALMs) based on data type and operation. |
lambda_expr_propagation
Value | Description |
---|---|
true | The HW_impl_pref value is propagated to function calls in the lambda expression function. This value is the default. |
false | The HW_impl_pref value is not propagated to function calls in the lambda expression function. The HW_impl_pref value applies only to math operations directly called in the lama expression. |
Nested Calls
A HW_impl_pref value never applies to any nested ihc::math_dsp_control function calls. Each ihc::math_dsp_control function call requires its own HW_impl_pref value specified.
Example
component float test_lib(float a, float b) {
ihc::math_dsp_control<ihc::Preference::Softlogic>([&]{
a += 7.89f; // Soft-logic
a += b; // Soft-logic
});
return a;
}