Mercurial > hg > Game > Cerium
changeset 1677:3a57dd6e4cb5 draft
minor fix word count
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 03 Aug 2013 21:17:38 +0900 |
parents | 342c36d5582e |
children | 9ceb824e9be1 |
files | example/word_count/gpu/Exec.cl example/word_count/main.cc example/word_count/ppe/Exec.cc example/word_count/spe/Exec.cc example/word_count/task_init.cc |
diffstat | 5 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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 !!! }
--- 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;
--- 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;
--- 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