OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Reimplementing work_group_scan_exclusive_add

Mathias_M_1
Beginner
174 Views

Hi there,

I have reimplemented the function work_group_scan_exclusive_add, which is supported by OpenCL 2.0. My OpenCL source code looks like this:

#if __OPENCL_VERSION__ < 200
inline uint work_group_scan_exclusive_add(const uint value)
{
...
}
#endif

When I try to compile this with the Intel OpenCL driver 6.4.0.25 (Windows 8.1 x64) for the OpenCL 1.2 CPU device, the following error message is generated by the intel OpenCL compiler:

 error: redeclaration of 'work_group_scan_exclusive_add' must have the 'overloadable' attribute

Why is the function work_group_scan_exclusive_add already defined for the OpenCL 1.2 CPU device?
How it is possible to circumevent this compile error ?

Best regards,
Mathias

0 Kudos
2 Replies
Jeffrey_M_Intel1
Employee
174 Views

Sorry for the delayed reply.   You may need to use an older runtime only supporting CPU OpenCL 1.2 to avoid this problem. 

https://software.intel.com/en-us/articles/opencl-drivers

(See the CPU runtimes section.  OpenCL 2.0 was introduced for the 16.1 runtimes.)

I'm checking for other alternatives and will get back to you if I find any.

Jeffrey_M_Intel1
Employee
174 Views

After further internal discussion we're going to investigate this as a bug.  As a workaround the overloadable attribute might help:

__kernel __attribute__((overloadable)) uint work_group_scan_exclusive_add(const uint value)

Reply