annotate ppe/Twice.cc @ 0:e66ea5014aa1

first commit. But It move "Bulk".
author tkaito
date Tue, 15 Jun 2010 03:14:31 +0900
parents
children 7dc2d920fc7c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
1 #include <stdio.h>
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
2 #include "SchedTaskArray.h"
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
3 #include "Twice.h"
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
4 #include "Func.h"
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
5
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
6 /* これは必須 */
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
7 SchedDefineTask1(Twice,twice_run);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
8
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
9 static int
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
10 twice_run(SchedTask *s,void *rbuf, void *wbuf)
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
11 {
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
12 // SchedTaskArray *a = (SchedTaskArray *)s;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
13
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
14 int *i_data;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
15 int *o_data;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
16 long length;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
17 long count = (long)s->get_param(0);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
18
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
19 for(int j = 0; j<count; j++) {
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
20 i_data = (int*)s->get_input(rbuf, j);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
21 o_data = (int*)s->get_output(wbuf, j);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
22 length = (long)s->get_param(j+1);
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
23
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
24 for (int i = 0; i < length; i++) {
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
25 o_data[i] = i_data[i] * 2;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
26 }
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
27 }
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
28
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
29 return 0;
e66ea5014aa1 first commit. But It move "Bulk".
tkaito
parents:
diff changeset
30 }