Mercurial > hg > Game > Cerium
changeset 1536:3d5b540f3aa9 draft
change CPU_TYPE by arg.
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Dec 2012 19:53:30 +0900 |
parents | b995b6edbb56 |
children | b3adb72d906c |
files | example/many_task/Makefile.gpu example/many_task/gpu/gpu_task_init.cc example/many_task/sort.cc example/many_task/task_init.cc |
diffstat | 4 files changed, 7 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/example/many_task/Makefile.gpu Sun Dec 09 18:33:34 2012 +0900 +++ b/example/many_task/Makefile.gpu Sun Dec 09 19:53:30 2012 +0900 @@ -1,8 +1,7 @@ include ./Makefile.def - SRCS_TMP = $(wildcard *.cc) -SRCS_EXCLUDE = sort_test.cc task_init.cc # 除外するファイルを書く +SRCS_EXCLUDE = sort_test.cc gpu/gpu_task_init.cc # 除外するファイルを書く SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) OBJS = $(SRCS:.cc=.o) @@ -13,7 +12,7 @@ TASK_OBJS = $(TASK_SRCS:.cc=.o) CC += $(ABI) -# CFLAGS = -g -Wall# -O9 #-DDEBUG +CFLAGS += -D__CERIUM_GPU__ INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. LIBS = -L${CERIUM}/TaskManager -DUSE_SIMPLE_TASK -lGpuManager -framework opencl `sdl-config --libs`
--- a/example/many_task/gpu/gpu_task_init.cc Sun Dec 09 18:33:34 2012 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -#include "Func.h" -#include "GpuScheduler.h" -#include "Scheduler.h" - -SchedExternTask(SortSimple); - -void -task_init(void) -{ - SchedRegister(SortSimple); - GpuSchedRegister(QUICK_SORT, "gpu/QuickSort.cl", "quick_sort"); -}
--- a/example/many_task/sort.cc Sun Dec 09 18:33:34 2012 +0900 +++ b/example/many_task/sort.cc Sun Dec 09 19:53:30 2012 +0900 @@ -72,7 +72,7 @@ if (i<s->split_num-2 && s->bsort[i]) { s->fsort[i]->wait_for(s->bsort[i]); } - s->fsort[i]->set_cpu(GPU_0); + s->fsort[i]->set_cpu(spe_cpu); s->fsort[i]->set_param(0,(memaddr)block_num); } @@ -87,7 +87,7 @@ if (i>0 && s->bsort[i-1]) { s->fsort[i]->wait_for(s->bsort[i-1]); } - s->fsort[i]->set_cpu(GPU_0); + s->fsort[i]->set_cpu(spe_cpu); s->fsort[i]->set_param(0,(memaddr)last_block_num); } @@ -99,7 +99,7 @@ (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*block_num, (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*block_num); s->bsort[i]->flip(); - s->bsort[i]->set_cpu(GPU_0); + s->bsort[i]->set_cpu(spe_cpu); s->bsort[i]->set_param(0,(memaddr)block_num); } @@ -111,7 +111,7 @@ (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*last_half_block_num, (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*last_half_block_num); s->bsort[i]->flip(); - s->bsort[i]->set_cpu(GPU_0); + s->bsort[i]->set_cpu(spe_cpu); s->bsort[i]->set_param(0,(memaddr)last_half_block_num); }
--- a/example/many_task/task_init.cc Sun Dec 09 18:33:34 2012 +0900 +++ b/example/many_task/task_init.cc Sun Dec 09 19:53:30 2012 +0900 @@ -12,7 +12,7 @@ task_init(void) { #ifdef __CERIUM_GPU__ - GpuSchedRegister(QUICK_SORT, "sort.cl", "sort"); + GpuSchedRegister(QUICK_SORT, "gpu/QuickSort.cl", "quick_sort"); #else SchedRegisterTask(QUICK_SORT, QuickSort); #endif