ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CUDA C++

by harrism ST2/ST3 Trending

CUDA C++ package for Sublime Text 2 & 3

Details

Installs

  • Total 15K
  • Win 6K
  • OS X 4K
  • Linux 6K
Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3
Windows 4 11 8 5 2 4 7 1 7 6 3 2 4 0 6 4 4 2 7 4 3 2 6 4 2 5 6 6 10 8 5 6 7 2 8 1 4 0 2 6 2 6 4 2 8 0
OS X 2 1 0 0 1 0 4 6 5 6 0 2 2 4 0 2 1 2 2 5 2 6 2 6 5 2 5 3 2 6 2 3 3 2 7 6 2 3 1 1 2 1 0 0 1 4
Linux 5 10 12 6 3 5 9 1 8 8 10 8 4 12 6 5 9 4 6 5 5 9 7 4 7 5 1 7 6 11 10 6 5 13 16 10 10 1 1 4 2 6 4 11 3 4

Readme

Source
raw.​githubusercontent.​com

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.