neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

cuda.vim (2311B)


      1 " Vim syntax file
      2 " Language:	CUDA (NVIDIA Compute Unified Device Architecture)
      3 " Maintainer:	Timothy B. Terriberry <tterribe@users.sourceforge.net>
      4 " Last Change:	2024 Apr 04
      5 " Contributor:  jiangyinzuo
      6 
      7 " quit when a syntax file was already loaded
      8 if exists("b:current_syntax")
      9  finish
     10 endif
     11 
     12 " Read the C++ syntax to start with
     13 runtime! syntax/cpp.vim
     14 
     15 " CUDA extentions.
     16 " Reference: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#c-language-extensions
     17 syn keyword cudaStorageClass	__device__ __global__ __host__ __managed__
     18 syn keyword cudaStorageClass	__constant__ __grid_constant__ __shared__
     19 syn keyword cudaStorageClass	__inline__ __noinline__ __forceinline__ __inline_hint__
     20 syn keyword cudaStorageClass	__align__ __thread__ __restrict__
     21 "syn keyword cudaStorageClass	__import__ __export__ __location__
     22 syn keyword cudaType		char1 char2 char3 char4
     23 syn keyword cudaType		uchar1 uchar2 uchar3 uchar4
     24 syn keyword cudaType		short1 short2 short3 short4
     25 syn keyword cudaType		ushort1 ushort2 ushort3 ushort4
     26 syn keyword cudaType		int1 int2 int3 int4
     27 syn keyword cudaType		uint1 uint2 uint3 uint4
     28 syn keyword cudaType		long1 long2 long3 long4
     29 syn keyword cudaType		ulong1 ulong2 ulong3 ulong4
     30 syn keyword cudaType		longlong1 longlong2 longlong3 longlong4
     31 syn keyword cudaType		ulonglong1 ulonglong2 ulonglong3 ulonglong4
     32 syn keyword cudaType		float1 float2 float3 float4
     33 syn keyword cudaType		double1 double2 double3 double4
     34 syn keyword cudaType		dim3 texture textureReference
     35 syn keyword cudaType		cudaError_t cudaDeviceProp cudaMemcpyKind
     36 syn keyword cudaType		cudaArray cudaChannelFormatKind
     37 syn keyword cudaType		cudaChannelFormatDesc cudaTextureAddressMode
     38 syn keyword cudaType		cudaTextureFilterMode cudaTextureReadMode
     39 syn keyword cudaVariable	gridDim blockIdx blockDim threadIdx warpSize
     40 syn keyword cudaConstant	__CUDA_ARCH__
     41 syn keyword cudaConstant	__DEVICE_EMULATION__
     42 " There are too many CUDA enumeration constants. We only define a subset of commonly used constants.
     43 " Reference: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html
     44 syn keyword cudaConstant	cudaSuccess
     45 
     46 hi def link cudaStorageClass	StorageClass
     47 hi def link cudaType		Type
     48 hi def link cudaVariable	Identifier
     49 hi def link cudaConstant	Constant
     50 
     51 let b:current_syntax = "cuda"
     52 
     53 " vim: ts=8