Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
11 Views

Reimplementing work_group_scan_exclusive_add

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
Highlighted
11 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.

0 Kudos
Highlighted
11 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)

0 Kudos