comparison src/parallel_execution/examples/twice/twice.cbc @ 406:9b35e6581b5c

Use task member of context by par goto meta Use task member of context for par goto meta ate_stub.pl
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Wed, 06 Sep 2017 15:11:27 +0900
parents 8915fce522b3
children 8ee89eefbc6d
comparison
equal deleted inserted replaced
405:8915fce522b3 406:9b35e6581b5c
1 #include <stdio.h> 1 #include <stdio.h>
2 2
3 #include "../context.h" 3 #include "../context.h"
4 4
5 __code twice(struct Array* array, __code next(...), struct LoopCounter loopCounter) { 5 __code twice(struct Array* array, struct Dim* dim, __code next(...), struct LoopCounter loopCounter) {
6 int i = loopCounter->i; 6 int i = loopCounter->i;
7 if (i < prefix) { 7 if (i < prefix) {
8 array[i+index*prefix] = array[i+index*prefix]*2; 8 array[i+index*prefix] = array[i+index*prefix]*2;
9 loopCounter->i++; 9 loopCounter->i++;
10 10
15 goto meta(context, context->next); 15 goto meta(context, context->next);
16 } 16 }
17 17
18 __code twice_stub(struct Context* context) { 18 __code twice_stub(struct Context* context) {
19 struct LoopCounter* loopCounter = &context->data[context->dataNum]->LoopCounter; 19 struct LoopCounter* loopCounter = &context->data[context->dataNum]->LoopCounter;
20 struct Array* array = &context->data[context->dataNum+1]->Array;
21 goto twice(context, 20 goto twice(context,
22 loopCounter, 21 &context->data[context->idgCount]->Array,
23 array->index, 22 loopCounter);
24 array->prefix,
25 array->array);
26 } 23 }