Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Cell/spe/main.cc @ 672:3b6290c05f9f
add profiling code
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 05 Dec 2009 20:20:08 +0900 |
parents | 5530fa36d42e |
children | b386522827ae |
rev | line source |
---|---|
81 | 1 #include <stdio.h> |
2 #include "CellScheduler.h" | |
621 | 3 #include "SpeTaskManagerImpl.h" |
194 | 4 #include "spu_mfcio.h" |
109 | 5 #include "error.h" |
672 | 6 #include "SysFunc.h" |
81 | 7 |
94 | 8 extern unsigned char _end[]; |
9 | |
672 | 10 SchedExternTask(ShowTime); |
11 SchedExternTask(StartProfile); | |
12 | |
13 | |
81 | 14 int |
15 main(unsigned long long speid, | |
16 unsigned long long argc, unsigned long long argv) | |
17 { | |
18 CellScheduler *manager; | |
19 | |
242 | 20 //const unsigned ls_size = (unsigned)&argc; |
21 //unsigned code_size = (unsigned)&_end; | |
22 //unsigned heap_size = ls_size - code_size; | |
94 | 23 |
109 | 24 __debug(" ls_size:%10d bytes\n", ls_size); |
25 __debug("code_size:%10d bytes\n", code_size); | |
26 __debug("heap_size:%10d bytes\n", heap_size); | |
94 | 27 |
637 | 28 TaskManagerImpl *tm = new SpeTaskManagerImpl(); |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
29 |
672 | 30 SchedRegister(ShowTime); |
31 SchedRegister(StartProfile); | |
32 | |
81 | 33 manager = new CellScheduler(); |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
34 manager->init(tm); |
109 | 35 manager->id = (int)argc; |
94 | 36 |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
37 tm->set_scheduler(manager); |
619 | 38 |
81 | 39 manager->run(); |
200 | 40 |
81 | 41 manager->finish(); |
42 | |
43 return 0; | |
44 } |