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

OpenCL kernel source file to C char string converter

Gomboc__Matej
Beginner
307 Views

Hi !

I have made this nice OpenCL kernel source code file to C/C++ char string converter:

https://github.com/MatejGomboc/OpenC...ring-converter

I hope you will find it useful !

Best regards.

0 Kudos
2 Replies
Michael_C_Intel1
Moderator
307 Views

Hi MatejG,

Haven't tried it, but I took a quick peek through your py script & repo. Tools like this could go a long way to eliminating a tedious task for developers bringing up their kernels.

Thanks for the reference.

 

-MichaelC

allanmac1
Beginner
307 Views

Another option is to use your compiler's preprocessor and a utility like xxd to produce an includable source or binary kernel.

To create an includable file of source kernels:

  • <compiler> -I . -I "%INTELOCLSDKROOT%\include" -D <opencl defines> -EP <input .cl> -P <preprocessed .cl>
  • dos2unix -q <preprocessed .cl>
  • xxd -i <preprocessed .cl> <preprocessed .h>

To create an includable file of binary kernels:

  • ioc64 -cmd=build -bo=<opencl build options> -device=gpu -input=<preprocessed .cl> -ir <binary .ir>
  • xxd -i <binary .ir> <binary include file>

Then just load the source or binary kernel(s) with the appropriate OpenCL functions.

Reply