Skip to content

Commit 321b78a

Browse files
author
chen
committed
use clangformat 14
1 parent ad565b8 commit 321b78a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.github/workflows/pr-checks.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ jobs:
2121
distribution: 'temurin'
2222
cache: gradle
2323

24-
- name: Install clang-format 11 (via apt.llvm.org)
24+
- name: Install clang-format 14 (native)
2525
run: |
2626
sudo apt update
27-
sudo apt install -y wget gnupg software-properties-common
28-
wget https://apt.llvm.org/llvm.sh
29-
chmod +x llvm.sh
30-
sudo ./llvm.sh 11
31-
sudo apt install -y clang-format-11
32-
sudo ln -sf /usr/bin/clang-format-11 /usr/local/bin/clang-format
27+
sudo apt install -y clang-format-14
28+
sudo ln -sf /usr/bin/clang-format-14 /usr/local/bin/clang-format
3329
clang-format --version
3430
3531
- name: Verify clang-format installation

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ spotless {
3737
"cpp/**/*.cpp", "cpp/**/*.h", "cpp/**/*.c", "cpp/**/*.hpp", "cpp/**/*.cc",
3838
)
3939
targetExclude("**/build/**", "**/external/**")
40-
clangFormat("11.1.0")
40+
clangFormat("14.0.6")
4141
}
4242
}

cpp/src/Models/TextDecoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ bool is_exact_match_for_separate_kv_cache_no_alignment_heads(const tflite::Model
101101
}
102102

103103
/* helper functions to calculate the number of inputs and outputs for a given number of layers */
104-
auto calculate_num_inputs_for_variant_with_layers = [=](const int num_layers) -> auto {
104+
auto calculate_num_inputs_for_variant_with_layers = [=](const int num_layers) -> auto{
105105
return num_shared_inputs + num_layers * kv_factor;
106106
};
107107

108-
auto calculate_num_outputs_for_variant_with_layers = [=](const int num_layers) -> auto {
108+
auto calculate_num_outputs_for_variant_with_layers = [=](const int num_layers) -> auto{
109109
return kv_factor * num_layers + 1;
110110
};
111111

112-
auto output_names_for_variant_with_layers = [=](const int num_layers) -> auto {
112+
auto output_names_for_variant_with_layers = [=](const int num_layers) -> auto{
113113
std::unordered_set<std::string> output_names;
114114
output_names.insert(std::string("logits"));
115115
for (int i = 0; i < num_layers; ++i) {
@@ -119,7 +119,7 @@ bool is_exact_match_for_separate_kv_cache_no_alignment_heads(const tflite::Model
119119
return output_names;
120120
};
121121

122-
auto input_names_for_variant_with_layers = [](const int num_layers) -> auto {
122+
auto input_names_for_variant_with_layers = [](const int num_layers) -> auto{
123123
std::unordered_set<std::string> input_names;
124124
input_names.insert(std::string("x"));
125125
input_names.insert(std::string("index"));

0 commit comments

Comments
 (0)