Skip to content

Commit 2035a3c

Browse files
committed
avoid to change ggml_task_type
1 parent 3b03df5 commit 2035a3c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ggml.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,9 +2725,9 @@ struct ggml_context_container {
27252725
//
27262726

27272727
enum ggml_task_type {
2728-
GGML_TASK_INIT = 1,
2729-
GGML_TASK_COMPUTE = 2,
2730-
GGML_TASK_FINALIZE = 4,
2728+
GGML_TASK_INIT = 0,
2729+
GGML_TASK_COMPUTE,
2730+
GGML_TASK_FINALIZE,
27312731
};
27322732

27332733
struct ggml_compute_params {
@@ -9260,13 +9260,14 @@ static void ggml_graph_compute_thread(void * data) {
92609260
int type = state->params.type;
92619261
if (state->node) {
92629262
if (state->params.ith < state->params.nth) {
9263-
if (type & GGML_TASK_INIT)
9263+
if (type == GGML_TASK_INIT)
92649264
{
92659265
state->params.type = GGML_TASK_INIT;
92669266
ggml_compute_forward(&state->params, state->node);
9267+
type = GGML_TASK_COMPUTE;
92679268
}
92689269

9269-
if (type & GGML_TASK_COMPUTE)
9270+
if (type == GGML_TASK_COMPUTE)
92709271
{
92719272
state->params.type = GGML_TASK_COMPUTE;
92729273
ggml_compute_forward(&state->params, state->node);
@@ -9579,7 +9580,7 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
95799580
continue;
95809581

95819582
workers[next_task].params = (struct ggml_compute_params) {
9582-
.type = GGML_TASK_COMPUTE | GGML_TASK_INIT,
9583+
.type = GGML_TASK_INIT,
95839584
.ith = 0,
95849585
.nth = 1,
95859586
.wsize = 0,

0 commit comments

Comments
 (0)