Mercurial > hg > Members > e085722 > Cerium
comparison example/test/spe/Print.cc @ 0:04e28d8d3c6f
first commit
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 01:23:25 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:04e28d8d3c6f |
---|---|
1 #include <stdio.h> | |
2 #include <string.h> | |
3 #include "Print.h" | |
4 #include "Func.h" | |
5 #include "WordGrep.h" | |
6 | |
7 /* これは必須 */ | |
8 SchedDefineTask1(Print,run_print); | |
9 | |
10 //終了後のプリント | |
11 static int run_print(SchedTask *s, void *rbuf, void *wbuf){ | |
12 WordGrep *w = *(WordGrep**)rbuf; | |
13 int out_task_num = w->out_task_num; | |
14 int *hits = w->o_data; | |
15 int total = 0; | |
16 | |
17 for (int i = 0; i < out_task_num ; i++) { | |
18 total += hits[i*w->out_size+0]; | |
19 } | |
20 printf("%d hits!!\n",total); | |
21 //何もしてない | |
22 return 0; | |
23 } |