Mercurial > hg > Game > Cerium
changeset 1798:3babb36ac459 draft
array(bmskip table) allocate size change 256 to 256*sizeof(int)
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 05 Dec 2013 16:41:38 +0900 |
parents | 964978cf41ae |
children | d9122ca02431 |
files | example/regex_mas/main.cc example/send_args/main.cc example/send_args/ppe/Exec.cc |
diffstat | 3 files changed, 6 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Thu Dec 05 00:45:08 2013 +0900 +++ b/example/regex_mas/main.cc Thu Dec 05 16:41:38 2013 +0900 @@ -222,7 +222,7 @@ // bzero(w,sizeof(WordCount)); /* prepare BMSearch*/ - int *skip = (int*)manager->allocate(256); + int *skip = (int*)manager->allocate(256 * sizeof(int)); w->search_word = search_word; w->search_word_len = search_word_len; w->BMskip_table = create_BMskiptable(w->search_word, w->search_word_len, skip);
--- a/example/send_args/main.cc Thu Dec 05 00:45:08 2013 +0900 +++ b/example/send_args/main.cc Thu Dec 05 16:41:38 2013 +0900 @@ -42,22 +42,18 @@ run_start(TaskManager *manager,char *send_word,int send_word_len) { HTask *exec; - int *intTable = (int*)manager->allocate(6); + int *intTable = (int*)manager->allocate(256 * sizeof(int)); - for(int a = 0; a < 4; a++){ + for(int a = 0; a < 256; a++){ intTable[a] = 10 * a; - printf("intTable[%d] : %d ", a, intTable[a]); } - printf("\n"); - printf("%s\n",send_word); - for(int i = 0; i < task_num; i++){ exec = manager->create_task(TASK_EXEC); exec->set_cpu(spe_cpu); exec->set_inData(0,send_word,send_word_len + 1); - exec->set_inData(1,intTable,4); + exec->set_inData(1,intTable,256); exec->set_param(0,(long)i); exec->spawn();
--- a/example/send_args/ppe/Exec.cc Thu Dec 05 00:45:08 2013 +0900 +++ b/example/send_args/ppe/Exec.cc Thu Dec 05 16:41:38 2013 +0900 @@ -18,7 +18,7 @@ static int run(SchedTask *s, void *rbuf, void *wbuf) { - char *search_word = (char *)s->get_input(rbuf,0); + char *receive_word = (char *)s->get_input(rbuf,0); int *intTable = (int *)s->get_input(rbuf,1); int intTable_size = (int)s->get_inputSize(1); @@ -31,7 +31,7 @@ s->printf("\n"); s->printf("task number: %d\n",task_number + 1); - s->printf("args : %s\n",search_word); + s->printf("args : %s\n",receive_word); return 0;