conda-forge / ocl-icd-feedstock

A conda-smithy repository for ocl-icd.
BSD 3-Clause "New" or "Revised" License
1 stars 7 forks source link

Question: OpenCL 2.0 #21

Open wilderfield opened 3 years ago

wilderfield commented 3 years ago

I love that this feedstock is available, but unfortunately my team uses OpenCL 2.0 and this package is too modern for our needs.

We normally work with Ubuntu's apt-get install opencl-headers package.

Any clue on how I could get OpenCL 2.0 support in conda-forge ?

Would I have to make my own recipe?

inducer commented 3 years ago

I'm not sure I understand your request. How come you need the ICD loader to be restricted to OpenCL 2? It is perfectly possible to use an OpenCL 3 ICD loader (this) with ICDs (drivers/implementations, e.g. Nvidia's) that only expose OpenCL 1.2. Similarly, there is sufficient backward compatibility that an application targeting OpenCL 1.2 should work just fine with this loader.

wilderfield commented 3 years ago

@inducer the problem I was seeing with this package (for my purpose) was that it brought in a set of header files to my environment such as: /scratch/bryanloz/anaconda3/envs/test/include/ocl_icd.h

This header file is too new / does not agree with the project, as it tries to force OPENCL 3.0

[ 15%] Building CXX object runtime_src/xocl/CMakeFiles/xocl.dir/api/clBuildProgram.cpp.o                                                                 
In file included from /home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/api/icd/ocl_icd_bindings.h:28:0,
                 from /home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/config.h:41,
                 from /home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/api/clBuildProgram.cpp:19:
/scratch/bryanloz/anaconda3/envs/test/include/ocl_icd.h:40:0: error: "CL_TARGET_OPENCL_VERSION" redefined [-Werror]
 #  define CL_TARGET_OPENCL_VERSION 300                                                                            

In file included from /home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/api/clBuildProgram.cpp:19:0:
/home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/config.h:21:0: note: this is the location of the previous definition
 # define CL_TARGET_OPENCL_VERSION 200                                                                                      

In file included from /home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/api/clBuildProgram.cpp:21:0:
/home/bryanloz/DEEPXILINX/LXRT/XRT/src/runtime_src/xocl/core/device.h:449:96: error: ‘cl_mem_ext_ptr_t’ does not name a type; did you mean ‘cl_mem_ext_host_ptr’?
   get_stream(xrt_xocl::device::stream_flags flags, xrt_xocl::device::stream_attrs attrs, const cl_mem_ext_ptr_t* ext, xrt_xocl::device::stream_handle* stream, int32_t& m_conn);
                                                                                                ^~~~~~~~~~~~~~~~
                                                                                                cl_mem_ext_host_ptr