changeset 1657:6fe17b1c8cf3 draft

fix GpuRunTest.add ppe task.
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Thu, 04 Jul 2013 18:02:48 +0900
parents 05adaf6f7afb
children ed2fa50168ef
files TaskManager/test/GpuRunTest/Func.h TaskManager/test/GpuRunTest/GpuFunc.h TaskManager/test/GpuRunTest/GpuRunTest.cc TaskManager/test/GpuRunTest/Makefile TaskManager/test/GpuRunTest/Makefile.def TaskManager/test/GpuRunTest/task_init.cc TaskManager/test/SetCpuTest/main.cc
diffstat 7 files changed, 45 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/test/GpuRunTest/Func.h	Thu Jul 04 18:02:48 2013 +0900
@@ -0,0 +1,7 @@
+
+enum {
+#include "SysTasks.h"
+    mogyo,
+    Twice,
+    //    Func1,
+};
--- a/TaskManager/test/GpuRunTest/GpuFunc.h	Tue Jul 02 21:50:02 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-
-enum {
-#include "SysTasks.h"
-    mogyo,
-    Twice,
-    //    Func1,
-};
--- a/TaskManager/test/GpuRunTest/GpuRunTest.cc	Tue Jul 02 21:50:02 2013 +0900
+++ b/TaskManager/test/GpuRunTest/GpuRunTest.cc	Thu Jul 04 18:02:48 2013 +0900
@@ -5,12 +5,14 @@
 #include <sys/stat.h>
 #include "types.h"
 #include "TaskManager.h"
-#include "GpuFunc.h"
+#include "Func.h"
 
 #define DEFAULT 5
-static long int length = DEFAULT;
+static long length = DEFAULT;
+static long times = 2;
 static int task = 1;
 
+extern void gpu_task_init(void);
 extern void task_init(void);
 
 char usr_help_str[] = "GpuRun [length]\n";
@@ -45,6 +47,8 @@
             length = atoi(argv[++i]);
         } else if (strcmp(argv[i], "-count") == 0) {
             task = atoi(argv[++i]);
+        } else if (strcmp(argv[i], "-t") == 0) {
+            times = atoi(argv[++i]);
         }
     }
 
@@ -82,6 +86,15 @@
 
     HTaskPtr twice = manager->create_task(Twice);
     twice->set_param(0, (memaddr)length);
+    twice->set_param(1, (memaddr)times);
+    /*
+    twice->set_param(2, (memaddr)2);
+    twice->set_param(3, (memaddr)3);
+    twice->set_param(4, (memaddr)4);
+    twice->set_param(5, (memaddr)5);
+    twice->set_param(6, (memaddr)6);
+    twice->set_param(7, (memaddr)0x123456789abcdef);
+    */
     twice->set_inData(0, indata, sizeof (int)*length);
     //int *n = new int[1];
     //n[0]= 3;
@@ -104,8 +117,8 @@
         return -1;
     }
 
+    gpu_task_init();
     task_init();
-
     for (int i = 0; i < task; ++i) {
         test(manager);
     }
--- a/TaskManager/test/GpuRunTest/Makefile	Tue Jul 02 21:50:02 2013 +0900
+++ b/TaskManager/test/GpuRunTest/Makefile	Thu Jul 04 18:02:48 2013 +0900
@@ -1,29 +1,29 @@
-include ./Makefile.def
+default: macosx
 
-SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE =   # 除外するファイルを書く
-SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
-OBJS = $(SRCS:.cc=.o)
+macosx: FORCE
+	@echo "Make for Mac OS X"
+	@$(MAKE) -f Makefile.macosx
 
-LIBS += -lGpuManager -framework opencl `sdl-config --libs`
-
-.SUFFIXES: .cc .o
+fifo64: FORCE
+	@echo "Make for Mac OS X 64bit mode"
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
-.cc.o:
-	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
+linux: FORCE
+	@echo "Make for Linux"
+	@$(MAKE) -f Makefile.linux
 
-all: $(TARGET)
-gpu: all
+cell: FORCE
+	@echo "Make for PS3 (Cell)"
+	@$(MAKE) -f Makefile.cell
 
-$(TARGET): $(OBJS)
-	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
+gpu: FORCE
+	@echo "Make for GPU (open cl)"
+	@$(MAKE) -f Makefile.gpu
 
-link:
-	$(CC) -o $(TARGET) $(OBJS) $(LIBS)
+test: FORCE
+	@$(MAKE) -f Makefile.gpu test
 
-debug: $(TARGET)
-	sudo gdb ./$(TARGET) 
+FORCE:
 
 clean:
-	rm -f $(TARGET) $(OBJS)
-	rm -f *~ \#*
+	@$(MAKE) -f Makefile.macosx clean
--- a/TaskManager/test/GpuRunTest/Makefile.def	Tue Jul 02 21:50:02 2013 +0900
+++ b/TaskManager/test/GpuRunTest/Makefile.def	Thu Jul 04 18:02:48 2013 +0900
@@ -5,5 +5,5 @@
 CC      = clang++
 CFLAGS  =   -g -Wall -O0
 
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I../..
+INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager 
 LIBS = -L${CERIUM}/TaskManager
--- a/TaskManager/test/GpuRunTest/task_init.cc	Tue Jul 02 21:50:02 2013 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#include "GpuFunc.h"
-#include "GpuScheduler.h"
-
-void
-task_init(void) {
-    GpuSchedRegister(Twice, "twice.cl", "twice");
-}
--- a/TaskManager/test/SetCpuTest/main.cc	Tue Jul 02 21:50:02 2013 +0900
+++ b/TaskManager/test/SetCpuTest/main.cc	Thu Jul 04 18:02:48 2013 +0900
@@ -5,7 +5,7 @@
 #include <sys/stat.h>
 #include "types.h"
 #include "TaskManager.h"
-#include "GpuFunc.h"
+#include "Func.h"
 
 #define DEFAULT 5
 static long int length = DEFAULT;