comparison example/share_task/spe/Load.cc @ 0:04e28d8d3c6f

first commit
author Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
date Mon, 08 Nov 2010 01:23:25 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:04e28d8d3c6f
1 #include <stdio.h>
2 #include <string.h>
3 #include "Load.h"
4 #include "Func.h"
5
6 /* これは必須 */
7 SchedDefineTask(Load);
8
9 static int
10 run(SchedTask *s, void *rbuf, void *wbuf)
11 {
12 int *idata = (int*)s->get_input(rbuf, 0);
13 int *odata;
14 int length = (long)s->get_param(0);
15
16 // SPU LS 内に領域確保し、データをコピー
17 odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length);
18 memcpy(odata, idata, sizeof(int)*length);
19
20 s->printf("[TASK_LOAD] ");
21 for (int i = 0; i < length; i++) {
22 s->printf("%03d ", odata[i]);
23 }
24 s->printf("\n");
25
26 return 0;
27 }