Mercurial > hg > Members > kono > Cerium
view example/word_count/spe/Print.cc @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | ab866bc8a624 |
children | a8b6ee80c108 |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include "Print.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Print); static int run(SchedTask *s, void *rbuf, void *wbuf) { unsigned long long *idata = (unsigned long long*)s->get_input(rbuf, 0); int task_num = (long)s->get_param(0); int status_num = (long)s->get_param(1); unsigned long long word_data[task_num]; for (int i = 0; i < status_num; i++) { word_data[i] = 0; } for (int i = 0; i < task_num*status_num; i += status_num) { for (int j = 0; j < status_num; j++) { word_data[j] += idata[i+j]; } } for (int i = 0; i < status_num; i++) { s->printf("%llu ",word_data[i]); } s->printf("\n"); return 0; }