Mercurial > hg > Game > Cerium
changeset 1819:ce1a5624395e draft
GPU_ANY,fix UtilizationTest
author | kkb |
---|---|
date | Fri, 13 Dec 2013 17:07:33 +0900 |
parents | 658c78f15992 |
children | ff4e06001518 d3e95fcd6f3e |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/test/UtilizationTest/Func.h TaskManager/test/UtilizationTest/gpu/gpu_task_init.cc TaskManager/test/UtilizationTest/main.cc TaskManager/test/UtilizationTest/multiply |
diffstat | 5 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Fri Dec 13 16:17:24 2013 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Fri Dec 13 17:07:33 2013 +0900 @@ -76,7 +76,7 @@ // SPE_ANY が指定されていた時に // これをインクリメントしつつ呼ぶことにする。 unsigned int cur_anySpeid = 0; - +unsigned int cur_anyGPUid = 0; /** * ActiveTaskQueue から Task を * 各 SPE に渡す (backgound) TaskList に入れる @@ -102,6 +102,9 @@ } else if (gpuNum == 0 && htask->cpu_type < (int)SPE_0) { // gpu = 0 で gpu を指定されたときには cpu で実行する speid = cur_anySpeid++ % machineNum + id_offset ; + } else if (htask->cpu_type == GPU_ANY) { + if(gpuNum == 0) speid = cur_anySpeid++ % machineNum; + else speid = cur_anyGPUid++ % gpuNum; } else if (htask->cpu_type < GPU_0+gpuNum) { speid = htask->cpu_type - (int)(GPU_0); #endif
--- a/TaskManager/test/UtilizationTest/Func.h Fri Dec 13 16:17:24 2013 +0900 +++ b/TaskManager/test/UtilizationTest/Func.h Fri Dec 13 17:07:33 2013 +0900 @@ -5,4 +5,4 @@ NOP, }; -#define DATA_NUM 100000000 +#define DATA_NUM 1000000
--- a/TaskManager/test/UtilizationTest/gpu/gpu_task_init.cc Fri Dec 13 16:17:24 2013 +0900 +++ b/TaskManager/test/UtilizationTest/gpu/gpu_task_init.cc Fri Dec 13 17:07:33 2013 +0900 @@ -12,6 +12,7 @@ void gpu_task_init(void) { - GpuSchedRegister(MULTIPLY_TASK, "Multi.cl","multi"); - GpuSchedRegister(MULTIPLY_TASK1, "Multi1.cl","multi1"); + GpuSchedRegister(NOP,"gpu/Nop.cl","nop1"); + GpuSchedRegister(MULTIPLY_TASK, "gpu/Multi.cl","multi"); + GpuSchedRegister(MULTIPLY_TASK1, "gpu/Multi1.cl","multi1"); }
--- a/TaskManager/test/UtilizationTest/main.cc Fri Dec 13 16:17:24 2013 +0900 +++ b/TaskManager/test/UtilizationTest/main.cc Fri Dec 13 17:07:33 2013 +0900 @@ -78,9 +78,9 @@ long task_id = 0; - HTask* nop = manager->create_task(NOP); - nop->set_cpu(GPU_ANY); - nop->spawn(); + HTask* nop = manager->create_task(NOP); + nop->set_cpu(SPE_ANY); + nop->spawn(); HTask *multiply = manager->create_task(MULTIPLY_TASK); multiply->set_cpu(GPU_ANY);