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.
1722 Discussions

OpenCL support for C++ template

Aram_S_
Beginner
859 Views

Hi,

I'm trying to port an OpenCL kernel that contains C++ template declarations. The compilation of the kernel code (with clCreateProgramWithSource) fails because it does not recognise the "template" symbol.

Is there a way around this?

I'm using the latest Intel OpenCL SDK on a machine equipped with Xeon Phi, and the example codes run just fine.

Many thanks.

0 Kudos
4 Replies
Yuri_K_Intel
Employee
859 Views
Hi Aram, Please note that there is a separate forum for Intel SDK for OpenCL Applications - https://software.intel.com/en-us/forums/intel-opencl-sdk. As for your question - I guess that this kernel was developed using AMD APP SDK which has some support for C++ template called "Bolt". This is not a standard OpenCL feature (currently at least), so I guess naive solution would be to get rid of template keyword and implement as many kernels (with as many data types) as you wish to support. Thanks, Yuri
0 Kudos
Aram_S_
Beginner
859 Views

Hi Yuri and thank you for your response.

I missed the OpenCL section, apologies.

Your guess is accurate, the code was developed against AMD APP SDK. My hope was that the Intel OpenCL SDK had an extension for C++ template support similar to the AMDs. Your suggestion of getting rid of the template definitions is not practically feasible in my case because there are too many templates and the kernel code size is substantial. (perhaps only with some compiler aided approach it could be done).

Thanks

0 Kudos
TaylorIoTKidd
New Contributor I
859 Views

Aram & Yuri,

I moved this thread to the OpenCL SDK forum. If you think this is inappropriate, please let me know.

Regards
--
Taylor
 

0 Kudos
Aram_S_
Beginner
859 Views

Thank about that Taylor. If you can please delete this thread too https://software.intel.com/en-us/forums/topic/520206 

0 Kudos
Reply