comparison example/share_task/spe/Load.cc @ 109:5c194c71eca8

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents
children 58fd16298954
comparison
equal deleted inserted replaced
108:6f3b3dd3c095 109:5c194c71eca8
1 #include <stdio.h>
2 #include <string.h>
3 #include "Load.h"
4 #include "Func.h"
5
6 /* これは必須 */
7 SchedDefineTask(Load);
8
9 int
10 Load::run(void *rbuf, void *wbuf)
11 {
12 int *idata = (int*)get_input(rbuf, 0);
13 int *odata;
14 int length = get_param(0);
15
16 // SPU LS 内に領域確保し、データをコピー
17 odata = (int*)global_alloc(DATA_ID, sizeof(int)*length);
18 memcpy(odata, idata, sizeof(int)*length);
19
20 printf("[TASK_LOAD] ");
21 for (int i = 0; i < length; i++) {
22 printf("%03d ", odata[i]);
23 }
24 printf("\n");
25
26 return 0;
27 }