Intel® FPGA SDK for OpenCL™ Standard Edition: Best Practices Guide

ID 683176
Date 9/24/2018
Public
Document Table of Contents

8.5. Data Type Selection Considerations

Select the appropriate data type to optimize the FPGA area usage by your OpenCL™ application.
  1. Select the most appropriate data type for your application.

    For example, do not define your variable as float if the data type short is sufficient.

  2. Ensure that both sides of an arithmetic expression belong to the same data type.

    Consider an example where one side of an arithmetic expression is a floating-point value and the other side is an integer. The mismatched data types cause the to create implicit conversion operators, which can become expensive if they are present in large numbers.

  3. Take advantage of padding if it exists in your data structures.

    For example, if you only need float3 data type, which has the same size as float4, you may change the data type to float4 to make use of the extra dimension to carry an unrelated value.

Did you find the information on this page useful?

Characters remaining:

Feedback Message