Intel® FPGA SDK for OpenCL™ Pro Edition: Programming Guide

ID 683846
Date 12/19/2022
Public
Document Table of Contents

5.7. Using Predefined Preprocessor Macros in Conditional Compilation

You may take advantage of predefined preprocessor macros that allow you to conditionally compile portions of your kernel code.

To introduce Intel® FPGA SDK for OpenCL™ Offline Compiler version-specific code and optimizations, structure your kernel program in the following manner:

#if INTELFPGA_CL >= 191
    // use new features added in 19.1 
#else
    // do things the old way
#endif

Where INTELFPGA_CL is the Intel® predefined preprocessor macro set to the Intel® FPGA SDK for OpenCL™ Offline Compiler version. This macro enables you to version your code based on the compiler version.