OpenCL support for C++ template

OpenCL support for C++ template

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.

5 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

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

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

Aram & Yuri,

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

Regards
--
Taylor
 

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

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi