Creating Buffer Variables

To create a new buffer variable:

  1. Open the Code Builder Variable Management view. Go to Tools > Intel Code Builder for OpenCL API > OpenCL Kernel Development > Windows > Variable Management.
  2. Click the Add button and select Buffers:

    Add variable of type buffer

  3. Fill out the dialog box entries:
Field Options
Name Enter a meaningful name, or leave the default.
IO Mode Use the drop-down to select Input, Output, or InOut
Number of Elements Enter the number of elements, or leave the default value of 1.
Memory flags to use Use the drop-down to select a memory flag, or leave the default CL_MEM_USE_HOST_PTR
Use as SVM Check to use the buffer as an SVM on systems that support SVM.
Initialization options For Input, or InOut IO Mode, you need to set an initialization option. To select an input .csv or binary file as the initialization option, click the browse (...) button.
  • When using CSV files, each line represents one OpenCL data type (like int4, float16, and so on), with a value in each column to satisfy the type size. For example, for a long8, at least eight columns of long numbers should exist in each line. The size of the buffer is used as the number of lines to read from CSV. The CSV file may hold more columns or lines than needed for a specific buffer, but not fewer.
  • When using binary files, the content should be a concatenation of the OpenCL data type, and as with using CSV files, the file may hold more data than indicated by the Size argument.
  You can also select Use random values or Zero the entire buffer



Output buffers do not need a value assigned to them. If a value is assigned, it is ignored.

For more complete information about compiler optimizations, see our Optimization Notice.