Mercurial > hg > Members > kono > Cerium
annotate example/share_task/ppe/Load.cc @ 625:60aa3f241b10
64bit mode worked on Mac OS X.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2009 10:59:55 +0900 |
parents | 44c0bce54dcf |
children |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include <string.h> | |
3 #include "Load.h" | |
4 #include "Func.h" | |
5 | |
298 | 6 /* これは必須 */ |
109 | 7 SchedDefineTask(Load); |
8 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
9 static int |
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
10 run(SchedTask *s, void *rbuf, void *wbuf) |
109 | 11 { |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
12 int *idata = (int*)s->get_input(rbuf, 0); |
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
13 int *odata = (int*)s->global_get(DATA_ID); |
625
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
14 long length = (long)s->get_param(0); |
109 | 15 |
298 | 16 // SPU LS 内に領域確保し、データをコピー |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
17 odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length); |
109 | 18 memcpy(odata, idata, sizeof(int)*length); |
19 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
20 s->printf("[TASK_LOAD] "); |
109 | 21 for (int i = 0; i < length; i++) { |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
22 s->printf("%03d ", idata[i]); |
109 | 23 } |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
24 s->printf("\n"); |
109 | 25 |
26 return 0; | |
27 } |