Mercurial > hg > Members > kono > Cerium
view TaskManager/Cell/spe/main.cc @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 5530fa36d42e |
children | 3b6290c05f9f |
line wrap: on
line source
#include <stdio.h> #include "CellScheduler.h" #include "SpeTaskManagerImpl.h" #include "spu_mfcio.h" #include "error.h" extern unsigned char _end[]; int main(unsigned long long speid, unsigned long long argc, unsigned long long argv) { CellScheduler *manager; //const unsigned ls_size = (unsigned)&argc; //unsigned code_size = (unsigned)&_end; //unsigned heap_size = ls_size - code_size; __debug(" ls_size:%10d bytes\n", ls_size); __debug("code_size:%10d bytes\n", code_size); __debug("heap_size:%10d bytes\n", heap_size); TaskManagerImpl *tm = new SpeTaskManagerImpl(); manager = new CellScheduler(); manager->init(tm); manager->id = (int)argc; tm->set_scheduler(manager); spu_write_decrementer(0x7FFFFFFFU); unsigned int prof = spu_read_decrementer(); manager->run(); prof -= spu_read_decrementer(); //printf("%f\n", prof/79800000.0f*1000.0f); manager->finish(); return 0; }