clgpustress icon indicating copy to clipboard operation
clgpustress copied to clipboard

Error while compiling, cannot convert _cl_device_id* to const cl::Device&

Open baryluk opened this issue 4 years ago • 1 comments

Linux machine on amd64.

g++ --version
g++ (Debian 9.3.0-13) 9.3.0
$ make
g++ -Wall -std=gnu++11 -Os -fexpensive-optimizations -Wall -I`fltk-config --includedir` -c -o gpustress-gui.o gpustress-gui.cpp
In file included from gpustress-gui.cpp:52:
/usr/include/CL/cl.hpp:143:110: note: #pragma message: This version of the OpenCL Host API C++ bindings is deprecated, please use cl2.hpp instead.
  143 | #pragma message("This version of the OpenCL Host API C++ bindings is deprecated, please use cl2.hpp instead.")
      |                                                                                                              ^
In file included from /usr/include/CL/cl.h:20,
                 from /usr/include/CL/opencl.h:24,
                 from /usr/include/CL/cl.hpp:167,
                 from gpustress-gui.cpp:52:
/usr/include/CL/cl_version.h:22:104: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)
   22 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")
      |                                                                                                        ^
gpustress-gui.cpp: In static member function ‘static void TestConfigsGroup::selectedDeviceChanged(Fl_Widget*, void*)’:
gpustress-gui.cpp:897:72: error: cannot convert ‘__gnu_cxx::__alloc_traits<std::allocator<_cl_device_id*>, _cl_device_id*>::value_type’ {aka ‘_cl_device_id*’} to ‘const cl::Device&’
  897 |             t->allConfigsMap.find(t->choosenClDeviceIDs[index])->second);
      |                                                                        ^
gpustress-gui.cpp:766:57: note:   initializing argument 1 of ‘void SingleTestConfigGroup::setConfig(const cl::Device&, const GPUStressConfig&)’
  766 | void SingleTestConfigGroup::setConfig(const cl::Device& _clDevice,
      |                                       ~~~~~~~~~~~~~~~~~~^~~~~~~~~
make: *** [Makefile:28: gpustress-gui.o] Error 1

baryluk avatar Jun 06 '20 21:06 baryluk

The clgpustress has been written by using older OpenCL C++ binding for OpenCL 1.2. Please use older cl.hpp header.

matszpk avatar Jun 07 '20 19:06 matszpk