I use the vim editor (on Ubuntu). Recently, I have been working with large cuda projects and hence would like to utilize the ctags utility for code browsing. The list of supported languages for exuberant-ctags [here] (http://ctags.sourceforge.net/languages.html) doesnt contain CUDA as of yet. If anyone knows a tweak to do the same, I'd really appreciate the help.
Thanks
EDIT 1: I found the following temporary fix.
To create the tag file for CUDA files, use ctags with the following option (assuming your current directory contains all your cuda files);
$ctags --langmap=c++:+.cu *
Since CUDA C/C++ is based on C++ you can just use C++ mode. You can add the language map using --langmap=c++:+.cu
.
universal-ctags(https://ctags.io) has built-in parser for cuda.
$ ./ctags --list-maps=CUDA
CUDA *.cu *.cuh
I don't know about taglist, but if you are using the Tagbar plugin (a redo of taglist), you can add the following line to .vim/autoload/tagbar.vim:
let s:known_types.cuda = type_cpp
Put it right after the line:
let s:known_types.cpp = type_cpp
For taglist split window, you can add following lines
" cu language
let s:tlist_def_cu_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' .
\ 'c:class;g:enum;s:struct;u:union;f:function'
below
" c++ language
let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' .
\ 'c:class;g:enum;s:struct;u:union;f:function'
in taglist.vim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With