Mercurial > hg > Game > Cerium
annotate example/share_task/ppe/Exec.cc @ 1258:ee938477af88 draft
add explanation
author | Daichi Toma <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 19 Nov 2011 07:38:48 +0900 |
parents | 94d82f2c842f |
children |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include "Exec.h" | |
3 #include "Func.h" | |
4 | |
298 | 5 /* これは必須 */ |
109 | 6 SchedDefineTask(Exec); |
7 | |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
8 static int |
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
9 run(SchedTask *s, void *rbuf, void *wbuf) |
109 | 10 { |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
11 int *idata = (int*)s->global_get(DATA_ID); |
625
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
12 long length = (long)s->get_param(0); |
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
13 long number = (long)s->get_param(1); |
94d82f2c842f
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
14 long calnum = (long)s->get_param(2); |
109 | 15 |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
16 s->printf("[TASK_EXEC %02d] ", number); |
109 | 17 for (int i = 0; i < length; i++) { |
18 idata[i] += calnum; | |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
19 s->printf("%03d ", idata[i]); |
109 | 20 } |
467
839e34d0cc3c
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
21 s->printf("\n"); |
109 | 22 |
23 return 0; | |
24 } |