Skip to content

Commit c365cc4

Browse files
committed
fix more missing 'static' specifiers
1 parent 10c850b commit c365cc4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

examples/benchmark/benchmark-matmult.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#pragma warning(disable: 4244 4267) // possible loss of data
2121
#endif
2222

23-
void ggml_graph_compute_helper(std::vector<uint8_t> & buf, ggml_cgraph * graph, int n_threads) {
23+
static void ggml_graph_compute_helper(std::vector<uint8_t> & buf, ggml_cgraph * graph, int n_threads) {
2424
struct ggml_cplan plan = ggml_graph_plan(graph, n_threads);
2525

2626
if (plan.work_size > 0) {
@@ -31,7 +31,7 @@ void ggml_graph_compute_helper(std::vector<uint8_t> & buf, ggml_cgraph * graph,
3131
ggml_graph_compute(graph, &plan);
3232
}
3333

34-
float tensor_sum_elements(const ggml_tensor * tensor) {
34+
static float tensor_sum_elements(const ggml_tensor * tensor) {
3535
float sum = 0;
3636
if (tensor->type==GGML_TYPE_F32) {
3737
for (int j = 0; j < tensor->ne[1]; j++) {
@@ -43,7 +43,7 @@ float tensor_sum_elements(const ggml_tensor * tensor) {
4343
return sum;
4444
}
4545

46-
void tensor_dump(const ggml_tensor * tensor, const char * name) {
46+
static void tensor_dump(const ggml_tensor * tensor, const char * name) {
4747
printf("%15s: type = %i (%5s) ne = %5" PRIi64 " x %5" PRIi64 " x %5" PRIi64 ", nb = (%5zi, %5zi, %5zi) - ", name,
4848
tensor->type, ggml_type_name(tensor->type),
4949
tensor->ne[0], tensor->ne[1], tensor->ne[2], tensor->nb[0], tensor->nb[1], tensor->nb[2]);
@@ -58,7 +58,7 @@ struct benchmark_params_struct {
5858
int32_t n_iterations = 10;
5959
};
6060

61-
void print_usage(int /*argc*/, char ** argv, struct benchmark_params_struct params) {
61+
static void print_usage(int /*argc*/, char ** argv, struct benchmark_params_struct params) {
6262
fprintf(stderr, "usage: %s [options]\n", argv[0]);
6363
fprintf(stderr, "\n");
6464
fprintf(stderr, "options:\n");

pocs/vdot/q8dot.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static_assert(QK4_1 == QK8_0, "QK4_1 and QK8_0 must be the same");
4343
static_assert(QK4_0 == QK8_0, "QK4_0 and QK8_0 must be the same");
4444

4545
template <typename T>
46-
void fillQ4blocks(std::vector<T>& blocks, std::mt19937& rndm) {
46+
static void fillQ4blocks(std::vector<T>& blocks, std::mt19937& rndm) {
4747
for (auto& b : blocks) {
4848
b.d = 1;
4949
for (int i=0; i<QK4_1/2; ++i) {
@@ -54,7 +54,7 @@ void fillQ4blocks(std::vector<T>& blocks, std::mt19937& rndm) {
5454
}
5555
}
5656

57-
void fillQ80blocks(std::vector<block_q8_0>& blocks, std::mt19937& rndm) {
57+
static void fillQ80blocks(std::vector<block_q8_0>& blocks, std::mt19937& rndm) {
5858
for (auto& b : blocks) {
5959
b.d = 1;
6060
int sum = 0;
@@ -66,7 +66,7 @@ void fillQ80blocks(std::vector<block_q8_0>& blocks, std::mt19937& rndm) {
6666
}
6767
}
6868

69-
float simpleDot(const block_q4_0& x, const block_q8_0& y) {
69+
static float simpleDot(const block_q4_0& x, const block_q8_0& y) {
7070
int s1 = 0; //, s2 = 0;
7171
for (int i=0; i<QK4_1/2; i+=2) {
7272
int v1 = x.qs[i+0] & 0xf;
@@ -81,7 +81,7 @@ float simpleDot(const block_q4_0& x, const block_q8_0& y) {
8181
//return y.d * x.d * (s1 - 8 * s2);
8282
}
8383

84-
float simpleDot(const block_q4_1& x, const block_q8_0& y) {
84+
static float simpleDot(const block_q4_1& x, const block_q8_0& y) {
8585
int s1 = 0; //, s2 = 0;
8686
for (int i=0; i<QK4_1/2; i+=2) {
8787
int v1 = x.qs[i+0] & 0xf;

0 commit comments

Comments
 (0)