Mercurial > hg > Game > Cerium
changeset 1487:6b451d72daf5 draft
normal task run on GPU.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Aug 2012 21:49:04 +0900 |
parents | 756aa0f08814 |
children | f8db59d9a24d |
files | TaskManager/Makefile.gpu TaskManager/kernel/ppe/CpuThreads.cc example/basic/Makefile example/basic/Makefile.gpu |
diffstat | 4 files changed, 43 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Makefile.gpu Mon Aug 06 20:35:31 2012 +0900 +++ b/TaskManager/Makefile.gpu Mon Aug 06 21:49:04 2012 +0900 @@ -8,7 +8,7 @@ .SUFFIXES: .cc .o -EXTRA_CFLAGS = -D__CERIUM_GPU__ +EXTRA_CFLAGS = -D__CERIUM_GPU__ -D__CERIUM_PARALLEL__ .cc.o: $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
--- a/TaskManager/kernel/ppe/CpuThreads.cc Mon Aug 06 20:35:31 2012 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.cc Mon Aug 06 21:49:04 2012 +0900 @@ -46,7 +46,7 @@ delete [] threads; delete [] args; #ifdef __CERIUM_GPU__ - delete [] gpu; + delete gpu; #endif }
--- a/example/basic/Makefile Mon Aug 06 20:35:31 2012 +0900 +++ b/example/basic/Makefile Mon Aug 06 21:49:04 2012 +0900 @@ -16,9 +16,13 @@ @echo "Make for PS3 (Cell)" @$(MAKE) -f Makefile.cell +gpu: FORCE + @echo "Make for GPU (open cl)" + @$(MAKE) -f Makefile.gpu + FORCE: clean: @$(MAKE) -f Makefile.macosx clean @$(MAKE) -f Makefile.linux clean - @$(MAKE) -f Makefile.cell clean \ No newline at end of file + @$(MAKE) -f Makefile.cell clean
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/basic/Makefile.gpu Mon Aug 06 21:49:04 2012 +0900 @@ -0,0 +1,36 @@ +include ./Makefile.def + +SRCS_TMP = $(wildcard *.cc) +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 = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) + +LIBS += `sdl-config --libs` -lGpuManager -framework opencl + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) + +$(TARGET): $(OBJS) $(TASK_OBJS) + $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + +debug: $(TARGET) + sudo ppu-gdb ./$(TARGET) + +clean: + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f *~ \#* + rm -f ppe/*~ ppe/\#* + cd spe; $(MAKE) clean