Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
723 Discussions

Host Pipes not working as documented in Programming Guide

okramer
New Contributor I
1,583 Views

Section 5.5.6.4 of the OpenCL FPGA Programming Guide has in the host code example a direct call to clReadPipeIntelFPGA() and clWritePipeIntelFPGA(), while the only downloadable code example (that I know of) that shows host pipes, "loopback_hostpipe", does the following:

map_pipe_fn = (void * (*) (cl_mem, cl_map_flags, size_t, size_t *, cl_int *)) clGetExtensionFunctionAddress("clMapHostPipeIntelFPGA"); unmap_pipe_fn = (cl_int (*) (cl_mem, void *, size_t, size_t *)) clGetExtensionFunctionAddress("clUnmapHostPipeIntelFPGA");

So I tried modifying my host pipe code to use the same clGetExtensionFunctionAddress to access the clReadPipeIntelFPGA and clWritePipeIntelFPGA and that worked -- well, sort of -- at least it didn't hang like when I was calling clWritePipeIntelFPGA directly.

 

Is it a requirement to use clGetExtensionFunctionAddress to fetch those functions? Or should I be able to call clWritePipeIntelFPGA directly? Also, clGetExtensionFunctionAddress is marked as deprecated in cl.h, so obviously there's a better way to do it.

 

 

0 Kudos
2 Replies
MEIYAN_L_Intel
Employee
1,365 Views

Hi,

 

I am checking it internally.

 

Thanks

0 Kudos
MEIYAN_L_Intel
Employee
1,365 Views

Hi,

I had reviewed the problem stated.

According to https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf in chapter 6.4 stated: " when you link your host application to the FPGA Client Driver (FCD), you cannot directly reference these Custom Platformspecific functions. To reference Custom Platform-specific user-accessible functions while linking to the FCD, include the clGetBoardExtensionFunctionAddressIntelFPGA extension in your host application".

 

It seems like the function " clGetBoardExtensionFunctionAddressIntelFPGA" is used to point the function which is not specified in OpenCL Specification 2.0: https://www.khronos.org/registry/OpenCL/specs/opencl-2.0.pdf in chapter 5.4. Since the function eg:  clReadPipeIntelFPGA, clWritePipeIntelFPGA, clMapHostPipeIntelFPGA, and clUnmapHostPipeIntelFPGA is not specified in OpenCL Specification, thus it need the function " clGetBoardExtensionFunctionAddressIntelFPGA" to point out the function.

 

Also, I had reviewed the cl.h file. Since clGetBoardExtensionFunctionAddress is deprecated, it should be replace by another function with different name. I am not sure whether it is replaced "clGetBoardExtensionFunctionAddressIntelFPGA". But there is no " clGetBoardExtensionFunctionAddressIntelFPGA" is stated in the file. I have to check internally with the developer again. I will reply here once the developer reply to me.

 

Thanks.

0 Kudos
Reply