# HG changeset patch # User Shinji KONO # Date 1375532258 -32400 # Node ID 3a57dd6e4cb5d6ca17b9a59cc7e9796742c856c4 # Parent 342c36d5582eff520f13b80374a590916ee7352f minor fix word count diff -r 342c36d5582e -r 3a57dd6e4cb5 example/word_count/gpu/Exec.cl --- a/example/word_count/gpu/Exec.cl Tue Jul 23 17:02:07 2013 +0900 +++ b/example/word_count/gpu/Exec.cl Sat Aug 03 21:17:38 2013 +0900 @@ -1,5 +1,5 @@ __kernel void -run(__global int *data_count, +wordcount(__global int *data_count, __global void *rbuf, __global void *wbuf) { diff -r 342c36d5582e -r 3a57dd6e4cb5 example/word_count/main.cc --- a/example/word_count/main.cc Tue Jul 23 17:02:07 2013 +0900 +++ b/example/word_count/main.cc Sat Aug 03 21:17:38 2013 +0900 @@ -216,12 +216,12 @@ for (int j = 0; j < task_num; j++) { HTask *h_exec = 0; - int i = w->task_spwaned++; + int a = w->task_spwaned++; if (w->size < size) size = w->size; h_exec = manager->create_task(TASK_EXEC, - (memaddr)(w->file_mmap + i*w->division_size), size, + (memaddr)(w->file_mmap + a*w->division_size), size, (memaddr)(w->o_data + i*w->out_size), w->division_out_size); if (all) { @@ -280,6 +280,7 @@ task_array[k]->set_cpu(spe_cpu); task_array[k]->spawn(); } + // free task_array and t_exec !!! } diff -r 342c36d5582e -r 3a57dd6e4cb5 example/word_count/ppe/Exec.cc --- a/example/word_count/ppe/Exec.cc Tue Jul 23 17:02:07 2013 +0900 +++ b/example/word_count/ppe/Exec.cc Sat Aug 03 21:17:38 2013 +0900 @@ -4,10 +4,10 @@ #include "Func.h" /* これは必須 */ -SchedDefineTask(Exec); +SchedDefineTask1(Exec,wordcount); static int -run(SchedTask *s, void *rbuf, void *wbuf) +wordcount(SchedTask *s, void *rbuf, void *wbuf) { char *i_data = (char *)rbuf; unsigned long long *o_data = (unsigned long long*)wbuf; diff -r 342c36d5582e -r 3a57dd6e4cb5 example/word_count/spe/Exec.cc --- a/example/word_count/spe/Exec.cc Tue Jul 23 17:02:07 2013 +0900 +++ b/example/word_count/spe/Exec.cc Sat Aug 03 21:17:38 2013 +0900 @@ -4,10 +4,10 @@ #include "Func.h" /* これは必須 */ -SchedDefineTask(Exec); +SchedDefineTask1(Exec,wordcount); static int -run(SchedTask *s, void *rbuf, void *wbuf) +wordcount(SchedTask *s, void *rbuf, void *wbuf) { char *i_data = (char *)rbuf; unsigned long long *o_data = (unsigned long long*)wbuf; diff -r 342c36d5582e -r 3a57dd6e4cb5 example/word_count/task_init.cc --- a/example/word_count/task_init.cc Tue Jul 23 17:02:07 2013 +0900 +++ b/example/word_count/task_init.cc Sat Aug 03 21:17:38 2013 +0900 @@ -18,7 +18,7 @@ task_init(void) { #ifdef __CERIUM_GPU__ - GpuSchedRegister(TASK_EXEC, "gpu/Exec.cl", "run"); + GpuSchedRegister(TASK_EXEC, "gpu/Exec.cl", "wordcount"); #else SchedRegisterTask(TASK_EXEC, Exec); #endif