# HG changeset patch # User Shinji KONO # Date 1259782191 -32400 # Node ID 6bec6efda444d4bc5c74956a51ed3e926479296e # Parent d753b4f6b1296c610e5fbe7a15f908f1ca475eb0 vector fix on Simple Task diff -r d753b4f6b129 -r 6bec6efda444 TaskManager/Makefile.def --- a/TaskManager/Makefile.def Thu Dec 03 04:23:36 2009 +0900 +++ b/TaskManager/Makefile.def Thu Dec 03 04:29:51 2009 +0900 @@ -29,8 +29,8 @@ ABIBIT = 32 -SIMPLE_TASK=-DSIMPLE_TASK -# SIMPLE_TASK= +# SIMPLE_TASK=-DSIMPLE_TASK +SIMPLE_TASK= OPT = -O9 -g # OPT = -g diff -r d753b4f6b129 -r 6bec6efda444 example/word_count_test/Makefile.def --- a/example/word_count_test/Makefile.def Thu Dec 03 04:23:36 2009 +0900 +++ b/example/word_count_test/Makefile.def Thu Dec 03 04:29:51 2009 +0900 @@ -7,10 +7,11 @@ # ex linux/ps3 CERIUM = ../../../Cerium -SIMPLE_TASK= -DSIMPLE_TASK +# SIMPLE_TASK= -DSIMPLE_TASK +SIMPLE_TASK= -OPT = -O9 -# OPT = -g +# OPT = -O9 +OPT = -g CC = g++ CFLAGS = -Wall $(OPT) $(SIMPLE_TASK) diff -r d753b4f6b129 -r 6bec6efda444 example/word_count_test/spe/Exec.cc.vector --- a/example/word_count_test/spe/Exec.cc.vector Thu Dec 03 04:23:36 2009 +0900 +++ b/example/word_count_test/spe/Exec.cc.vector Thu Dec 03 04:29:51 2009 +0900 @@ -6,20 +6,28 @@ /* これは必須 */ SchedDefineTask(Exec); -// typedef char *cvector __attribute__ ((vector_size (16))); +typedef char *cvector __attribute__ ((vector_size (16))); // vectorize だと結果がよろしくない... // -typedef char *cvector; +// typedef char *cvector; static int run(SchedTask *s, void *rbuf, void *wbuf) { +#ifdef SIMPLE_TASK + cvector i_data = (cvector)rbuf; + char* i_data0 = (char*)rbuf; + unsigned long long *o_data = (unsigned long long*)wbuf; + unsigned long long *head_tail_flag = o_data +2; + int length = s->read_size(); +#else cvector i_data = (cvector)s->get_input(rbuf, 0); char* i_data0 = (char*)s->get_input(rbuf, 0); unsigned long long *o_data = (unsigned long long*)s->get_output(wbuf, 0); /*担当範囲の先頭、末尾が「改行、スペース」か、「それ以外の文字」かのフラグ*/ unsigned long long *head_tail_flag = (unsigned long long*)s->get_output(wbuf,1); int length = (long)s->get_param(0); +#endif static const char spaces[] = {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20} ; cvector const space = (cvector)spaces;