blob: 77930e3fd448ef8a35991466c1e83f63e862ac76 [file] [log] [blame]
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001" Vim syntax file
2" Language: CUDA (NVIDIA Compute Unified Device Architecture)
3" Maintainer: Timothy B. Terriberry <tterribe@users.sourceforge.net>
4" Last Change: 2007 Oct 13
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14" Read the C syntax to start with
15if version < 600
16 source <sfile>:p:h/c.vim
17else
18 runtime! syntax/c.vim
19endif
20
21" CUDA extentions
22syn keyword cudaStorageClass __device__ __global__ __host__
23syn keyword cudaStorageClass __constant__ __shared__
24syn keyword cudaStorageClass __inline__ __align__ __thread__
25"syn keyword cudaStorageClass __import__ __export__ __location__
26syn keyword cudaStructure template
27syn keyword cudaType char1 char2 char3 char4
28syn keyword cudaType uchar1 uchar2 uchar3 uchar4
29syn keyword cudaType short1 short2 short3 short4
30syn keyword cudaType ushort1 ushort2 ushort3 ushort4
31syn keyword cudaType int1 int2 int3 int4
32syn keyword cudaType uint1 uint2 uint3 uint4
33syn keyword cudaType long1 long2 long3 long4
34syn keyword cudaType ulong1 ulong2 ulong3 ulong4
35syn keyword cudaType float1 float2 float3 float4
36syn keyword cudaType ufloat1 ufloat2 ufloat3 ufloat4
37syn keyword cudaType dim3 texture textureReference
38syn keyword cudaType cudaError_t cudaDeviceProp cudaMemcpyKind
39syn keyword cudaType cudaArray cudaChannelFormatKind
40syn keyword cudaType cudaChannelFormatDesc cudaTextureAddressMode
41syn keyword cudaType cudaTextureFilterMode cudaTextureReadMode
42syn keyword cudaVariable gridDim blockIdx blockDim threadIdx
43syn keyword cudaConstant __DEVICE_EMULATION__
44syn keyword cudaConstant cudaSuccess
45" Many more errors are defined, but only these are listed in the maunal
46syn keyword cudaConstant cudaErrorMemoryAllocation
47syn keyword cudaConstant cudaErrorInvalidDevicePointer
48syn keyword cudaConstant cudaErrorInvalidSymbol
49syn keyword cudaConstant cudaErrorMixedDeviceExecution
50syn keyword cudaConstant cudaMemcpyHostToHost
51syn keyword cudaConstant cudaMemcpyHostToDevice
52syn keyword cudaConstant cudaMemcpyDeviceToHost
53syn keyword cudaConstant cudaMemcpyDeviceToDevice
54syn keyword cudaConstant cudaReadModeElementType
55syn keyword cudaConstant cudaReadModeNormalizedFloat
56syn keyword cudaConstant cudaFilterModePoint
57syn keyword cudaConstant cudaFilterModeLinear
58syn keyword cudaConstant cudaAddressModeClamp
59syn keyword cudaConstant cudaAddressModeWrap
60syn keyword cudaConstant cudaChannelFormatKindSigned
61syn keyword cudaConstant cudaChannelFormatKindUnsigned
62syn keyword cudaConstant cudaChannelFormatKindFloat
63
64hi def link cudaStorageClass StorageClass
65hi def link cudaStructure Structure
66hi def link cudaType Type
67hi def link cudaVariable Identifier
68hi def link cudaConstant Constant
69
70let b:current_syntax = "cuda"
71
72" vim: ts=8