changeset 1806:a77876642bb3 draft

change get_input() to get_inputAddr() in regex_mas/ppe/Exec.cc
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Tue, 10 Dec 2013 16:51:58 +0900
parents 8c79f9697179
children 8f7052d19157
files example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc
diffstat 2 files changed, 7 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/main.cc	Tue Dec 10 01:02:34 2013 +0900
+++ b/example/regex_mas/main.cc	Tue Dec 10 16:51:58 2013 +0900
@@ -104,7 +104,7 @@
         if (use_task_array) {
             int task_num = (w->size+size-1)/size;
             if (task_num>array_task_num) task_num = array_task_num;
-            task_array = manager->create_task_array(TASK_EXEC,task_num,2,3,1);
+            task_array = manager->create_task_array(TASK_EXEC,task_num,1,3,1);
             if (!all) {
                 t_next->wait_for(task_array);
             } else {
@@ -125,7 +125,6 @@
                 t_exec->set_inData(2,w->BMskip_table, 256);
 
                 t_exec->set_param(0,(long)a);
-                t_exec->set_param(1,(long)w->search_word_len);
 
                 t_exec->set_outData(0,w->o_data + a*w->out_size, w->division_out_size);
             } else if (use_compat) {
--- a/example/regex_mas/ppe/Exec.cc	Tue Dec 10 01:02:34 2013 +0900
+++ b/example/regex_mas/ppe/Exec.cc	Tue Dec 10 16:51:58 2013 +0900
@@ -33,20 +33,16 @@
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
     //get_input
-    unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0);
-    unsigned char *search_word = (unsigned char *)s->get_input(rbuf,1);
-    int *skip_table = (int *)s->get_input(rbuf,2);
+    unsigned char *i_data = (unsigned char *)s->get_inputAddr(0);
+    unsigned char *search_word = (unsigned char *)s->get_inputAddr(1);
+    int *skip_table = (int *)s->get_inputAddr(2);
 
     int length = (int)s->get_inputSize(0);
-    //int sw_len = (int)s->get_inputSize(1);
+    int sw_len = (int)s->get_inputSize(1);
 
     //get_param
-    long task_count = (long)s->get_param(0);
-    long sw_len = (long)s->get_param(1);
-
-    s->printf("[task count: %lld]\n",task_count);
-    //s->printf("[search word: %s]\n",search_word);
-    s->printf("[search word len : %d]\n",sw_len);
+    //long task_count = (long)s->get_param(0);  //何番目のtaskか
+    //s->printf("[task count: %lld]\n",task_count+1);
 
     unsigned long long *o_data = (unsigned long long*)s->get_output(wbuf,0);
 
@@ -54,5 +50,4 @@
     o_data[0] = BM_method(i_data,length,search_word,sw_len,skip_table);
 
     return 0;
-    //s->printf("in Exec.cc\n");
 }