Mercurial > hg > Game > Cerium
view example/word_count/ppe/Print.cc @ 638:250c7353ddaf draft
hmmmm
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:18:20 +0900 |
parents | 94d82f2c842f |
children | f02b3338b91b |
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); long task_num = (long)s->get_param(0); long status_num = (long)s->get_param(1); unsigned long long word_data[task_num]; s->printf("start sum\n"); 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; }