Mercurial > hg > Members > kono > Cerium
comparison example/share_task/spe/Load.cc @ 467:44c0bce54dcf
fix all examples. test_render is not working now.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Oct 2009 19:25:25 +0900 |
parents | 58fd16298954 |
children | ab866bc8a624 |
comparison
equal
deleted
inserted
replaced
466:4fa8760e18c2 | 467:44c0bce54dcf |
---|---|
4 #include "Func.h" | 4 #include "Func.h" |
5 | 5 |
6 /* これは必須 */ | 6 /* これは必須 */ |
7 SchedDefineTask(Load); | 7 SchedDefineTask(Load); |
8 | 8 |
9 int | 9 static int |
10 Load::run(void *rbuf, void *wbuf) | 10 run(SchedTask *s, void *rbuf, void *wbuf) |
11 { | 11 { |
12 int *idata = (int*)get_input(rbuf, 0); | 12 int *idata = (int*)s->get_input(rbuf, 0); |
13 int *odata; | 13 int *odata; |
14 int length = get_param(0); | 14 int length = s->get_param(0); |
15 | 15 |
16 // SPU LS 内に領域確保し、データをコピー | 16 // SPU LS 内に領域確保し、データをコピー |
17 odata = (int*)global_alloc(DATA_ID, sizeof(int)*length); | 17 odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length); |
18 memcpy(odata, idata, sizeof(int)*length); | 18 memcpy(odata, idata, sizeof(int)*length); |
19 | 19 |
20 printf("[TASK_LOAD] "); | 20 s->printf("[TASK_LOAD] "); |
21 for (int i = 0; i < length; i++) { | 21 for (int i = 0; i < length; i++) { |
22 printf("%03d ", odata[i]); | 22 s->printf("%03d ", odata[i]); |
23 } | 23 } |
24 printf("\n"); | 24 s->printf("\n"); |
25 | 25 |
26 return 0; | 26 return 0; |
27 } | 27 } |