User forums > General (but related to Code::Blocks)

Support for OpenCL *.cl files

<< < (2/3) > >>

cdavalillo:

--- Quote from: Miguel Gimenez on January 09, 2024, 01:24:30 pm ---How do we support glsl?

--- End quote ---

I thought that you would know. But just see the pictures that I posted, I'm not lying to you. Now we are on the matter I suggest to add support to CUDA files too which has the file extension .cu and has a similar syntax to c.

cdavalillo:

--- Quote from: ollydbg on January 10, 2024, 12:22:41 am ---compilation - how to compile opencl project with kernels - Stack Overflow

I just looked at the above link, and found that .cl file is similar like glsl file, and C::B does not need to compile it.

--- End quote ---

I think you can compile this type of file through a OpenCL API compliant compiler as for example NVCC. I only have written .cu files for CUDA programs and they compile just fine using NVCC in Code::Blocks IDE, but I don't know if is the same as with .cl files.

Miguel Gimenez:
I asked because I really did not know. Before asking I looked at the lexers from wxScintilla and did not find glsl, later I found lexer_glsl.xml at sdk\resources\lexers. There is one for CUDA and none for OpenCL.

If you know OpenCL you could write a lexer for it based on lexer_cpp.xml and the corresponding .sample, there are instructions in README.txt.

cdavalillo:
I read those files of lexers that you did mention but I honestly don't know how to write one. I know XML but I don't know the specific structure that Code::Blocks needs. Where I can read more about how to create these lexer files?

Miguel Gimenez:
- Copy lexer_cpp.xml to lexer_cl.xml, remove unsupported keywords and add CL-specific ones to indexes 0 and 1.
- Edit filemasks in line 6.
- The "wxSmith block identifiers" part (index 6) can be removed completely.
- The SampleCode value must be changed to lexer_cl.sample, the line numbers can be changed if needed.
- Language attributes should be the same AFAIK.
- Copy lexer_cpp.sample to lexer_cl.sample and edit it so it is CL-compliant and representative.

Once finished, attach both files here (or in the ticket page) so we can add them to trunk.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version