Mercurial > hg > Game > Cerium
changeset 1682:7d01a2891710 draft
remove simple_task_creater in regex_mas/main.cc .
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 07 Aug 2013 02:34:33 +0900 |
parents | 7bc7780e8ece |
children | 0b38dd5439d5 |
files | example/regex_mas/main.cc |
diffstat | 1 files changed, 0 insertions(+), 102 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Wed Aug 07 02:27:44 2013 +0900 +++ b/example/regex_mas/main.cc Wed Aug 07 02:34:33 2013 +0900 @@ -44,108 +44,6 @@ off_t size; } st_mmap_t; -//simple_task_creater自体がもういらない -static void simple_task_creater(int in_total_size, int out_total_size, - int command, int in_data_size, int out_data_size, - void *in_data, void *out_data, SchedTask *manager, - HTask *wait_i, HTask *wait_me) { - int in_task_size = 0; - int out_task_size = 0; - - if (in_total_size != 0) { - in_task_size = in_total_size / in_data_size; - if (in_total_size != in_task_size * in_data_size) { - printf("mismatch of in_total_size and in_data_size\n"); - } - } - - if (out_total_size != 0) { - out_task_size = out_total_size / out_data_size; - if (out_total_size != out_task_size * out_data_size) { - printf("mismatch of out_total_size and out_data_size\n"); - } - } - - /*in, out の大きい方に合わせるのがいいかな? Taskの数は1Task分に使うデータの大きいほうを取るような仕様がいいかな*/ - int task_num = (in_task_size > out_task_size) ? in_task_size : out_task_size; - - if (task_num == 0) task_num = 1; - - /*spe分あればいいのかな?*/ - - int array_num = spe_num; - if (task_num < array_num) { - array_num = task_num; - } - - - HTaskPtr *task_array = (HTask**)manager->allocate(sizeof(HTask*)*array_num); - TaskPtr *t_exec = (Task**)manager->allocate(sizeof(Task*)*array_num); - - int array_length = task_num / array_num; - int rest = task_num % array_num; - - int index = 0; - - for (int k = 0; k < array_num; k++) { - - task_array[k] = manager->create_task_array(command,array_length,0,1,1); - t_exec[k] = 0; - - if (wait_me != 0) { - wait_me->wait_for(task_array[k]); - } - if (wait_i != 0) { - task_array[k]->wait_for(wait_i); - } - - } - - int length = in_data_size/sizeof(char); - for (int j = 0; j < array_length; j++) { - for (int k = 0; k < array_num; k++) { - - t_exec[k] = task_array[k]->next_task_array(command,t_exec[k]); - t_exec[k]->set_param(0,(memaddr)length); - t_exec[k]->set_inData(0,(char*)in_data + index*in_data_size, in_data_size); - t_exec[k]->set_outData(0,(char*)out_data + index*out_data_size, out_data_size); - index++; - - } - } - - for (int k = 0; k < array_num; k++) { - task_array[k]->spawn_task_array(t_exec[k]->next()); - task_array[k]->set_cpu(spe_cpu); - task_array[k]->spawn(); - } - - for (int k = 0; k < rest; k++) { - HTaskPtr t_exec = manager->create_task(command); - t_exec->set_param(0,(memaddr)length); - int offset = length*k; - t_exec->set_param(1,(memaddr)offset); - t_exec->set_inData(0,(char*)in_data + index*in_data_size, in_data_size); - t_exec->set_outData(0,(char*)out_data + index*out_data_size, out_data_size); - - index++; - - if (wait_me != 0) { - wait_me->wait_for(t_exec); - } - if (wait_i != 0) { - t_exec->wait_for(wait_i); - } - - t_exec->set_cpu(spe_cpu); - t_exec->spawn(); - - } - - -} - - /*与えられたsizeをfix_byte_sizeの倍数にする(丸め込むっていうのかな?)*/ static int fix_byte(int size,int fix_byte_size)