Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Syntax highlighting for OpenCL (*.cl) kernels #5374

Open
nickreserved opened this issue Jan 23, 2025 · 9 comments
Open

[feature request] Syntax highlighting for OpenCL (*.cl) kernels #5374

nickreserved opened this issue Jan 23, 2025 · 9 comments

Comments

@nickreserved
Copy link

Title is self explanatory.
OpeCL files are like C with some extra keywords like '__kernel' , 'kernel', '__global', 'global' etc.

@hpwamr
Copy link
Collaborator

hpwamr commented Jan 23, 2025

Could you add ; cl in "Customize Schemes..." (see picture) and let us know if this matches your request?

Image

@nickreserved
Copy link
Author

Yes of-course it works as C, but the OpenCL C API have more keywords than C.
For instance '__kernel', '__global', '__local'.

Probably notepad3 uses a 3rd party library for code highlighting.
If that library supports OpenCL C API it would be great for notepad3 to also support it.
If not, never mind!

@hpwamr
Copy link
Collaborator

hpwamr commented Jan 23, 2025

Hello, I can add the "CL" extension and associated keywords in "C/C++ Source Code" Lexer.
Can you provide me with a list of CL keywords you want to add or the site where I can find them? 🤔
And if possible a "test file"?

@nickreserved
Copy link
Author

nickreserved commented Jan 23, 2025 via email

@nickreserved
Copy link
Author

I think you don't want predefined functions / macros.

== OPENCL 3

=== Data Types
bool
char
unsigned char
uchar
short
unsigned short
ushort
int
unsigned int
uint
long
unsigned long
ulong
float
double
half
size_t
ptrdiff_t
intptr_t
uintptr_t
void
char2
char3
char4
char8
char16
uchar2
uchar3
uchar4
uchar8
uchar16
short2
short3
short4
short8
short16
ushort2
ushort3
ushort4
ushort8
ushort16
uint2
uint3
uint4
uint8
uint16
long2
long3
long4
long8
long16
ulong2
ulong3
ulong4
ulong8
ulong16
float2
float3
float4
float8
float16
double2
double3
double4
double8
double16
event_t
queue_t
ndrange_t
clk_event_t
reserve_id_t
cl_mem_fence_flags
image2d_t
image3d_t
image2d_array_t
image1d_t
image1d_buffer_t
image1d_array_t
image2d_depth_t
image2d_array_depth_t
sampler_t

=== Operators & Qualifiers
sizeof
__global
global
__local
local
__constant
constant
__private
private
__kernel
kernel
attribute((........))
__read_only
read_only
__write_only
write_only
__read_write
read_write

@hpwamr
Copy link
Collaborator

hpwamr commented Jan 30, 2025

Hello, I can add the "CL" extension and associated keywords in "C/C++ Source Code" Lexer.

The above statement is not correct because it is not possible to add OpenCL keywords to the "C/C++ Source Code" lexer.
If you want to have an "OpenCL" lexer in Notepad3, you must first ask Scintilla.org to create it in Lexilla Lexers.
See: https://github.com/ScintillaOrg/lexilla

@nickreserved
Copy link
Author

Did you try in ChatGPT:
Can I extent scintilla lexer of C99 with some OpenCL keywords? E.g. how can I have a new lexer based in C99 with 2 extra keywords "__kernel" and "__global"?

@hpwamr
Copy link
Collaborator

hpwamr commented Jan 31, 2025

See comments in: #5372 (comment) 😢 😢

@hpwamr
Copy link
Collaborator

hpwamr commented Feb 3, 2025

Hello @nickreserved ,

Feel free to test the "BETA PortableApps", version "Notepad3Portable_6.25.203.1_beta.paf" or newer, see 1st list in issue #1129.

"Notepad3Portable BETA PortableApps" version can be used with or without ".7z" extension.

Also, feel free to test the "BETA Setup", version "Notepad3_6.25.203.1_beta_Setup" or newer, see the 2nd list in issue #1129.

Comments and suggestions are welcome... 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants