Reputation: 83
I am trying to build an OpenCL kernel using OpenCL2.0. I am calling the cl::Program build function and passing the flag -cl-std=CL2.0. The g++ compiler finishes and links with no errors. However, when I run the program, the build function throws an exception (see below). Wanted to see if anyone has seen this before and has a solution. Thank you.
I tried other flags such as -cl-std=c++11, -cl-std=CL2.2, but none of these worked.
[20:03:47.768768][info][Demosaic] CL_FLAGS = -cl-std=CL2.0 -D IMAGE_MAD_INDEXING -D AMD_GPU_ARCH -D DEVICE_WAVEFRONT_SIZE=64 -D WG_SIZE_MAX=256
terminate called after throwing an instance of 'cl::BuildError'
[20:03:47.788335][error][Demosaic] Build failed: In file included from /tmp/OCL21460T1.cl:244:
/usr/include/CL/cl2.hpp:495:2: error: Visual studio 2013 or another C++11-supporting compiler required
#error Visual studio 2013 or another C++11-supporting compiler required
Upvotes: 0
Views: 407
Reputation: 23428
Is cl2.hpp
not a file that should be #include
d in host code rather than OpenCL kernel code?
I assume it checks the value of __cplusplus
which, if I'm reading the relevant section of the OpenCL C++ specification correctly, is not defined in the C++ dialect used for OpenCL kernels.
Upvotes: 1