Mercurial > hg > Game > Cerium
changeset 1737:6bd9a57eb44d draft
minor fix
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 02 Nov 2013 17:34:40 +0900 |
parents | ade645630b86 |
children | 893353c014f5 |
files | TaskManager/kernel/schedule/Scheduler.cc TaskManager/test/UtilizationTest/Func.h TaskManager/test/UtilizationTest/main.cc TaskManager/test/UtilizationTest/multiply TaskManager/test/UtilizationTest/ppe/Multi.cc example/fft/output.pgm example/word_count/main.cc |
diffstat | 7 files changed, 23 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/Scheduler.cc Fri Nov 01 20:23:21 2013 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Sat Nov 02 17:34:40 2013 +0900 @@ -184,7 +184,7 @@ if (table) { MemorySegment* here = (MemorySegment*)( manager->allocate(sizeof(MemorySegment))); - here->data = (void*)(table->vma); + here->data = &(table->vma); here->size = size; here->address = (memaddr)here; code_segment_pool->addLast(here);
--- a/TaskManager/test/UtilizationTest/Func.h Fri Nov 01 20:23:21 2013 +0900 +++ b/TaskManager/test/UtilizationTest/Func.h Sat Nov 02 17:34:40 2013 +0900 @@ -4,4 +4,4 @@ MULTIPLY_TASK1, }; -#define DATA_NUM 10000 +#define DATA_NUM 50000000
--- a/TaskManager/test/UtilizationTest/main.cc Fri Nov 01 20:23:21 2013 +0900 +++ b/TaskManager/test/UtilizationTest/main.cc Sat Nov 02 17:34:40 2013 +0900 @@ -75,7 +75,7 @@ long task_id = 0; HTask *multiply = manager->create_task(MULTIPLY_TASK); - multiply->set_cpu((CPU_TYPE)((int)SPE_ANY)); + multiply->set_cpu((CPU_TYPE)((int)GPU_0)); multiply->set_inData(0,(memaddr)A, sizeof(float)*length); multiply->set_inData(1,(memaddr)B, sizeof(float)*length); multiply->set_param(0,task_id++); @@ -83,20 +83,20 @@ multiply->iterate(length); - // HTask* previous = multiply; - - // for(int i=1;i<4;i++) { - // multiply = manager->create_task(MULTIPLY_TASK); - // multiply->set_cpu((CPU_TYPE)((int)SPE_0+i)); + HTask* previous = multiply; - // multiply->set_inData(0,(memaddr)A, sizeof(float)*length); - // multiply->set_inData(1,(memaddr)B, sizeof(float)*length); - // multiply->set_param(0,task_id++); - // multiply->set_outData(0,(memaddr)C, sizeof(float)*length); + // for(int i=1;i<4;i++) { + multiply = manager->create_task(MULTIPLY_TASK); + multiply->set_cpu((CPU_TYPE)((int)GPU_0)); + + multiply->set_inData(0,(memaddr)A, sizeof(float)*length/10); + multiply->set_inData(1,(memaddr)B, sizeof(float)*length/10); + // multiply->set_param(0,task_id++); + multiply->set_outData(0,(memaddr)C, sizeof(float)*length/10); - // multiply->wait_for(previous); + multiply->wait_for(previous); - // multiply->spawn(); + multiply->iterate(length/10); // previous = multiply; // }
--- a/TaskManager/test/UtilizationTest/ppe/Multi.cc Fri Nov 01 20:23:21 2013 +0900 +++ b/TaskManager/test/UtilizationTest/ppe/Multi.cc Sat Nov 02 17:34:40 2013 +0900 @@ -20,10 +20,10 @@ long task_id = (long)s->get_param(0); current_task_id = task_id; - // long i = s->x; - for(int i=0; i<DATA_NUM; i++) { - C[i]=A[i]*B[i]; - } + long i = s->x; + // for(int i=0; i<DATA_NUM; i++) { + C[i]=A[i]*B[i]; + // } if(current_task_id != task_id) fprintf(stderr,"duplicate task %ld %ld\n",current_task_id,task_id);
--- a/example/word_count/main.cc Fri Nov 01 20:23:21 2013 +0900 +++ b/example/word_count/main.cc Sat Nov 02 17:34:40 2013 +0900 @@ -129,7 +129,7 @@ t_next->wait_for(h_exec); - h_exec->set_cpu(SPE_ANY); + h_exec->set_cpu(spe_cpu); h_exec->spawn(); } else { h_exec = manager->create_task(TASK_EXEC, @@ -137,7 +137,7 @@ (memaddr)(w->o_data + i*w->out_size), w->division_out_size); h_exec->set_param(0,&length); t_next->wait_for(h_exec); - h_exec->set_cpu(SPE_ANY); + h_exec->set_cpu(spe_cpu); h_exec->spawn(); } w->size -= size; @@ -145,7 +145,7 @@ } if (use_task_array) { task_array->spawn_task_array(t_exec->next()); - task_array->set_cpu(SPE_ANY); + task_array->set_cpu(spe_cpu); task_array->spawn(); } else { //if (!all) t_next->wait_for(h_exec); @@ -293,9 +293,9 @@ } else if (strcmp(argv[i], "-anum") == 0) { array_task_num = atoi(argv[i+1]); i++; - } /*else if (strcmp(argv[i], "-g") == 0 ) { + } else if (strcmp(argv[i], "-g") == 0 ) { spe_cpu = GPU_0; - } else if (strcmp(argv[i], "-cpu") == 0) { + }/* else if (strcmp(argv[i], "-cpu") == 0) { spe_num = atoi(argv[i+1]); i++; if (spe_num==0) spe_num = 1;