Bug 294695 - Wish for CUDA source code support, such as header switching, syntax highlighting, and basic language support.
Summary: Wish for CUDA source code support, such as header switching, syntax highlight...
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 15:14 UTC by Anonymous
Modified: 2017-03-24 20:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anonymous 2012-02-23 15:14:18 UTC
Version:           unspecified (using KDE 4.7.4) 
OS:                Linux

NVIDIA CUDA is becoming more and more common for GPU computing (and seems to become the de-facto choice over OpenCL, as many closed and open-sources projects tend to gravitate toward it (see e.g. OpenCV's recent support for CUDA)). Currently kdevelop does not recognize CUDA files, but it would be nice if it did.
Its syntax is essentially an extension to C++, so parsing should not be that difficult of a problem.

I am wishing for 4 things, in ascending order of difficulty:

1) Recognition of .cuh and .cu files as CUDA files, and automatic selection of the correct syntax highlighting. (This might actually be a request for katepart, I am not sure). Currently, this association can be manually worked around in the "Configure Editor"->"Open/Save"->"Modes & Filetypes"->"Sources/C++"->adding .cu and .cuh to the file extensions. Of course that's a hack and doesn't give "true" CUDA syntax support, as there currenly is not "Sources/CUDA". But at least we get C++ highlighting.
2) Kdevelop understanding the relationship between .cu / .cuh, so that "Switch Definition/Declaration" works to switch between headers (.cuh / .h) and implementation files (.cu).
3) Kdevelop having "*.cu,*.cuh" extensions be automatically a part in the "Find in Files" feature.
4) Correct parsing of CUDA code. This mostly works already if I manually associate .cu files with the C++ language in the kate options, but of course some of the CUDA-specific syntax, such as kernel_call<<<blocks, threads>>> is not parsed or understood correctly. Also commands, such as cudaMalloc and cudaFree are currently not resolved correctly.


Reproducible: Always

Steps to Reproduce:
Open some CUDA code (a .cu and .cuh file) in kdevelop. Look at editor.


Actual Results:  
- There is no syntax highlighting.
- Trying to use the switch feature between CUDA definition/declaration does not work.
- Find in Files, does not search .cu or .cuh files.
- When manually associating CUDA .cu and .cuh extensions with C++ parser then syntax highlighting and code parsing is incomplete, as the parser is unaware of CUDA syntax.

Expected Results:  
- CUDA syntax is highlighted correctly
- The parser understands CUDA syntax extensions, such as kernel_call<<<...,...>>>
- Switching between definition/declaration works for CUDA code even when file extensions are .cuh or .cu.
- Find in Files will include .cu and .cuh files.


For CUDA language information, see this page:

http://developer.nvidia.com/nvidia-gpu-computing-documentation
Comment 1 Milian Wolff 2012-02-23 15:56:52 UTC
Note: by adding .cuh and .cu via systemsettings -> file associations to the c++ mimetype, you'll get at least basic support.
Comment 2 Tomáš Poledný 2013-12-09 11:26:58 UTC
Thanks Milian adding cuh and cu help very much. I have question about cuda-gdb. it will be great if it will work with KDevelop. I have trable with version of cuda-gdb: 
"You need gdb 7.0.0 or higher.
You are using: NVIDIA (R) CUDA Debugger 5.0 release Portions Copyright (C) 2007-2012 NVIDIA Corporation "
Is there any chance of compatibility between cuda-gdb and gdb? There is http://docs.nvidia.com/cuda/cuda-gdb/ : CUDA-GDB is based on GDB 7.2. Can someone try it with KDevelop and remove version constrain?
Comment 3 Kevin Funk 2017-03-24 20:55:34 UTC
Initial support available: https://phabricator.kde.org/D5072

Will be part of KDevelop 5.2. Still leaving this open since there are still a few things missing.