changeset 1583:40a3504126a4 draft

fix HTask.
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Sun, 31 Mar 2013 14:21:42 +0900
parents 046695c73cb0
children 4966029eeb32 90c0ad32655f
files TaskManager/Gpu/GpuScheduler.cc TaskManager/Gpu/GpuThreads.cc TaskManager/Gpu/GpuThreads.h TaskManager/kernel/ppe/HTask.cc
diffstat 4 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Gpu/GpuScheduler.cc	Sat Mar 30 23:34:59 2013 +0900
+++ b/TaskManager/Gpu/GpuScheduler.cc	Sun Mar 31 14:21:42 2013 +0900
@@ -207,8 +207,11 @@
                 }
                 
                 if (flag.nd_range){
-                    ret = clEnqueueNDRangeKernel(command_queue,kernel[cur],ndr->dimension,
-                                                 NULL,ndr->gws,ndr->lws,0,NULL, NULL);
+                    int dimension = tasklist->dim;
+                    size_t gws[3];
+                    gws[0]=tasklist->x; gws[1]=tasklist->y;gws[2]=tasklist->z;
+                    ret = clEnqueueNDRangeKernel(command_queue, kernel[cur], dimension,
+                                                 NULL, gws, 0, 0, NULL, NULL);
                 } else {
                     ret = clEnqueueTask(command_queue, kernel[cur], 0, NULL, NULL);
                 }
--- a/TaskManager/Gpu/GpuThreads.cc	Sat Mar 30 23:34:59 2013 +0900
+++ b/TaskManager/Gpu/GpuThreads.cc	Sun Mar 31 14:21:42 2013 +0900
@@ -63,7 +63,7 @@
 
 void
 GpuThreads::spawn_task(int id, TaskListPtr p) {
-    send_mail(id, 1, (memaddr)&p);
+    send_mail(id, 1, (memaddr*)p);
 }
 
 int
--- a/TaskManager/Gpu/GpuThreads.h	Sat Mar 30 23:34:59 2013 +0900
+++ b/TaskManager/Gpu/GpuThreads.h	Sun Mar 31 14:21:42 2013 +0900
@@ -35,7 +35,7 @@
     
     void init();
     static void *gpu_thread_run(void *args);
-
+    virtual void spawn_task(int cpu_num, TaskListPtr p);
     int get_mail(int speid, int count, memaddr *ret);
     int has_mail(int speid, int count, memaddr *ret);
     void send_mail(int speid, int num, memaddr *data);
--- a/TaskManager/kernel/ppe/HTask.cc	Sat Mar 30 23:34:59 2013 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Sun Mar 31 14:21:42 2013 +0900
@@ -20,7 +20,7 @@
 {
     if (export_task_log)
         tasklog->create_time = rdtsc();
-
+    
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -32,6 +32,9 @@
     TaskList *tl = (TaskList*)rbuf;
     tl->dim=1;
     tl->x=x;
+    tl->self = this;
+    tl->set_last(last);
+    mimpl->spawn_task(this);
 }
 
 void
@@ -40,6 +43,9 @@
     tl->dim=2;
     tl->x=x;
     tl->y=y;
+    tl->self = this;
+    tl->set_last(last);
+    mimpl->spawn_task(this);
 }
 
 void
@@ -49,6 +55,9 @@
     tl->x=x;
     tl->y=y;
     tl->z=z;
+    tl->self = this;
+    tl->set_last(last);
+    mimpl->spawn_task(this);
 }
 
 /*!