changeset 1888:5238ca826d6e draft

clean up DMA
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 03 Jan 2014 18:59:15 +0900
parents 94a824cde2e4
children 8383e9ac5e55
files TaskManager/Cell/MainScheduler.cc TaskManager/Cell/MainScheduler.h TaskManager/Cell/ManyCoreDmaManager.cc TaskManager/Cell/ManyCoreDmaManager.h TaskManager/Cell/PreRefDmaManager.cc TaskManager/Cell/PreRefDmaManager.h TaskManager/Cell/ReferencedDmaManager.cc TaskManager/Cell/ReferencedDmaManager.h TaskManager/Fifo/FifoDmaManager.cc TaskManager/Fifo/FifoDmaManager.h TaskManager/Fifo/MainScheduler.cc TaskManager/Fifo/MainScheduler.h TaskManager/Fifo/PreRefDmaManager.cc TaskManager/Fifo/PreRefDmaManager.h TaskManager/Fifo/ReferencedDmaManager.cc TaskManager/Fifo/ReferencedDmaManager.h TaskManager/Gpu/GpuScheduler.cc TaskManager/Gpu/GpuScheduler.h TaskManager/Makefile.gpu TaskManager/Makefile.parallel TaskManager/kernel/ppe/MailManager.cc TaskManager/kernel/ppe/MailManager.h TaskManager/kernel/schedule/DmaManager.h example/many_task/Makefile.gpu example/word_count/Makefile.def example/word_count/task_init.cc
diffstat 26 files changed, 322 insertions(+), 243 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/MainScheduler.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,35 @@
+#include <stdlib.h>
+#include <string.h>
+#include "MainScheduler.h"
+#include "TaskManagerImpl.h"
+#include "FifoDmaManager.h"
+#include "ReferencedDmaManager.h"
+#include "PreRefDmaManager.h"
+#include "ManyCoreDmaManager.h"
+#include "error.h"
+
+void
+MainScheduler::init_impl(int useRefDma)
+{
+    if (useRefDma & 0x10) {
+        fifoDmaManager = new PreRefDmaManager();
+    } else if (useRefDma & 0x01) {
+        fifoDmaManager = new ManyCoreDmaManager();
+    } else {
+        fifoDmaManager = new ReferencedDmaManager();
+    }
+    connector = fifoDmaManager;
+    connector->init();
+}
+
+/**
+ * メインメモリ領域を allocate する。
+ * Fifo バージョンだから、まあ普通に malloc でおk
+ */
+void
+MainScheduler::mainMem_alloc(int id, int size)
+{
+    mainMemList[id] = (memaddr)manager->allocate(size);
+}
+
+/* end */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/MainScheduler.h	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,30 @@
+#ifndef INCLUDED_MAIN_SCHEDULER
+#define INCLUDED_MAIN_SCHEDULER
+
+#include "Scheduler.h"
+#include "FifoDmaManager.h"
+
+class MainScheduler : public Scheduler {
+ protected:
+    FifoDmaManager *fifoDmaManager;
+ public:
+    ~MainScheduler(void) {}
+    void init_impl(int useRefDma);
+    void mainMem_alloc(int id, int size);
+    void mail_write_from_host(memaddr data) {
+        fifoDmaManager->mail_write_from_host(data);
+    }
+    int min_cpu() { return mincpu; }
+    int max_cpu() {return maxcpu; }
+
+    memaddr mail_read_from_host() {
+        return fifoDmaManager->mail_read_from_host();
+    }
+
+    int has_mail_from_host() {
+        return fifoDmaManager->has_mail_from_host();
+    }
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/ManyCoreDmaManager.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,75 @@
+#include "ReferencedDmaManager.h"
+#include "Scheduler.h"
+#include "TaskManagerImpl.h"
+#include <string.h>
+
+void *
+ReferencedDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
+{
+    return (void*)addr;
+}
+
+void *
+ReferencedDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask)
+{
+//    void *from = (void*)addr;
+//    if (buf != from) 
+//        memcpy(buf, from, size);
+    return (void*)addr;
+}
+
+
+void *
+ReferencedDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask)
+{
+    ListElementPtr elm = &list->element[0];
+    return (void*)elm->addr; // ==readbuf
+}
+
+void
+ReferencedDmaManager::free_(void *buf) {
+}
+
+/**
+ *  DMA buffer offset in rbuf
+ *
+ *  faked offset for real address must be set to get correct address by
+ *    return (void*)((char*)readbuf + inListData.bound[index]);
+ *
+ */
+void
+ReferencedDmaManager::bound(ListData *list)
+{
+    ListElement *elm = list->element;
+    long *bound = list->bound;
+#ifdef __CERIUM_CELL__
+    uint32  readbuf = elm[0].addr;
+#else
+    memaddr readbuf = elm[0].addr;
+#endif
+    for(int i=0;i<list->length;i++) {
+        bound[i] = elm[i].addr-readbuf;
+    }
+}
+
+void *
+ReferencedDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size)
+{
+    return (void*)addr;
+}
+
+void *
+ReferencedDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask)
+{
+//    void *to = (void*)addr;
+//    if (buf != to) 
+//        memcpy(to, buf, size);
+    return (void*)addr;
+}
+
+void
+ReferencedDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
+{
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/ManyCoreDmaManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,20 @@
+#ifndef INCLUDED_MANYCORE_DMA_MANAGER
+#define INCLUDED_MANYCORE_DMA_MANAGER
+
+#include "FifoDmaManager.h"
+#include "SynchronizedMailManager.h"
+
+class ManyCoreDmaManager : public FifoDmaManager {
+
+public:
+
+    virtual void init()
+    {
+        mail_queue1 = new SynchronizedMailManager();
+        mail_queue2 = new SynchronizedMailManager();
+    }
+
+
+} ;
+
+#endif/* REFERENCED_DMA_MANAGER */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/PreRefDmaManager.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,19 @@
+#include "PreRefDmaManager.h"
+#include "Scheduler.h"
+#include "TaskManagerImpl.h"
+
+void *
+PreRefDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
+{
+
+#ifdef __CERIUM_FIFO__
+	asm("prefetcht0 %0"::"m"(addr):"memory");
+#endif // __CERIUM_FIFO__
+
+
+	return (void*)addr;
+}
+
+void
+PreRefDmaManager::free_(void *buf) {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/PreRefDmaManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,14 @@
+#ifndef INCLUDED_PRE_REFERENCED_DMA_MANAGER
+#define INCLUDED_PRE_REFERENCED_DMA_MANAGER
+
+#include "ReferencedDmaManager.h"
+
+class PreRefDmaManager : public ReferencedDmaManager {
+
+public:
+	/* functions */
+    virtual void *dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask);
+    virtual void free_(void *buf);
+} ;
+
+#endif/* PRE_REFERENCED_DMA_MANAGER */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/ReferencedDmaManager.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,75 @@
+#include "ReferencedDmaManager.h"
+#include "Scheduler.h"
+#include "TaskManagerImpl.h"
+#include <string.h>
+
+void *
+ReferencedDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
+{
+    return (void*)addr;
+}
+
+void *
+ReferencedDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask)
+{
+//    void *from = (void*)addr;
+//    if (buf != from) 
+//        memcpy(buf, from, size);
+    return (void*)addr;
+}
+
+
+void *
+ReferencedDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask)
+{
+    ListElementPtr elm = &list->element[0];
+    return (void*)elm->addr; // ==readbuf
+}
+
+void
+ReferencedDmaManager::free_(void *buf) {
+}
+
+/**
+ *  DMA buffer offset in rbuf
+ *
+ *  faked offset for real address must be set to get correct address by
+ *    return (void*)((char*)readbuf + inListData.bound[index]);
+ *
+ */
+void
+ReferencedDmaManager::bound(ListData *list)
+{
+    ListElement *elm = list->element;
+    long *bound = list->bound;
+#ifdef __CERIUM_CELL__
+    uint32  readbuf = elm[0].addr;
+#else
+    memaddr readbuf = elm[0].addr;
+#endif
+    for(int i=0;i<list->length;i++) {
+        bound[i] = elm[i].addr-readbuf;
+    }
+}
+
+void *
+ReferencedDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size)
+{
+    return (void*)addr;
+}
+
+void *
+ReferencedDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask)
+{
+//    void *to = (void*)addr;
+//    if (buf != to) 
+//        memcpy(to, buf, size);
+    return (void*)addr;
+}
+
+void
+ReferencedDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
+{
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/ReferencedDmaManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -0,0 +1,25 @@
+#ifndef INCLUDED_REFERENCED_DMA_MANAGER
+#define INCLUDED_REFERENCED_DMA_MANAGER
+
+#include "ManyCoreDmaManager.h"
+
+class ReferencedDmaManager : public ManyCoreDmaManager {
+
+public:
+	/* functions */
+    virtual void *dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask);
+    virtual void *dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask);
+    virtual void *dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask);
+    virtual void *dma_store(void *buf, memaddr addr, uint32 size, uint32 mask);
+    virtual void dma_storeList(ListDataPtr list, void *buff, uint32 mask);
+    virtual void *get_writebuf(Scheduler *s,memaddr addr, uint32 size);
+
+    virtual void free_(void *buff);
+    virtual void bound(ListData *list);
+    virtual void set_mail_waiter(SemPtr w) {
+        mail_queue1->set_waiter(w);
+    }
+
+} ;
+
+#endif/* REFERENCED_DMA_MANAGER */
--- a/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -5,6 +5,14 @@
 #include "Scheduler.h"
 #include "TaskManagerImpl.h"
 #include "gettime.h"
+#include "MailManager.h"
+
+void 
+FifoDmaManager::init()
+{
+    mail_queue1 = new MailManager();
+    mail_queue2 = new MailManager();
+}
 
 void *
 FifoDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
--- a/TaskManager/Fifo/FifoDmaManager.h	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -3,12 +3,7 @@
 
 #include "base.h"
 #include "DmaManager.h"
-
-#ifdef __CERIUM_PARALLEL__
-#include "SynchronizedMailManager.h"
-#else
 #include "MailManager.h"
-#endif
 
 void do_start_dmawait_profile(unsigned long long *start);
 void do_end_dmawait_profile(unsigned long long *counter,unsigned long long *start,unsigned long long *stop);
@@ -27,20 +22,16 @@
     BASE_NEW_DELETE(FifoDmaManager);
 
     FifoDmaManager() {
-#ifdef __CERIUM_PARALLEL__
-        mail_queue1 = new SynchronizedMailManager();
-        mail_queue2 = new SynchronizedMailManager();
-#else
-        mail_queue1 = new MailManager();
-        mail_queue2 = new MailManager();
-#endif
+
         start_dmawait_profile = &null_start_dmawait_profile;
         end_dmawait_profile = &null_end_dmawait_profile;
     }
 
+    virtual void init();
+
     ~FifoDmaManager() {
-	delete mail_queue1;
-	delete mail_queue2;
+	if (mail_queue1) delete mail_queue1;
+	if (mail_queue2) delete mail_queue2;
     }
 
 	/* variables */
--- a/TaskManager/Fifo/MainScheduler.cc	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include "MainScheduler.h"
-#include "TaskManagerImpl.h"
-#include "FifoDmaManager.h"
-#include "ReferencedDmaManager.h"
-#include "PreRefDmaManager.h"
-#include "error.h"
-
-void
-MainScheduler::init_impl(int useRefDma)
-{
-    if (useRefDma & 0x10) {
-        fifoDmaManager = new PreRefDmaManager();
-    } else if (useRefDma & 0x01) {
-        fifoDmaManager = new FifoDmaManager();
-    } else {
-        fifoDmaManager = new ReferencedDmaManager();
-    }
-    connector = fifoDmaManager;
-}
-
-/**
- * メインメモリ領域を allocate する。
- * Fifo バージョンだから、まあ普通に malloc でおk
- */
-void
-MainScheduler::mainMem_alloc(int id, int size)
-{
-    mainMemList[id] = (memaddr)manager->allocate(size);
-}
-
-/* end */
--- a/TaskManager/Fifo/MainScheduler.h	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#ifndef INCLUDED_MAIN_SCHEDULER
-#define INCLUDED_MAIN_SCHEDULER
-
-#include "Scheduler.h"
-#include "FifoDmaManager.h"
-
-class MainScheduler : public Scheduler {
- protected:
-    FifoDmaManager *fifoDmaManager;
- public:
-    ~MainScheduler(void) {}
-    void init_impl(int useRefDma);
-    void mainMem_alloc(int id, int size);
-    void mail_write_from_host(memaddr data) {
-        fifoDmaManager->mail_write_from_host(data);
-    }
-
-    memaddr mail_read_from_host() {
-        return fifoDmaManager->mail_read_from_host();
-    }
-
-    int has_mail_from_host() {
-        return fifoDmaManager->has_mail_from_host();
-    }
-
-};
-
-#endif
--- a/TaskManager/Fifo/PreRefDmaManager.cc	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#include "PreRefDmaManager.h"
-#include "Scheduler.h"
-#include "TaskManagerImpl.h"
-
-void *
-PreRefDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
-{
-
-#ifdef __CERIUM_FIFO__
-	asm("prefetcht0 %0"::"m"(addr):"memory");
-#endif // __CERIUM_FIFO__
-
-
-	return (void*)addr;
-}
-
-void
-PreRefDmaManager::free_(void *buf) {
-}
--- a/TaskManager/Fifo/PreRefDmaManager.h	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#ifndef INCLUDED_PRE_REFERENCED_DMA_MANAGER
-#define INCLUDED_PRE_REFERENCED_DMA_MANAGER
-
-#include "ReferencedDmaManager.h"
-
-class PreRefDmaManager : public ReferencedDmaManager {
-
-public:
-	/* functions */
-    virtual void *dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask);
-    virtual void free_(void *buf);
-} ;
-
-#endif/* PRE_REFERENCED_DMA_MANAGER */
--- a/TaskManager/Fifo/ReferencedDmaManager.cc	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-#include "ReferencedDmaManager.h"
-#include "Scheduler.h"
-#include "TaskManagerImpl.h"
-#include <string.h>
-
-void *
-ReferencedDmaManager::dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask)
-{
-    return (void*)addr;
-}
-
-void *
-ReferencedDmaManager::dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask)
-{
-//    void *from = (void*)addr;
-//    if (buf != from) 
-//        memcpy(buf, from, size);
-    return (void*)addr;
-}
-
-
-void *
-ReferencedDmaManager::dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask)
-{
-    ListElementPtr elm = &list->element[0];
-    return (void*)elm->addr; // ==readbuf
-}
-
-void
-ReferencedDmaManager::free_(void *buf) {
-}
-
-/**
- *  DMA buffer offset in rbuf
- *
- *  faked offset for real address must be set to get correct address by
- *    return (void*)((char*)readbuf + inListData.bound[index]);
- *
- */
-void
-ReferencedDmaManager::bound(ListData *list)
-{
-    ListElement *elm = list->element;
-    long *bound = list->bound;
-#ifdef __CERIUM_CELL__
-    uint32  readbuf = elm[0].addr;
-#else
-    memaddr readbuf = elm[0].addr;
-#endif
-    for(int i=0;i<list->length;i++) {
-        bound[i] = elm[i].addr-readbuf;
-    }
-}
-
-void *
-ReferencedDmaManager::get_writebuf(Scheduler *s,memaddr addr, uint32 size)
-{
-    return (void*)addr;
-}
-
-void *
-ReferencedDmaManager::dma_store(void *buf, memaddr addr, uint32 size, uint32 mask)
-{
-//    void *to = (void*)addr;
-//    if (buf != to) 
-//        memcpy(to, buf, size);
-    return (void*)addr;
-}
-
-void
-ReferencedDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
-{
-}
-
-
--- a/TaskManager/Fifo/ReferencedDmaManager.h	Fri Jan 03 17:04:46 2014 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#ifndef INCLUDED_REFERENCED_DMA_MANAGER
-#define INCLUDED_REFERENCED_DMA_MANAGER
-
-#include "FifoDmaManager.h"
-
-class ReferencedDmaManager : public FifoDmaManager {
-
-public:
-	/* functions */
-    virtual void *dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask);
-    virtual void *dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask);
-    virtual void *dma_loadList(Scheduler *s, ListDataPtr list, uint32 mask);
-    virtual void *dma_store(void *buf, memaddr addr, uint32 size, uint32 mask);
-    virtual void dma_storeList(ListDataPtr list, void *buff, uint32 mask);
-    virtual void *get_writebuf(Scheduler *s,memaddr addr, uint32 size);
-
-    virtual void free_(void *buff);
-    virtual void bound(ListData *list);
-    virtual void set_mail_waiter(SemPtr w) {
-        mail_queue1->set_waiter(w);
-    }
-
-} ;
-
-#endif/* REFERENCED_DMA_MANAGER */
--- a/TaskManager/Gpu/GpuScheduler.cc	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Gpu/GpuScheduler.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -19,20 +19,6 @@
     init_gpu();
 }
 
-void
-GpuScheduler::init_impl(int useRefDma)
-{
-    if (useRefDma & 0x10) {
-        fifoDmaManager = new PreRefDmaManager(); // Prefetch command and no copy
-    } else if (useRefDma & 0x01) {
-        fifoDmaManager = new FifoDmaManager(); // memcpy
-    } else {
-        fifoDmaManager = new ReferencedDmaManager(); // no copy
-    }
-    connector = fifoDmaManager;
-}
-
-
 /*
  * Prepare OpenCL:
  * get OpenCL information
--- a/TaskManager/Gpu/GpuScheduler.h	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Gpu/GpuScheduler.h	Fri Jan 03 18:59:15 2014 +0900
@@ -1,7 +1,7 @@
 #ifndef INCLUDED_GPU_SCHEDULER
 #define INCLUDED_GPU_SCHEDULER
 
-#include "Scheduler.h"
+#include "MainScheduler.h"
 #include "FifoDmaManager.h"
 #include "GpuThreads.h"
 #include "HTask.h"
@@ -15,7 +15,7 @@
 
 extern TaskObject gpu_task_list[MAX_TASK_OBJECT];
 
-class GpuScheduler : public Scheduler {
+class GpuScheduler : public MainScheduler {
  public:
     typedef struct gpubuffer {
         cl_int allocate_size;
@@ -25,23 +25,10 @@
     } GpuBuffer, *GpuBufferPtr;
     GpuScheduler();
     virtual ~GpuScheduler();
-    void init_impl(int useRefDma);
     void init_gpu();
     void wait_for_event(cl_event* event,GpuBufferPtr m, TaskListPtr taskList,int cur);
     void run();
     
-    void mail_write_from_host(memaddr data) {
-        fifoDmaManager->mail_write_from_host(data);
-    }
-
-    memaddr mail_read_from_host() {
-        return fifoDmaManager->mail_read_from_host();
-    }
-
-    int has_mail_from_host() {
-        return fifoDmaManager->has_mail_from_host();
-    }
-
     cl_platform_id platform_id;
     cl_device_id device_id;
     cl_uint ret_num_platforms;
@@ -56,7 +43,6 @@
     GpuBuffer memout[2];
     HTask::htask_flag flag[2];
 private:
-    FifoDmaManager *fifoDmaManager;
     int load_kernel(int cmd);
     cl_mem createBuffer(GpuBufferPtr m, int i, cl_context context, cl_mem_flags flags, size_t size, cl_int *error);
     void initGpuBuffer(GpuBufferPtr m);
--- a/TaskManager/Makefile.gpu	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Makefile.gpu	Fri Jan 03 18:59:15 2014 +0900
@@ -19,7 +19,8 @@
 
 ALL_OBJS = $(KERN_MAIN_OBJS) $(KERN_PPE_OBJS) $(KERN_SCHED_OBJS) \
 	$(KERN_SYSTASK_OBJS) $(IMPL_FIFO_OBJS) $(KERN_MEM_OBJS) \
-	$(IMPL_GPU_OBJS) Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o
+	$(IMPL_GPU_OBJS) Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o  \
+	    Cell/MainScheduler.o Cell/ManyCoreDmaManager.o Cell/PreRefDmaManager.o Cell/ReferencedDmaManager.o
 
 Makefile.dep: 
 	make -f Makefile.gpu depend
--- a/TaskManager/Makefile.parallel	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/Makefile.parallel	Fri Jan 03 18:59:15 2014 +0900
@@ -21,6 +21,7 @@
 ALL_OBJS = $(KERN_MAIN_OBJS) $(KERN_PPE_OBJS) $(KERN_SCHED_OBJS) \
 	$(KERN_SYSTASK_OBJS) $(IMPL_FIFO_OBJS) $(KERN_MEM_OBJS) \
 	Cell/spe/SpeTaskManagerImpl.o Cell/CellTaskManagerImpl.o
+            Cell/MainScheduler.o Cell/ManyCoreDmaManager.o Cell/PreRefDmaManager.o Cell/ReferencedDmaManager.o
 
 Makefile.dep: 
 	make -f Makefile.parallel depend
--- a/TaskManager/kernel/ppe/MailManager.cc	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/kernel/ppe/MailManager.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -2,6 +2,10 @@
 #include "MailManager.h"
 
 void
+MailManager::set_waiter(Sem* s) {
+}
+
+void
 MailManager::calc_mask(unsigned int qsize) 
 {
     mask = 1;
--- a/TaskManager/kernel/ppe/MailManager.h	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/kernel/ppe/MailManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -15,7 +15,7 @@
     virtual void send(memaddr data);
     virtual memaddr recv();
     virtual int count();
-    virtual void set_waiter(SemPtr w)  = 0;
+    virtual void set_waiter(SemPtr w);
 
 private:
     /* variables */
--- a/TaskManager/kernel/schedule/DmaManager.h	Fri Jan 03 17:04:46 2014 +0900
+++ b/TaskManager/kernel/schedule/DmaManager.h	Fri Jan 03 18:59:15 2014 +0900
@@ -23,6 +23,7 @@
 
     BASE_NEW_DELETE(DmaManager);
 
+    virtual void init() {}  // local initializer ( mainly for mailqueue if avaiable );
     // API for DMA transfer
     virtual void *dma_load(Scheduler *s, memaddr addr, uint32 size, uint32 mask) { return 0; }
     virtual void *dma_load1(void *buf, memaddr addr, uint32 size, uint32 mask) { return 0; }
--- a/example/many_task/Makefile.gpu	Fri Jan 03 17:04:46 2014 +0900
+++ b/example/many_task/Makefile.gpu	Fri Jan 03 18:59:15 2014 +0900
@@ -1,7 +1,7 @@
 include ./Makefile.def
 
 SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE = sort_test.cc gpu/gpu_task_init.cc # 除外するファイルを書く
+SRCS_EXCLUDE = sort_test.cc  # 除外するファイルを書く
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
--- a/example/word_count/Makefile.def	Fri Jan 03 17:04:46 2014 +0900
+++ b/example/word_count/Makefile.def	Fri Jan 03 18:59:15 2014 +0900
@@ -9,10 +9,10 @@
 CERIUM = ../../../Cerium
 
 
-OPT =  -g
+OPT =  -g -O0
 
 CC      = clang++
-CFLAGS  =  -Wall $(OPT) 
+CFLAGS  =  -m64 -Wall $(OPT) 
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
 LIBS = -L${CERIUM}/TaskManager
--- a/example/word_count/task_init.cc	Fri Jan 03 17:04:46 2014 +0900
+++ b/example/word_count/task_init.cc	Fri Jan 03 18:59:15 2014 +0900
@@ -1,6 +1,8 @@
 #include "Func.h"
 #include "Scheduler.h"
+#ifdef __CERIUM_GPU__
 #include "GpuScheduler.h"
+#endif
 
 /* 必ずこの位置に書いて */
 SchedExternTask(Exec);