spcl / gemm_hls

Scalable systolic array-based matrix-matrix multiplication implemented in Vivado HLS for Xilinx FPGAs.
BSD 3-Clause "New" or "Revised" License
309 stars 54 forks source link

error: ‘CL_MEM_EXT_PTR_XILINX’ was not declared in this scope #21

Closed arrow53 closed 3 years ago

arrow53 commented 3 years ago

during make i'm seeing a bunch of CL errors.

error: ‘CL_MEM_EXT_PTR_XILINX’ was not declared in this scope

I'm sourcing vitis and xrt

source /opt/Xilinx/Vitis/2021.1/settings64.sh
source /opt/xilinx/xrt/setup.sh
definelicht commented 3 years ago

Could you try going to the hlslib subfolder and checking out this branch:

cd hlslib
git fetch
git checkout xilinx-opencl-header

Then running make again? In the past it was not necessary to explicitly include the extra Xilinx extensions file, but to be honest I'm not sure why it sometimes works without including it.

arrow53 commented 3 years ago

thanks @definelicht I see this now. I don't understand this well enough to know why it's picking up my CUDA installation.

/usr/local/cuda-11.0/include/CL/cl.h:661:2: warning: #warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1! [-Wcpp]
  661 | #warning CL_USE_DEPRECATED_OPENCL_1_0_APIS is defined. These APIs are unsupported and untested in OpenCL 1.1!
/usr/include/CL/cl_ext.h:546:63: error: expected initializer before ‘CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED’
  546 |                            size_t *     param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
      |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/CL/cl_ext.h:556:82: error: expected initializer before ‘CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED’
  556 |                                              size_t *     param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
      |                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BTW, adding

include_directories(/opt/xilinx/xrt/include)

in line 222 FindVitis.cmake does work (line doesn't really mater)

definelicht commented 3 years ago

Strange, this should already be included here: https://github.com/spcl/gemm_hls/blob/066566b80323afb3f9a79276718f199419d9f9af/CMakeLists.txt#L94

Can you check what your ${Vitis_INCLUDE_DIRS} looks like? It's supposed to include /opt/xilinx/xrt/include.

arrow53 commented 3 years ago

having CUDA on my path was the problem. Modifying that FindVitis.cmake file probably just affected the inlucude order. I'm going to close as this seems as though it's just an issue on my system.