changeset 2032:dae9dc8d1d8f draft

Fix Makefile in linux
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 16 Dec 2014 15:53:39 +0900
parents c8e35ceae52b
children 3494884963a5
files TaskManager/kernel/ppe/TaskManagerImpl.h example/OpenCL/twice.cc example/fft/Makefile.linux example/many_task/Makefile.linux example/many_task/ppe/task_init.cc
diffstat 5 files changed, 42 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h	Sun Nov 16 18:00:06 2014 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.h	Tue Dec 16 15:53:39 2014 +0900
@@ -8,7 +8,9 @@
 #include "HTask.h"
 #include "Scheduler.h"
 #include "TaskLog.h"
+#ifdef __APPLE__
 #include <OpenCL/opencl.h>
+#endif
 class MemList;
 
 extern QueueInfo<TaskQueue> *taskQueuePool ;
--- a/example/OpenCL/twice.cc	Sun Nov 16 18:00:06 2014 +0900
+++ b/example/OpenCL/twice.cc	Tue Dec 16 15:53:39 2014 +0900
@@ -1,10 +1,11 @@
 #include <stdlib.h>
-#include <OpenCL/opencl.h>
+#include <CL/opencl.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <string.h>
+#include <unistd.h>
 
 #define WORKS 10000000
 
--- a/example/fft/Makefile.linux	Sun Nov 16 18:00:06 2014 +0900
+++ b/example/fft/Makefile.linux	Tue Dec 16 15:53:39 2014 +0900
@@ -1,20 +1,21 @@
 include ./Makefile.def
 
 SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE =   # 除外するファイルを書く
+SRCS_EXCLUDE = # 除外するファイルを書く
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
 TASK_DIR  = ppe
 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
-TASK_SRCS_EXCLUDE = 
+TASK_SRCS_EXCLUDE =
 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
 TASK_OBJS = $(TASK_SRCS:.cc=.o)
 
-CC      = g++
+CC      = clang++
+CC += $(ABI)
 # CFLAGS  = -g -Wall# -O9 #-DDEBUG
 
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
+INCLUDE =  -I. -I.. -I${CERIUM}/include/TaskManager
 LIBS = -L${CERIUM}/TaskManager -lFifoManager -lrt
 
 .SUFFIXES: .cc .o
@@ -30,11 +31,34 @@
 link:
 	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
 
+hoge:
+	cpus=0;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=1;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=2;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=3;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=4;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=5;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=6;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=7;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=8;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=9;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=10;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=11;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=12;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=13;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=14;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=15;./$(TARGET) -file lena512.pgm -cpu $$cpus
+	cpus=16;./$(TARGET) -file lena512.pgm -cpu $$cpus
+
 debug: $(TARGET)
-	sudo gdb ./$(TARGET) 
+	sudo gdb ./$(TARGET)
 
+test:
+	./$(TARGET) -file lena512.pgm -cpu 1
+	./$(TARGET) -file lena512.pgm -cpu 4
 clean:
 	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
 	rm -f *~ \#*
 	rm -f ppe/*~ ppe/\#*
 	rm -f spe/*~ spe/\#*
+	rm -f gpu/*~ gpu/\#*
--- a/example/many_task/Makefile.linux	Sun Nov 16 18:00:06 2014 +0900
+++ b/example/many_task/Makefile.linux	Tue Dec 16 15:53:39 2014 +0900
@@ -1,20 +1,22 @@
 include ./Makefile.def
 
+
 SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE =   # 除外するファイルを書く
+SRCS_EXCLUDE = sort-compat.cc sort_test.cc # 除外するファイルを書く
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
 TASK_DIR  = ppe
 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
-TASK_SRCS_EXCLUDE = 
+TASK_SRCS_EXCLUDE = sort_test.cc
 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
 TASK_OBJS = $(TASK_SRCS:.cc=.o)
 
-CC      = g++
+CC      = clang++
+CC += $(ABI)
 # CFLAGS  = -g -Wall# -O9 #-DDEBUG
 
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
+INCLUDE =  -I. -I.. -I${CERIUM}/include/TaskManager
 LIBS = -L${CERIUM}/TaskManager -lFifoManager -lrt
 
 .SUFFIXES: .cc .o
@@ -31,10 +33,11 @@
 	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
 
 debug: $(TARGET)
-	sudo gdb ./$(TARGET) 
+	sudo gdb ./$(TARGET)
 
 clean:
 	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
 	rm -f *~ \#*
 	rm -f ppe/*~ ppe/\#*
 	rm -f spe/*~ spe/\#*
+	rm -f gpu/*~ gpu/\#*
--- a/example/many_task/ppe/task_init.cc	Sun Nov 16 18:00:06 2014 +0900
+++ b/example/many_task/ppe/task_init.cc	Tue Dec 16 15:53:39 2014 +0900
@@ -15,7 +15,7 @@
 {
     SchedRegisterTask(QUICK_SORT, QuickSort);
     SchedRegister(SortSimple);
-    SchedRegister(SortCompat);
+    //    SchedRegister(SortCompat);
     SchedRegister(SortTaskArray);
     
 #ifdef __CERIUM_CUDA__