annotate example/share_task/spe/Load.cc @ 298:768452fab95e draft

from EUC to UTF-8
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 07 Jun 2009 15:17:41 +0900
parents 028ffc9c0375
children 839e34d0cc3c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <stdio.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include <string.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "Load.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #include "Func.h"
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5
298
768452fab95e from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
6 /* これは必須 */
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 SchedDefineTask(Load);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 int
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 Load::run(void *rbuf, void *wbuf)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 int *idata = (int*)get_input(rbuf, 0);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 int *odata;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 int length = get_param(0);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15
298
768452fab95e from EUC to UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
16 // SPU LS 内に領域確保し、データをコピー
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 odata = (int*)global_alloc(DATA_ID, sizeof(int)*length);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 memcpy(odata, idata, sizeof(int)*length);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 printf("[TASK_LOAD] ");
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 for (int i = 0; i < length; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 printf("%03d ", odata[i]);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 printf("\n");
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 return 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 }