diff ppe/PadAllocate.cc @ 26:6bea374ee604

global alloc test.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 10 Dec 2010 02:20:37 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ppe/PadAllocate.cc	Fri Dec 10 02:20:37 2010 +0900
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <string.h>
+#include "PadAllocate.h"
+#include "Func.h"
+
+/* これは必須 */
+SchedDefineTask(PadAllocate);
+
+static int
+run(SchedTask *s, void *rbuf, void *wbuf)
+{
+
+    void *idata = s->get_input(rbuf, 0);
+    int pad_id = (int)s->get_param(0);
+    int size = (int)s->get_param(1);
+
+    void *buff = s->global_alloc(pad_id, size);
+    if (idata != NULL) {
+	memcpy(buff,idata,size);
+    }
+
+    return 0;
+}