annotate example/share_task/ppe/Exec.cc @ 625:60aa3f241b10

64bit mode worked on Mac OS X.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 16 Nov 2009 10:59:55 +0900
parents 44c0bce54dcf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdio.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include "Exec.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "Func.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
298
58fd16298954 from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
5 /* これは必須 */
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6 SchedDefineTask(Exec);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7
467
44c0bce54dcf fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 298
diff changeset
8 static int
44c0bce54dcf 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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 {
467
44c0bce54dcf 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
60aa3f241b10 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);
60aa3f241b10 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);
60aa3f241b10 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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15
467
44c0bce54dcf 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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 for (int i = 0; i < length; i++) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 idata[i] += calnum;
467
44c0bce54dcf 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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 }
467
44c0bce54dcf 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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 return 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 }