Mercurial > hg > GearsTemplate
comparison src/parallel_execution/examples/twice/twice.cbc @ 580:39b5adbcd83f
fix twice example
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 27 Nov 2019 18:03:12 +0900 |
parents | e5e3025f503a |
children |
comparison
equal
deleted
inserted
replaced
579:fe8c04001929 | 580:39b5adbcd83f |
---|---|
8 | 8 |
9 __code twice(struct Array* array, struct MultiDim* multiDim, __code next(struct Array* output, ...), struct LoopCounter* loopCounter) { | 9 __code twice(struct Array* array, struct MultiDim* multiDim, __code next(struct Array* output, ...), struct LoopCounter* loopCounter) { |
10 int i = loopCounter->i; | 10 int i = loopCounter->i; |
11 int index = multiDim->x; | 11 int index = multiDim->x; |
12 if (i < array->prefix) { | 12 if (i < array->prefix) { |
13 array->array[i+index*array->prefix] = array->array[i+index*array->prefix]*2; | 13 array->array[i+index*array->prefix].value = array->array[i+index*array->prefix].value*2; |
14 loopCounter->i++; | 14 loopCounter->i++; |
15 | 15 |
16 goto meta(context, C_twice); | 16 goto meta(context, C_twice); |
17 } | 17 } |
18 | 18 |