Mercurial > hg > Game > Cerium
changeset 1744:68e5872085ff draft
set_inData(rbuf,1) bugs? same address get_input Data in regex_mas
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 18 Nov 2013 15:31:52 +0900 |
parents | 36eb8c21281a |
children | ef246e421c8c |
files | example/regex_mas/WordCount.h example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/WordCount.h Wed Nov 13 19:25:46 2013 +0900 +++ b/example/regex_mas/WordCount.h Mon Nov 18 15:31:52 2013 +0900 @@ -11,8 +11,10 @@ int task_spwaned; unsigned long long *o_data; int out_task_num; - char * file_mmap; + char *file_mmap; int file_size; + unsigned char *search_word; + int search_word_len; HTaskPtr t_print; } WordCount;
--- a/example/regex_mas/main.cc Wed Nov 13 19:25:46 2013 +0900 +++ b/example/regex_mas/main.cc Mon Nov 18 15:31:52 2013 +0900 @@ -92,6 +92,9 @@ run_tasks(SchedTask *manager, WordCount *w, int task_count, HTaskPtr t_next, int size) { + w->search_word = search_word; + w->search_word_len = strlen((const char *)search_word); + if (task_count < array_task_num) { array_task_num = task_count; if (task_count<=0) return; @@ -128,20 +131,20 @@ if (w->size < size) size = w->size; int set_one_task_length = size/sizeof(char); - //int set_EX_task_length = set_one_task_length + extra_length; //const int ONE_TASK_LENGTH = w->division_size; //const int ONE_LOOP_LENGTH = array_task_num*spe_num*ONE_TASK_LENGTH; //const int ARRAY_LENGTH_SIZE = spe_num * ONE_TASK_LENGTH; //int offset = ONE_LOOP_LENGTH * i + ARRAY_LENGTH_SIZE*j + ONE_TASK_LENGTH*k; t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]); - //t_exec[k]->set_inData(1,(memaddr)search_word, sizeof(search_word)); if(size != w->size){ //最後のタスクかどうかの判定 t_exec[k]->set_param(0,&set_one_task_length + EXTRA_LENGTH); t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH); + t_exec[k]->set_inData(1,w->search_word, w->search_word_len); }else{ t_exec[k]->set_param(0,&set_one_task_length); t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size); + 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);
--- a/example/regex_mas/ppe/Exec.cc Wed Nov 13 19:25:46 2013 +0900 +++ b/example/regex_mas/ppe/Exec.cc Mon Nov 18 15:31:52 2013 +0900 @@ -48,10 +48,11 @@ run(SchedTask *s, void *rbuf, void *wbuf) { unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0); + unsigned char *search_word = (unsigned char*)s->get_input(rbuf,1); + unsigned long long *o_data = (unsigned long long*)wbuf; int length = (int)s->get_inputSize(0); - //unsigned char *search_word = (unsigned char*)s->get_input(1); - unsigned char search_word[] = "doing"; + //unsigned char search_word[] = "doing"; o_data[0] = BM_method(i_data,length,search_word,o_data);