changeset 1648:89b24515fabf draft

test
author Masa <e085726@ie.u-ryukyu.ac.jp>
date Tue, 25 Jun 2013 15:01:27 +0900
parents 0dcdaa4dfecb
children 05e59edd0743
files example/regex_mas/main.cc example/regex_mas/ppe/Exec.cc
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/example/regex_mas/main.cc	Mon Jun 24 20:44:27 2013 +0900
+++ b/example/regex_mas/main.cc	Tue Jun 25 15:01:27 2013 +0900
@@ -28,7 +28,7 @@
 int use_compat = 0;
 int array_task_num = 8;
 int spe_num = 1;
-char search_word[256];
+unsigned char search_word[256];
 CPU_TYPE spe_cpu = SPE_ANY;
 const char *usr_help_str = "Usage: ./word_count [-a -c -s] [-cpu spe_num] [-file filename]\n";
 
@@ -269,11 +269,11 @@
 
                     t_exec[k] = task_array[k]->next_task_array(TASK_EXEC,t_exec[k]);
                     t_exec[k]->set_param(0,(memaddr)length);
-                    t_exec[k]->set_param(0,(memaddr)length);
                     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]->set_param(1,(memaddr)offset);
+                    t_exec[k]->set_param(2,(memaddr)search_word);
                     //printf("%s\n",search_word);
                     if(size != w->size){ //ラストのタスクかどうかの判定
                         t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH);
@@ -481,7 +481,7 @@
             spe_num = atoi(argv[i+1]);
             if (spe_num==0) spe_num = 1;
         } else if (strcmp(argv[i], "-sw") == 0) {
-            strcpy(search_word,argv[i+1]);
+            strcpy((char*)search_word,argv[i+1]);
         }
     }
     if (filename==0) {
--- a/example/regex_mas/ppe/Exec.cc	Mon Jun 24 20:44:27 2013 +0900
+++ b/example/regex_mas/ppe/Exec.cc	Tue Jun 25 15:01:27 2013 +0900
@@ -53,9 +53,10 @@
     unsigned long long *o_data = (unsigned long long*)wbuf;
     int length = (int)s->get_inputSize(0);
     int *offset = (int*)s->get_param(1);
-    unsigned char search_word[] = "aba";
+    unsigned char *search_word = (unsigned char*)s->get_param(2);
+    //unsigned char search_word[] = "aba";
+    s->printf("%s\n",search_word);
 
-    //printf("offset = %ld\n",(long int)offset);
     BM_method(i_data,offset,length,search_word,o_data);
     //s->printf("in Exec.cc\n");