annotate example/Bulk/spe/Twice.cc @ 787:5df90e02e34f

fix Bulk
author yutaka@localhost.localdomain
date Sat, 24 Apr 2010 17:25:46 +0900
parents e4d2b823903c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdio.h>
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
2 #include "SchedTaskArray.h"
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "Twice.h"
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "Func.h"
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 /* これは必須 */
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 SchedDefineTask(Twice);
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 static int
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
10 run(SchedTask *s,void *rbuf, void *wbuf)
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 {
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
12 // SchedTaskArray *a = (SchedTaskArray *)s;
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
13
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 int *i_data;
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 int *o_data;
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
16 long length;
787
5df90e02e34f fix Bulk
yutaka@localhost.localdomain
parents: 706
diff changeset
17 int data_count = (int)s->get_param(0);
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
787
5df90e02e34f fix Bulk
yutaka@localhost.localdomain
parents: 706
diff changeset
19 for(int j = 0; j<data_count; j++) {
706
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
20 i_data = (int*)s->get_input(rbuf, j);
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
21 o_data = (int*)s->get_output(wbuf, j);
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
22 length = (long)s->get_param(j+1);
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
23
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
24 for (int i = 0; i < length; i++) {
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
25 o_data[i] = i_data[i] * 2;
e4d2b823903c no compile error on Cell. Regression Test.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 652
diff changeset
26 }
652
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 }
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 return 0;
dbe137505f2e bulk task list start.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 }