Skip to content
CUDA C++ package for Sublime Text 2 & 3
Branch: master
Clone or download
Latest commit 2bf66d1 Dec 11, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
#ifndef-#define-#endif.sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
#include-(inc angle).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
#include-(inc).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
$1.begin()-$1.end()-(beginend).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
.gitignore Remove and ignore .cache files Oct 16, 2012
010-main()-(main).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
030-for-int-loop-(fori).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
Comments (C++).tmPreferences Added source.cuda-c++ to comments, completion, and indentation prefer… Oct 16, 2012
Completion Rules.tmPreferences Added source.cuda-c++ to comments, completion, and indentation prefer… Oct 16, 2012
Enumeration.sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
Indentation Rules.tmPreferences Added source.cuda-c++ to comments, completion, and indentation prefer… Oct 16, 2012
LICENSE Switch to BSD license (was Apache only briefly) Jan 9, 2015
README.md Added cudaMallocManaged snippet Feb 19, 2014
Symbol List - Indent Class Methods.tmPreferences initial commit. Basic CUDA C++ syntax support Oct 10, 2012
Symbol List - Prefix Banner Items.tmPreferences
Typedef.sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
__syncthreads().sublime-snippet
class-..-(class).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
cuda-c++.JSON-tmLanguage Added missing scopename and fixed broken \b Feb 20, 2014
cuda-c++.sublime-build initial commit. Basic CUDA C++ syntax support Oct 10, 2012
cuda-c++.sublime-settings initial commit. Basic CUDA C++ syntax support Oct 10, 2012
cuda-c++.tmLanguage Fix typo Dec 10, 2017
cudaMalloc.sublime-snippet Added cudaMalloc and cudaMemcpy snippets Oct 17, 2012
cudaMallocManaged.sublime-snippet Added cudaMallocManaged snippet Feb 19, 2014
cudaMemcpy.sublime-snippet Fixed cudamemcpy snippet and made it a bit more flexible Dec 4, 2012
do...while-loop-(do).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
execution-configuration.sublime-snippet Windows didn't like the filename <<<>>>.sublime-snippet1 Oct 16, 2012
forv.sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
fprintf.sublime-snippet
if-..-(if).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
kernel.sublime-snippet
namespace-..-(namespace).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
printf-..-(printf).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
read-file-(readF).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
std-map-(map).sublime-snippet
std-vector-(v).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
struct.sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012
template-typename-..-(template).sublime-snippet Made existing C/C++ snippets work in CUDA C++ mode, and added __synct… Oct 16, 2012

README.md

sublimetext-cuda-cpp

CUDA C++ package for Sublime Text 2 & 3

Syntax Highlighting

Currently supports highlighting of all CUDA C/C++ syntax defined in Appendices B and C of the NVIDIA CUDA C Programming Guide (CUDA Toolkit v6.0).

Snippets

  • Execution Configuration: <<< + [TAB] --> <<<gridDim, blockDim, sharedBytes, streamId>>>() with tab stops on each of the arguments.
  • __syncthreads(): __s + [TAB]
  • cudaMalloc: cmal --> cudaMalloc((void**)&variable, bytes);
  • cudaMallocManaged: cmalmng --> cudaMallocManaged((void**)&variable, bytes);
  • cudaMemcpy: cmem --> cudaMemcpy(dest, src, bytes, cudaMemcpyHostToDevice);
  • Kernel function prototype: kernel --> __global__ void kernel() with tab stops on the function name and inside the parentheses.
  • All existing snippets from the C++ package included with Sublime Text 2/3

Installation

Easy

Install via Package Control

Hard

  • At a git-enabled command prompt, cd to Sublime Text 2 packages directory:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/User

    • Windows: %APPDATA%\Sublime Text 2\Packages\User
    • Linux: ~/.config/sublime-text-2/Packages/User
  • Install by cloning the repository to your Sublime Text 2 Packages directory:

    git clone git://github.com/harrism/sublimetext-cuda-cpp.git

Restart Sublime Text afterwards, switch to CUDA C++ as highlighting profile and try it out with one of the commands above.

Contributing

If you want to contribute to this package, please make syntax changes in the cuda-c++.JSON-tmLanguage file, NOT in the cuda-c++.tmLanguage file. I use the AAAPackageDev package for Sublime text to make development easier, including converting JSON to plist (XML) format.

You can’t perform that action at this time.