diff example/Bulk/spe/Twice.cc @ 652:dbe137505f2e

bulk task list start.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 23 Nov 2009 12:01:45 +0900
parents
children e4d2b823903c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/Bulk/spe/Twice.cc	Mon Nov 23 12:01:45 2009 +0900
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include "SchedTask.h"
+#include "Twice.h"
+#include "Func.h"
+
+/* これは必須 */
+SchedDefineTask(Twice);
+
+static int
+run(SchedTask *s, void *rbuf, void *wbuf)
+{
+    int *i_data;
+    int *o_data;
+    int length;
+
+    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;
+    }
+    
+    return 0;
+}