Mercurial > hg > Game > Cerium
changeset 1788:06f5a4b09396 draft
minor fix
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 02 Dec 2013 19:59:59 +0900 |
parents | 5cde37f02c66 |
children | 82f8250f23d5 |
files | example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Sun Dec 01 16:48:27 2013 +0900 +++ b/example/regex_mas/main.cc Mon Dec 02 19:59:59 2013 +0900 @@ -39,9 +39,11 @@ * いつかはcreate_task_arrayを消したい */ int set_inData_num = 3; -int set_param_num = 0; +int set_param_num = 1; int set_out_num = 1; +int task_count = 0; + static int division = 16; // in Kbyte //static unsigned char* search_word; CPU_TYPE spe_cpu = SPE_ANY; @@ -103,6 +105,7 @@ static void run_tasks(SchedTask *manager, WordCount *w, int task_count, HTaskPtr t_next, int size) { + if (task_count < array_task_num) { array_task_num = task_count; if (task_count<=0) return; @@ -133,6 +136,8 @@ for (int j = 0; j < array_task_num; j++) { for (int k = 0; k < spe_num; k++) { + + task_count++; int a = w->task_spwaned++; if (w->size < size) size = w->size; @@ -147,6 +152,7 @@ } t_exec[k]->set_inData(1,w->search_word, w->search_word_len); t_exec[k]->set_inData(2,w->BMskip_table, 256); + t_exec[k]->set_param(0,(unsigned long long)a); t_exec[k]->set_outData(0,w->o_data + a*w->out_size, w->division_out_size); w->size -= size;
--- a/example/regex_mas/ppe/Exec.cc Sun Dec 01 16:48:27 2013 +0900 +++ b/example/regex_mas/ppe/Exec.cc Mon Dec 02 19:59:59 2013 +0900 @@ -40,8 +40,10 @@ int length = (int)s->get_inputSize(0); int sw_len = (int)s->get_inputSize(1); + unsigned long long task_count = (unsigned long long)s->get_param(0); //s->printf("length %d\n",length); //s->printf("sw_len %d\n",sw_len); + s->printf("[task count: %lld]\n",task_count); unsigned long long *o_data = (unsigned long long*)wbuf; o_data[0] = 0;