Skip to content

Commit 0596a99

Browse files
committed
minor : add struct members for clarity
ggml-ci
1 parent cfd5a11 commit 0596a99

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

src/llama.cpp

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,16 +2720,16 @@ struct llama_sbatch {
27202720
ubatch_seq_id.resize(n_ubatch);
27212721
ubatch_output.resize(n_ubatch);
27222722
llama_ubatch ubatch = {
2723-
true,
2724-
0,
2725-
0,
2726-
0,
2727-
!has_embd ? ubatch_token.data() : nullptr,
2728-
has_embd ? ubatch_embd.data() : nullptr,
2729-
ubatch_pos.data(),
2730-
ubatch_n_seq_id.data(),
2731-
ubatch_seq_id.data(),
2732-
ubatch_output.data(),
2723+
/*equal_seqs =*/ true,
2724+
/*n_tokens =*/ 0,
2725+
/*n_seq_tokens =*/ 0,
2726+
/*n_seqs =*/ 0,
2727+
/*token =*/ !has_embd ? ubatch_token.data() : nullptr,
2728+
/*embd =*/ has_embd ? ubatch_embd.data() : nullptr,
2729+
/*pos =*/ ubatch_pos.data(),
2730+
/*n_seq_id =*/ ubatch_n_seq_id.data(),
2731+
/*seq_id =*/ ubatch_seq_id.data(),
2732+
/*output =*/ ubatch_output.data(),
27332733
};
27342734
return ubatch;
27352735
}
@@ -18802,7 +18802,18 @@ struct llama_batch llama_batch_get_one(
1880218802
}
1880318803

1880418804
struct llama_batch llama_batch_init(int32_t n_tokens_alloc, int32_t embd, int32_t n_seq_max) {
18805-
llama_batch batch = { 0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0, };
18805+
llama_batch batch = {
18806+
/*n_tokens =*/ 0,
18807+
/*tokens =*/ nullptr,
18808+
/*embd =*/ nullptr,
18809+
/*pos =*/ nullptr,
18810+
/*n_seq_id =*/ nullptr,
18811+
/*seq_id =*/ nullptr,
18812+
/*logits =*/ nullptr,
18813+
/*all_pos_0 =*/ 0,
18814+
/*all_pos_1 =*/ 0,
18815+
/*all_seq_id =*/ 0,
18816+
};
1880618817

1880718818
if (embd) {
1880818819
batch.embd = (float *) malloc(sizeof(float) * n_tokens_alloc * embd);

0 commit comments

Comments
 (0)