Mercurial > hg > Game > Cerium
changeset 1760:06fc317e17a3 draft
merge
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Nov 2013 20:10:59 +0900 |
parents | 141174033f1a (current diff) 11d3bd9d2244 (diff) |
children | b98e23499add |
files | |
diffstat | 2 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Fri Nov 22 13:56:37 2013 +0900 +++ b/example/regex_mas/main.cc Fri Nov 22 20:10:59 2013 +0900 @@ -38,7 +38,7 @@ * いつかはcreate_task_arrayを消したい */ int set_inData_num = 2; -int set_param_num = 1; +int set_param_num = 2; int set_out_num = 1; static int division = 16; // in Kbyte @@ -143,15 +143,15 @@ t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]); + t_exec[k]->set_param(0,&w->search_word_len); if(size != w->size){ //最後のタスクかどうかの判定 - t_exec[k]->set_param(0,&w->division_size + w->extra_len); + t_exec[k]->set_param(1,&w->division_size + w->extra_len); t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, w->division_size + w->extra_len); - t_exec[k]->set_inData(1,w->search_word, w->search_word_len); }else{ - t_exec[k]->set_param(0,&w->last_task_size); + t_exec[k]->set_param(1,&w->division_size); t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, w->division_size); - t_exec[k]->set_inData(1,w->search_word, w->search_word_len); } + t_exec[k]->set_inData(1,w->search_word, w->search_word_len); t_exec[k]->set_outData(0,w->o_data + a*w->out_size, w->division_out_size); @@ -283,7 +283,6 @@ } else { w->division_size = w->size; } - w->last_task_size = w->size % w->division_size; /* exec output only "match_num" */ w->status_num = 1;
--- a/example/regex_mas/ppe/Exec.cc Fri Nov 22 13:56:37 2013 +0900 +++ b/example/regex_mas/ppe/Exec.cc Fri Nov 22 20:10:59 2013 +0900 @@ -10,11 +10,11 @@ //ボイヤームーア法による文字列検索アルゴリズム int BM_method(unsigned char *text,int text_length, - unsigned char *pattern,unsigned long long *match_string) + unsigned char *pattern,int sw_len,unsigned long long *match_string) { int skip[256]; int text_len = (long int)text_length; - int pattern_len = strlen((char *)pattern); + int pattern_len = sw_len; int i = 0; int match_counter = 0; @@ -52,9 +52,10 @@ unsigned long long *o_data = (unsigned long long*)wbuf; int length = (int)s->get_inputSize(0); + int sw_len = (int)s->get_inputSize(1); //unsigned char search_word[] = "doing"; - o_data[0] = BM_method(i_data,length,search_word,o_data); + o_data[0] = BM_method(i_data,length,search_word,sw_len,o_data); //s->printf("in Exec.cc\n");