annotate src/parallel_execution/examples/Mult.cbc @ 355:45afe5d70956

Fix
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Thu, 22 Jun 2017 16:20:56 +0900
parents b07078bd1f2c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
346
9f8a87389b68 Add Mult.cbc
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "../../context.h"
349
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
2 #include <stdio.h>
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
3 __code mult(struct Integer* input1, struct Integer* input2, __code next(struct Integer* output, ...)) {
353
b07078bd1f2c Add spawn Tasks to TaskManagerImpl
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents: 349
diff changeset
4 struct Integer* output = *O_output;
349
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
5 output->value = input1->value * input2->value;
355
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents: 353
diff changeset
6 printf("%d * %d = %d\n", input1->value, input2->value, output->value);
349
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
7 *O_output = output;
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
8 goto meta(context, next);
346
9f8a87389b68 Add Mult.cbc
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 }
9f8a87389b68 Add Mult.cbc
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
349
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
11 __code mult_stub(struct Context* context) {
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
12 Integer** O_output = (struct Integer **)&context->data[context->odg];
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
13 goto mult(context,
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
14 &context->data[context->idg]->Integer,
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
15 &context->data[context->idg + 1]->Integer,
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
16 context->next,
01e0fa598ce3 Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 347
diff changeset
17 O_output);
346
9f8a87389b68 Add Mult.cbc
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 }