Mercurial > hg > Members > Moririn
annotate src/parallel_execution/examples/twice/createArray.cbc @ 410:85b0ddbf458e
Fix CudaWorker
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 14 Sep 2017 02:35:20 +0900 |
parents | 4d1e3697a6b8 |
children | 7679093bdd72 |
rev | line source |
---|---|
409
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include <stdio.h> |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include "../../../context.h" |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 extern int length; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 extern int split; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 extern int* array_ptr; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 __code createArray(__code next(struct Array* output, ...)) { |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 struct Array* output = *O_output; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 output->prefix = length/split; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 output->array = array_ptr; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 output->size = length; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 *O_output = output; |
410
85b0ddbf458e
Fix CudaWorker
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
409
diff
changeset
|
15 printf("created Array\n"); |
409
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 goto meta(context, context->next); |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 } |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 __code createArray_stub(struct Context* context) { |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 Array** O_output = (struct Array **)&context->data[context->odg]; |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 goto createArray(context, |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 context->next, |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 O_output); |
4d1e3697a6b8
Add twice cbc file
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 } |