Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Cell/spe/main.cc @ 636:d433fc37587d
Cell Simple Task compiled. but not worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Nov 2009 19:09:40 +0900 (2009-11-18) |
parents | 5b178db5988a |
children | 5530fa36d42e |
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" |
81 | 6 |
94 | 7 extern unsigned char _end[]; |
8 | |
81 | 9 int |
10 main(unsigned long long speid, | |
11 unsigned long long argc, unsigned long long argv) | |
12 { | |
13 CellScheduler *manager; | |
14 | |
242 | 15 //const unsigned ls_size = (unsigned)&argc; |
16 //unsigned code_size = (unsigned)&_end; | |
17 //unsigned heap_size = ls_size - code_size; | |
94 | 18 |
109 | 19 __debug(" ls_size:%10d bytes\n", ls_size); |
20 __debug("code_size:%10d bytes\n", code_size); | |
21 __debug("heap_size:%10d bytes\n", heap_size); | |
94 | 22 |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
23 TaskManagerImpl *tm = new TaskManagerImpl(); |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
24 |
81 | 25 manager = new CellScheduler(); |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
26 manager->init(tm); |
109 | 27 manager->id = (int)argc; |
94 | 28 |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
29 tm->set_scheduler(manager); |
619 | 30 |
194 | 31 spu_write_decrementer(0x7FFFFFFFU); |
32 unsigned int prof = spu_read_decrementer(); | |
81 | 33 manager->run(); |
212 | 34 |
194 | 35 prof -= spu_read_decrementer(); |
36 | |
200 | 37 //printf("%f\n", prof/79800000.0f*1000.0f); |
38 | |
81 | 39 manager->finish(); |
40 | |
41 return 0; | |
42 } |