Mercurial > hg > Game > Cerium
changeset 1769:4baed436fc58 draft
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Nov 2013 02:15:22 +0900 |
parents | 8dcaafc9b7a6 |
children | bb7f5ae152c7 |
files | TaskManager/Gpu/GpuScheduler.cc TaskManager/Gpu/GpuScheduler.h TaskManager/test/UtilizationTest/Makefile.def TaskManager/test/UtilizationTest/Makefile.gpu TaskManager/test/UtilizationTest/gpu/gpu_task_init.cc TaskManager/test/UtilizationTest/gpu/task_init.cc |
diffstat | 6 files changed, 29 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Gpu/GpuScheduler.cc Sat Nov 23 01:33:10 2013 +0900 +++ b/TaskManager/Gpu/GpuScheduler.cc Sat Nov 23 02:15:22 2013 +0900 @@ -142,7 +142,7 @@ connector->start_profile(); continue; } - load_kernel(nextTask->command); + if (load_kernel(nextTask->command) == 0) continue ; cl_program& program = *gpu_task_list[nextTask->command].gputask->program; const char *function = gpu_task_list[nextTask->command].name; @@ -330,10 +330,13 @@ /* * kernel file open and build program */ -void +int GpuScheduler::load_kernel(int cmd) { - if (gpu_task_list[cmd].run == null_run) return; + if (gpu_task_list[cmd].run == null_run) { + fprintf(stderr, "GPU kernel %d not defined.\n",cmd); + return 0; + } const char *filename = (const char *)gpu_task_list[cmd].gputask->program; @@ -377,7 +380,7 @@ } gpu_task_list[cmd].gputask->program = program; gpu_task_list[cmd].run = null_run; // kernel is ready - + return 1; } // regist kernel file name
--- a/TaskManager/Gpu/GpuScheduler.h Sat Nov 23 01:33:10 2013 +0900 +++ b/TaskManager/Gpu/GpuScheduler.h Sat Nov 23 02:15:22 2013 +0900 @@ -45,7 +45,7 @@ cl_int ret; private: FifoDmaManager *fifoDmaManager; - void load_kernel(int cmd); + int load_kernel(int cmd); };
--- a/TaskManager/test/UtilizationTest/Makefile.def Sat Nov 23 01:33:10 2013 +0900 +++ b/TaskManager/test/UtilizationTest/Makefile.def Sat Nov 23 02:15:22 2013 +0900 @@ -8,7 +8,7 @@ CERIUM = ../../../../Cerium CC = clang++ -OPT = -g +OPT = -g -O0 CFLAGS = $(OPT) -Wall INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager
--- a/TaskManager/test/UtilizationTest/Makefile.gpu Sat Nov 23 01:33:10 2013 +0900 +++ b/TaskManager/test/UtilizationTest/Makefile.gpu Sat Nov 23 02:15:22 2013 +0900 @@ -30,15 +30,15 @@ all: $(TARGET) $(TARGET): $(OBJS) $(TASK_OBJS) $(GPU_TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(GPU_TASK_OBJS) $(LIBS) + $(CC) $(OPT) -o $@ $(OBJS) $(TASK_OBJS) $(GPU_TASK_OBJS) $(LIBS) link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + $(CC) $(OPT) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(GPU_TASK_OBJS) $(LIBS) debug: $(TARGET) sudo ppu-gdb ./$(TARGET) clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(GPU_TASK_OBJS) rm -f *~ \#* rm -f gpu/*~ gpu/\#*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/test/UtilizationTest/gpu/gpu_task_init.cc Sat Nov 23 02:15:22 2013 +0900 @@ -0,0 +1,17 @@ +#include "Func.h" +#include "GpuScheduler.h" + +/* 必ずこの位置に書いて */ + +/** + * この関数は ../spe/spe-main と違って + * 自分で呼び出せばいい関数なので + * 好きな関数名でおk (SchedRegisterTask は必須) + */ + +void +gpu_task_init(void) +{ + GpuSchedRegister(MULTIPLY_TASK, "Multi.cl","multi"); + GpuSchedRegister(MULTIPLY_TASK1, "Multi1.cl","multi1"); +}
--- a/TaskManager/test/UtilizationTest/gpu/task_init.cc Sat Nov 23 01:33:10 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#include "Func.h" -#include "GpuScheduler.h" - -/* 必ずこの位置に書いて */ - -/** - * この関数は ../spe/spe-main と違って - * 自分で呼び出せばいい関数なので - * 好きな関数名でおk (SchedRegisterTask は必須) - */ - -void -gpu_task_init(void) -{ - GpuSchedRegister(MULTIPLY_TASK, "gpu/Multi.cl","multi"); -}