Mercurial > hg > Game > Cerium
changeset 1794:3d53b0ca02a2 draft
rename string_args to send_args
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 04 Dec 2013 18:01:17 +0900 |
parents | 044b5bd12ef0 |
children | 0aefbf042eb3 |
files | example/send_args/Func.h example/send_args/Makefile example/send_args/Makefile.cell example/send_args/Makefile.def example/send_args/Makefile.linux example/send_args/Makefile.macosx example/send_args/main.cc example/send_args/ppe/Exec.cc example/send_args/ppe/Exec.h example/send_args/ppe/task_init.cc example/send_args/spe/Exec.cc example/send_args/spe/Exec.h example/send_args/spe/task_init.cc example/send_args/spe/test.txt example/string_args/Func.h example/string_args/Makefile example/string_args/Makefile.cell example/string_args/Makefile.def example/string_args/Makefile.linux example/string_args/Makefile.macosx example/string_args/main.cc example/string_args/ppe/Exec.cc example/string_args/ppe/Exec.h example/string_args/ppe/task_init.cc example/string_args/spe/Exec.cc example/string_args/spe/Exec.h example/string_args/spe/task_init.cc example/string_args/spe/test.txt |
diffstat | 26 files changed, 347 insertions(+), 347 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Func.h Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,5 @@ +enum { +#include "SysTasks.h" + TASK_EXEC, +}; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Makefile Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,24 @@ +default: macosx + +macosx: FORCE + @echo "Make for Mac OS X" + @$(MAKE) -f Makefile.macosx + +fifo64: FORCE + @echo "Make for Mac OS X 64bit mode" + @$(MAKE) -f Makefile.macosx ABIBIT=64 + +linux: FORCE + @echo "Make for Linux" + @$(MAKE) -f Makefile.linux + +cell: FORCE + @echo "Make for PS3 (Cell)" + @$(MAKE) -f Makefile.cell + +FORCE: + +clean: + @$(MAKE) -f Makefile.macosx clean + @$(MAKE) -f Makefile.linux clean + @$(MAKE) -f Makefile.cell clean \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Makefile.cell Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,45 @@ +include ./Makefile.def + +ABIBIT=32 +CFLAGS += -m$(ABIBIT) -D__CERIUM_CELL__ + +SRCS_TMP = $(wildcard *.cc) +SRCS_EXCLUDE = # 除外するファイルを書く +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) + +LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) speobject + +$(TARGET): $(OBJS) $(TASK_OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +speobject: + cd spe; $(MAKE) ABIBIT=$(ABIBIT) + +run: + ./$(TARGET) -cpu 6 + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + +debug: $(TARGET) + sudo ppu-gdb ./$(TARGET) + +clean: + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f *~ \#* + rm -f ppe/*~ ppe/\#* + cd spe; $(MAKE) clean
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Makefile.def Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,15 @@ +TARGET = send_args + +# include/library path +# ex macosx +#CERIUM = /Users/gongo/Source/Cerium + +# ex linux/ps3 +CERIUM = ../../../Cerium + +CC = clang++ +OPT = -g +CFLAGS = $(OPT) -Wall + +INCLUDE = -I.. -I. -I${CERIUM}/include/TaskManager +LIBS = -L${CERIUM}/TaskManager
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Makefile.linux Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,36 @@ +include ./Makefile.def + +SRCS_TMP = $(wildcard *.cc) +SRCS_EXCLUDE = # 除外するファイルを書く +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) + +LIBS += -lFifoManager -lrt + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) + +$(TARGET): $(OBJS) $(TASK_OBJS) + $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + +debug: $(TARGET) + sudo gdb ./$(TARGET) + +clean: + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f *~ \#* + rm -f ppe/*~ ppe/\#* + rm -f spe/*~ spe/\#*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/Makefile.macosx Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,36 @@ +include ./Makefile.def + +SRCS_TMP = $(wildcard *.cc) +SRCS_EXCLUDE = # 除外するファイルを書く +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) + +LIBS += -lFifoManager `sdl-config --libs` + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) + +$(TARGET): $(OBJS) $(TASK_OBJS) + $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +link: + $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) + +debug: $(TARGET) + sudo gdb ./$(TARGET) + +clean: + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) + rm -f *~ \#* + rm -f ppe/*~ ppe/\#* + rm -f spe/*~ spe/\#*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/main.cc Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,73 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/time.h> +#include "TaskManager.h" +#include "Func.h" + +extern void task_init(void); + +static int spe_num = 1; +static int task_num = 1; +static CPU_TYPE spe_cpu = SPE_ANY; +static int one_task_size = 4096 * 4; + +extern TaskManager *manager; +const char *usr_help_str = "Usage: ./string_args [-cpu cpu_num] [-sw search_word] [-t task_num]\n"; + +static char* +init(int argc, char **argv) +{ + char *search_word = 0; + + for (int i = 1; argv[i]; ++i) { + if (strcmp(argv[i], "-cpu") == 0) { + spe_num = atoi(argv[i+1]); i++; + } else if (strcmp(argv[i], "-sw") == 0) { + search_word = argv[i+1]; i++; + } else if (strcmp(argv[i], "-t") == 0) { + task_num = atoi(argv[i+1]); i++; + } + } + + if (search_word==0){ + puts(usr_help_str); + exit(1); + } + + return search_word; +} + +static void +run_start(TaskManager *manager,char *search_word,int search_word_len) +{ + HTask *exec; + + for(int i = 0; i < task_num; i++){ + + exec = manager->create_task(TASK_EXEC); + exec->set_cpu(spe_cpu); + exec->set_inData(0,search_word,search_word_len); + + exec->set_param(0,(long)one_task_size); + exec->set_param(1,(long)i); + exec->spawn(); + } +} + + +int +TMmain(TaskManager *manager, int argc, char *argv[]) +{ + const char *search_word = init(argc,argv); + int search_word_len = strlen(search_word); + + char *sword = (char*)manager->allocate(search_word_len+1); + memcpy(sword,search_word,search_word_len); // to get correct alignment + + task_init(); + run_start(manager, sword, search_word_len); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/ppe/Exec.cc Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,34 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/stat.h> +#include <iostream> +#include <vector> +#include <cstdlib> + +#include "SchedTask.h" +#include "Exec.h" +#include "Func.h" + +/* これは必須 */ +SchedDefineTask(Exec); + + + +static int +run(SchedTask *s, void *rbuf, void *wbuf) +{ + const char *search_word = (char *)s->get_input(rbuf,0); + + long task_size = (long)s->get_param(0); + long task_number = (long)s->get_param(1); + + //s->xはiteraterで繰り返した数 + + s->printf("[task number: %d]\n",task_number); + s->printf("[args : %s]\n",search_word); + s->printf("[task size : %d]\n",task_number); + + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/ppe/Exec.h Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,7 @@ +#ifndef INCLUDED_TASK_HELLO +#define INCLUDED_TASK_HELLO + +#include "SchedTask.h" + + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/ppe/task_init.cc Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,17 @@ +#include "Func.h" +#include "Scheduler.h" + +/* 必ずこの位置に書いて */ +SchedExternTask(Exec); + +/** + * この関数は ../spe/spe-main と違って + * 自分で呼び出せばいい関数なので + * 好きな関数名でおk (SchedRegisterTask は必須) + */ + +void +task_init(void) +{ + SchedRegisterTask(TASK_EXEC, Exec); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/spe/Exec.cc Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,31 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/stat.h> +#include <iostream> +#include <vector> +#include <cstdlib> + +#include "SchedTask.h" +#include "Exec.h" +#include "Func.h" + +/* これは必須 */ +SchedDefineTask(Exec); + + + +static int +run(SchedTask *s, void *rbuf, void *wbuf) +{ + char *search_word = (char *)s->get_input(rbuf,0); + + long task_size = (long)s->get_param(0); + + //s->xはiteraterで繰り返した数 + + s->printf("test num : %d\n",task_size); + s->printf("arg word : %s\n",search_word); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/spe/Exec.h Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,7 @@ +#ifndef INCLUDED_TASK_HELLO +#define INCLUDED_TASK_HELLO + +#include "SchedTask.h" + + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/send_args/spe/task_init.cc Wed Dec 04 18:01:17 2013 +0900 @@ -0,0 +1,17 @@ +#include "Func.h" +#include "Scheduler.h" + +/* 必ずこの位置に書いて */ +SchedExternTask(Exec); + +/** + * この関数は ../spe/spe-main と違って + * 自分で呼び出せばいい関数なので + * 好きな関数名でおk (SchedRegisterTask は必須) + */ + +void +task_init(void) +{ + SchedRegisterTask(TASK_EXEC, Exec); +}
--- a/example/string_args/Func.h Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -enum { -#include "SysTasks.h" - TASK_EXEC, -}; -
--- a/example/string_args/Makefile Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -default: macosx - -macosx: FORCE - @echo "Make for Mac OS X" - @$(MAKE) -f Makefile.macosx - -fifo64: FORCE - @echo "Make for Mac OS X 64bit mode" - @$(MAKE) -f Makefile.macosx ABIBIT=64 - -linux: FORCE - @echo "Make for Linux" - @$(MAKE) -f Makefile.linux - -cell: FORCE - @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.cell - -FORCE: - -clean: - @$(MAKE) -f Makefile.macosx clean - @$(MAKE) -f Makefile.linux clean - @$(MAKE) -f Makefile.cell clean \ No newline at end of file
--- a/example/string_args/Makefile.cell Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -include ./Makefile.def - -ABIBIT=32 -CFLAGS += -m$(ABIBIT) -D__CERIUM_CELL__ - -SRCS_TMP = $(wildcard *.cc) -SRCS_EXCLUDE = # 除外するファイルを書く -SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) -OBJS = $(SRCS:.cc=.o) - -TASK_DIR = ppe -TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) -TASK_SRCS_EXCLUDE = -TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) -TASK_OBJS = $(TASK_SRCS:.cc=.o) - -LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) speobject - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -speobject: - cd spe; $(MAKE) ABIBIT=$(ABIBIT) - -run: - ./$(TARGET) -cpu 6 - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo ppu-gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - cd spe; $(MAKE) clean
--- a/example/string_args/Makefile.def Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -TARGET = string_args - -# include/library path -# ex macosx -#CERIUM = /Users/gongo/Source/Cerium - -# ex linux/ps3 -CERIUM = ../../../Cerium - -CC = clang++ -OPT = -g -CFLAGS = $(OPT) -Wall - -INCLUDE = -I.. -I. -I${CERIUM}/include/TaskManager -LIBS = -L${CERIUM}/TaskManager
--- a/example/string_args/Makefile.linux Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -include ./Makefile.def - -SRCS_TMP = $(wildcard *.cc) -SRCS_EXCLUDE = # 除外するファイルを書く -SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) -OBJS = $(SRCS:.cc=.o) - -TASK_DIR = ppe -TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) -TASK_SRCS_EXCLUDE = -TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) -TASK_OBJS = $(TASK_SRCS:.cc=.o) - -LIBS += -lFifoManager -lrt - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - rm -f spe/*~ spe/\#*
--- a/example/string_args/Makefile.macosx Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -include ./Makefile.def - -SRCS_TMP = $(wildcard *.cc) -SRCS_EXCLUDE = # 除外するファイルを書く -SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) -OBJS = $(SRCS:.cc=.o) - -TASK_DIR = ppe -TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) -TASK_SRCS_EXCLUDE = -TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) -TASK_OBJS = $(TASK_SRCS:.cc=.o) - -LIBS += -lFifoManager `sdl-config --libs` - -.SUFFIXES: .cc .o - -.cc.o: - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ - -all: $(TARGET) - -$(TARGET): $(OBJS) $(TASK_OBJS) - $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) - -link: - $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) - -debug: $(TARGET) - sudo gdb ./$(TARGET) - -clean: - rm -f $(TARGET) $(OBJS) $(TASK_OBJS) - rm -f *~ \#* - rm -f ppe/*~ ppe/\#* - rm -f spe/*~ spe/\#*
--- a/example/string_args/main.cc Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <sys/time.h> -#include "TaskManager.h" -#include "Func.h" - -extern void task_init(void); - -static int spe_num = 1; -static int task_num = 1; -static CPU_TYPE spe_cpu = SPE_ANY; -static int one_task_size = 4096 * 4; - -extern TaskManager *manager; -const char *usr_help_str = "Usage: ./string_args [-cpu cpu_num] [-sw search_word] [-t task_num]\n"; - -static char* -init(int argc, char **argv) -{ - char *search_word = 0; - - for (int i = 1; argv[i]; ++i) { - if (strcmp(argv[i], "-cpu") == 0) { - spe_num = atoi(argv[i+1]); i++; - } else if (strcmp(argv[i], "-sw") == 0) { - search_word = argv[i+1]; i++; - } else if (strcmp(argv[i], "-t") == 0) { - task_num = atoi(argv[i+1]); i++; - } - } - - if (search_word==0){ - puts(usr_help_str); - exit(1); - } - - return search_word; -} - -static void -run_start(TaskManager *manager,char *search_word,int search_word_len) -{ - HTask *exec; - - for(int i = 0; i < task_num; i++){ - - exec = manager->create_task(TASK_EXEC); - exec->set_cpu(spe_cpu); - exec->set_inData(0,search_word,search_word_len); - - exec->set_param(0,(long)one_task_size); - exec->set_param(1,(long)i); - exec->spawn(); - } -} - - -int -TMmain(TaskManager *manager, int argc, char *argv[]) -{ - const char *search_word = init(argc,argv); - int search_word_len = strlen(search_word); - - char *sword = (char*)manager->allocate(search_word_len+1); - memcpy(sword,search_word,search_word_len); // to get correct alignment - - task_init(); - run_start(manager, sword, search_word_len); - - return 0; -}
--- a/example/string_args/ppe/Exec.cc Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/stat.h> -#include <iostream> -#include <vector> -#include <cstdlib> - -#include "SchedTask.h" -#include "Exec.h" -#include "Func.h" - -/* これは必須 */ -SchedDefineTask(Exec); - - - -static int -run(SchedTask *s, void *rbuf, void *wbuf) -{ - const char *search_word = (char *)s->get_input(rbuf,0); - - long task_size = (long)s->get_param(0); - long task_number = (long)s->get_param(1); - - //s->xはiteraterで繰り返した数 - - s->printf("[task number: %d]\n",task_number); - s->printf("[args : %s]\n",search_word); - s->printf("[task size : %d]\n",task_number); - - - return 0; -}
--- a/example/string_args/ppe/Exec.h Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -#ifndef INCLUDED_TASK_HELLO -#define INCLUDED_TASK_HELLO - -#include "SchedTask.h" - - -#endif
--- a/example/string_args/ppe/task_init.cc Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#include "Func.h" -#include "Scheduler.h" - -/* 必ずこの位置に書いて */ -SchedExternTask(Exec); - -/** - * この関数は ../spe/spe-main と違って - * 自分で呼び出せばいい関数なので - * 好きな関数名でおk (SchedRegisterTask は必須) - */ - -void -task_init(void) -{ - SchedRegisterTask(TASK_EXEC, Exec); -}
--- a/example/string_args/spe/Exec.cc Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/stat.h> -#include <iostream> -#include <vector> -#include <cstdlib> - -#include "SchedTask.h" -#include "Exec.h" -#include "Func.h" - -/* これは必須 */ -SchedDefineTask(Exec); - - - -static int -run(SchedTask *s, void *rbuf, void *wbuf) -{ - char *search_word = (char *)s->get_input(rbuf,0); - - long task_size = (long)s->get_param(0); - - //s->xはiteraterで繰り返した数 - - s->printf("test num : %d\n",task_size); - s->printf("arg word : %s\n",search_word); - - return 0; -}
--- a/example/string_args/spe/Exec.h Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -#ifndef INCLUDED_TASK_HELLO -#define INCLUDED_TASK_HELLO - -#include "SchedTask.h" - - -#endif
--- a/example/string_args/spe/task_init.cc Wed Dec 04 17:12:58 2013 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#include "Func.h" -#include "Scheduler.h" - -/* 必ずこの位置に書いて */ -SchedExternTask(Exec); - -/** - * この関数は ../spe/spe-main と違って - * 自分で呼び出せばいい関数なので - * 好きな関数名でおk (SchedRegisterTask は必須) - */ - -void -task_init(void) -{ - SchedRegisterTask(TASK_EXEC, Exec); -}