robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:9.2.0788: filetype: hip files are not recognized (#40809)721569dd9b

master
2.1 KiB52 linesraw
1" Vim syntax file
2" Language:	HIP (Heterogeneous-compute Interface for Portability)
3" Maintainer:	Young <young20050727@gmail.com>
4" Last Change:	2026 Jul 15
5" Based On:	syntax/cuda.vim by Timothy B. Terriberry
6
7" quit when a syntax file was already loaded
8if exists("b:current_syntax")
9  finish
10endif
11
12" Read the C++ syntax to start with
13runtime! syntax/cpp.vim
14
15" HIP extensions.
16" Reference: https://docs.amd.com/en/latest/develop-perf-tips/hip-programming-guide/
17syn keyword hipStorageClass	__device__ __global__ __host__ __managed__
18syn keyword hipStorageClass	__constant__ __grid_constant__ __shared__
19syn keyword hipStorageClass	__inline__ __noinline__ __forceinline__ __inline_hint__
20syn keyword hipStorageClass	__align__ __thread__ __restrict__
21syn keyword hipType		char1 char2 char3 char4
22syn keyword hipType		uchar1 uchar2 uchar3 uchar4
23syn keyword hipType		short1 short2 short3 short4
24syn keyword hipType		ushort1 ushort2 ushort3 ushort4
25syn keyword hipType		int1 int2 int3 int4
26syn keyword hipType		uint1 uint2 uint3 uint4
27syn keyword hipType		long1 long2 long3 long4
28syn keyword hipType		ulong1 ulong2 ulong3 ulong4
29syn keyword hipType		longlong1 longlong2 longlong3 longlong4
30syn keyword hipType		ulonglong1 ulonglong2 ulonglong3 ulonglong4
31syn keyword hipType		float1 float2 float3 float4
32syn keyword hipType		double1 double2 double3 double4
33syn keyword hipType		dim3 texture textureReference
34syn keyword hipType		hipError_t hipDeviceProp hipMemcpyKind
35syn keyword hipType		hipArray hipChannelFormatKind
36syn keyword hipType		hipChannelFormatDesc hipTextureAddressMode
37syn keyword hipType		hipTextureFilterMode hipTextureReadMode
38syn keyword hipVariable		gridDim blockIdx blockDim threadIdx warpSize
39syn keyword hipConstant		__HIP_ARCH__
40syn keyword hipConstant		__DEVICE_EMULATION__
41" There are too many HIP enumeration constants. We only define a subset of commonly used constants.
42" Reference: https://docs.amd.com/en/latest/develop-perf-tips/hip-programming-guide/
43syn keyword hipConstant		hipSuccess
44
45hi def link hipStorageClass	StorageClass
46hi def link hipType		Type
47hi def link hipVariable		Identifier
48hi def link hipConstant		Constant
49
50let b:current_syntax = "hip"
51
52" vim: ts=8