Skip to content

Commit 7c8a4a5

Browse files
committed
Style: middle ptr and ref align, omit optional struct keyword
1 parent 7ac02a8 commit 7c8a4a5

32 files changed

+671
-654
lines changed

ggml/include/ggml-openvino.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#pragma once
22

3-
#include "ggml.h"
43
#include "ggml-backend.h"
4+
#include "ggml.h"
55

6-
#include <cstring>
76
#include <array>
7+
#include <cstring>
88

99
#ifdef __cplusplus
1010
extern "C" {
1111
#endif
1212

13-
#define GGML_OPENVINO_NAME "OPENVINO"
14-
#define GGML_OPENVINO_MAX_DEVICES 16
13+
#define GGML_OPENVINO_NAME "OPENVINO"
14+
#define GGML_OPENVINO_MAX_DEVICES 16
1515

1616
// backend API
1717
GGML_BACKEND_API ggml_backend_t ggml_backend_openvino_init(int device);
@@ -28,7 +28,7 @@ GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_openvino_split_buffer_t
2828
// and GPU
2929
GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_openvino_host_buffer_type(void);
3030

31-
GGML_BACKEND_API int ggml_backend_openvino_get_device_count(void);
31+
GGML_BACKEND_API int ggml_backend_openvino_get_device_count(void);
3232
// GGML_BACKEND_API void ggml_backend_openvino_get_device_description(int device, char * description,
3333
// size_t description_size);
3434
// GGML_BACKEND_API void ggml_backend_openvino_get_device_memory(int device, size_t * free, size_t * total);
@@ -42,13 +42,13 @@ struct ggml_openvino_device_info {
4242
int device_count;
4343

4444
struct openvino_device_info {
45-
int cc; // compute capability
46-
int nsm; // number of streaming multiprocessors
47-
size_t smpb; // max. shared memory per block
48-
size_t smpbo; // max. shared memory per block (with opt-in)
49-
bool vmm; // virtual memory support
50-
size_t vmm_granularity; // granularity of virtual memory
51-
size_t total_vram;
45+
int cc; // compute capability
46+
int nsm; // number of streaming multiprocessors
47+
size_t smpb; // max. shared memory per block
48+
size_t smpbo; // max. shared memory per block (with opt-in)
49+
bool vmm; // virtual memory support
50+
size_t vmm_granularity; // granularity of virtual memory
51+
size_t total_vram;
5252
};
5353

5454
openvino_device_info devices[GGML_OPENVINO_MAX_DEVICES] = {};

ggml/src/ggml-openvino/.clang-format

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
# Override root .clang-format
33
AlignConsecutiveAssignments: false
44
AlignConsecutiveDeclarations: false
5-
ReferenceAlignment: Left
6-
PointerAlignment: Left
75
Cpp11BracedListStyle: true
8-
AccessModifierOffset: -4
9-
BinPackArguments: false
6+
SpacesInContainerLiterals: false
107
BreakBeforeBraces: Attach
8+
AccessModifierOffset: -4
119
IndentCaseBlocks: false
1210
IndentCaseLabels: false
1311

@@ -32,7 +30,15 @@ AllowShortIfStatementsOnASingleLine: Never
3230
AllowShortLambdasOnASingleLine: Inline
3331
AllowShortLoopsOnASingleLine: false
3432
AlwaysBreakBeforeMultilineStrings: true
35-
BinPackParameters: true
33+
# Treat CUDA keywords/attributes as "attribute macros" and avoid breaking lines inside them
34+
AttributeMacros:
35+
- __host__
36+
- __device__
37+
- __global__
38+
- __forceinline__
39+
- __launch_bounds__
40+
BinPackArguments: true
41+
BinPackParameters: false # OnePerLine
3642
BitFieldColonSpacing: Both
3743
# BreakAdjacentStringLiterals: true
3844
BreakAfterAttributes: Never
@@ -58,15 +64,18 @@ ExperimentalAutoDetectBinPacking: false
5864
FixNamespaceComments: true
5965
IncludeBlocks: Regroup
6066
IncludeCategories:
61-
- Regex: '^<.*\.h>'
67+
- Regex: '".*"'
6268
Priority: 1
6369
SortPriority: 0
64-
- Regex: '^<.*'
70+
- Regex: '^<.*\.h>'
6571
Priority: 2
6672
SortPriority: 0
67-
- Regex: '.*'
73+
- Regex: '^<.*'
6874
Priority: 3
6975
SortPriority: 0
76+
- Regex: '.*'
77+
Priority: 4
78+
SortPriority: 0
7079
IncludeIsMainRegex: '([-_](test|unittest))?$'
7180
IncludeIsMainSourceRegex: ''
7281
IndentAccessModifiers: false
@@ -100,6 +109,7 @@ PenaltyBreakString: 1000
100109
PenaltyBreakTemplateDeclaration: 10
101110
PenaltyExcessCharacter: 1000000
102111
PenaltyReturnTypeOnItsOwnLine: 200
112+
PointerAlignment: Middle
103113
QualifierAlignment: Left
104114
#QualifierOrder: ['static', 'inline', 'friend', 'constexpr', 'const', 'volatile', 'type', 'restrict']
105115
RawStringFormats:
@@ -113,6 +123,7 @@ RawStringFormats:
113123
- 'c++'
114124
- 'C++'
115125
CanonicalDelimiter: ''
126+
ReferenceAlignment: Middle
116127
ReflowComments: false # IndentOnly
117128
SeparateDefinitionBlocks: Always
118129
SortIncludes: CaseInsensitive

0 commit comments

Comments
 (0)