diff example/Bulk/spe/Twice.cc @ 706:e4d2b823903c simple-task-regression

no compile error on Cell. Regression Test. Cell failed some how.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2009 20:21:59 +0900
parents dbe137505f2e
children 5df90e02e34f
line wrap: on
line diff
--- a/example/Bulk/spe/Twice.cc	Mon Dec 14 20:00:42 2009 +0900
+++ b/example/Bulk/spe/Twice.cc	Mon Dec 14 20:21:59 2009 +0900
@@ -1,5 +1,5 @@
 #include <stdio.h>
-#include "SchedTask.h"
+#include "SchedTaskArray.h"
 #include "Twice.h"
 #include "Func.h"
 
@@ -7,18 +7,23 @@
 SchedDefineTask(Twice);
 
 static int
-run(SchedTask *s, void *rbuf, void *wbuf)
+run(SchedTask *s,void *rbuf, void *wbuf)
 {
+    // SchedTaskArray *a = (SchedTaskArray *)s;
+
     int *i_data;
     int *o_data;
-    int length;
+    long length;
+    int count = (int)s->get_param(0);
 
-    i_data = (int*)s->get_input(rbuf, 0);
-    o_data = (int*)s->get_output(wbuf, 0);
-    length = (long)s->get_param(0);
-    
-    for (int i = 0; i < length; i++) {
-	o_data[i] = i_data[i] * 2;
+    for(int j = 0; j<count; j++) {
+	i_data = (int*)s->get_input(rbuf, j);
+	o_data = (int*)s->get_output(wbuf, j);
+	length = (long)s->get_param(j+1);
+	
+	for (int i = 0; i < length; i++) {
+	    o_data[i] = i_data[i] * 2;
+	}
     }
     
     return 0;