Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Cell/spe/SpeTaskManagerImpl.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 |
parents | 5b178db5988a |
children | 5530fa36d42e |
rev | line source |
---|---|
621 | 1 #include "SpeTaskManagerImpl.h" |
619 | 2 #include "Scheduler.h" |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
3 #include <stdlib.h> |
619 | 4 |
5 | |
6 | |
621 | 7 HTaskPtr TaskManagerImpl::create_task(int cmd) {return 0;} |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
8 HTaskPtr TaskManagerImpl::create_task(int cmd, memaddr rbuf, long rs, memaddr wbuf, long ws) { return 0; } |
621 | 9 void TaskManagerImpl::set_task_depend(HTaskPtr master, HTaskPtr slave) {} |
10 void TaskManagerImpl::spawn_task(HTaskPtr) {} | |
11 void TaskManagerImpl::set_task_cpu(HTaskPtr, CPU_TYPE) {} | |
619 | 12 |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
13 void* |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
14 TaskManagerImpl::allocate(int size, int alignment) |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
15 { |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
16 if (size==0) return 0; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
17 #if defined(__SPU__) |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
18 return malloc(size); |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
19 #else |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
20 void *buff; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
21 posix_memalign(&buff, alignment, size); |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
22 return buff; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
23 #endif |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
24 } |
619 | 25 |
636
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
26 void* |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
27 TaskManagerImpl::allocate(int size) |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
28 { |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
29 if (size==0) return 0; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
30 #if defined(__SPU__) |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
31 return malloc(size); |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
32 #else |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
33 void *buff; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
34 posix_memalign(&buff, DEFAULT_ALIGNMENT, size); |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
35 return buff; |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
36 #endif |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
37 } |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
38 |
d433fc37587d
Cell Simple Task compiled. but not worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
621
diff
changeset
|
39 |