Skip to content

Commit

Permalink
Added cudaMallocManaged snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Feb 19, 2014
1 parent f9563b9 commit 5320726
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
sublimetext-cuda-cpp
====================

CUDA C++ package for Sublime Text 2
CUDA C++ package for Sublime Text 2 & 3

Syntax Highlighting
-------------------

Currently supports highlighting of all CUDA C/C++ syntax defined in Appendices [B][1] and [C][2] of the NVIDIA CUDA C Programming Guide.
Currently supports highlighting of all CUDA C/C++ syntax defined in Appendices [B][1] and [C][2] 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
- All existing snippets from the C++ package included with Sublime Text 2/3

Installation
------------
Expand Down
9 changes: 9 additions & 0 deletions cudaMallocManaged.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
cudaMallocManaged((void**)&${1:variable}, ${2:bytes});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cmalmng</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.cuda-c++</scope>
</snippet>

0 comments on commit 5320726

Please sign in to comment.