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

ID 683846
Date 12/13/2021
Public

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

Document Table of Contents

5.5.6.3. Creating a Host Accessible Pipe

The clCreatePipe function, defined in the Section 5.4.1 of the OpenCL 2.2 API Specification, contains a flags parameter. The legal values of flags for clCreatePipe function are CL_MEM_READ_WRITE and CL_MEM_HOST_NO_ACCESS. If the value passed to flags is 0, then the specification defines that both of these flags are implicitly passed as the default.

To enable host access (reading or writing) to pipes, the cl_intel_fpga_host_pipe extension legalizes the following two flags values to clCreatePipe:

  • CL_MEM_HOST_READ_ONLY
  • CL_MEM_HOST_WRITE_ONLY

When one of these flags is passed to the clCreatePipe function, the corresponding cl_mem object can be passed as the first argument to clReadPipeIntelFPGA and clWritePipeIntelFPGA functions. Throughout the remainder of the cl_intel_fpga_host_pipe extension, such a pipe is referred to as a host pipe.

Warning: It is illegal to specify both CL_MEM_HOST_READ_ONLY and CL_MEM_HOST_WRITE_ONLY on the same pipe, or to mix either of those values with CL_MEM_READ_WRITE or CL_MEM_HOST_NO_ACCESS, or both. Invalid flags combinations are detected by the OpenCL runtime, and causes clCreatePipe to return the CL_INVALID_VALUE error.