diff example/Simple/spe/Twice.cc @ 634:62e570ac5db2 draft

SimpleTask start
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 18 Nov 2009 17:29:14 +0900
parents
children c56f6847fb87
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/Simple/spe/Twice.cc	Wed Nov 18 17:29:14 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*)rbuf;
+    o_data = (int*)wbuf;
+    length = s->read_size();
+    
+    for (int i = 0; i < length; i++) {
+	o_data[i] = i_data[i] * 2;
+    }
+    
+    return 0;
+}