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

ID 683846
Date 9/26/2022

A newer version of this document is available. Customers should click here to go to the newest version.

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 
    // do things the old way

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.