Mercurial > hg > Game > Cerium
view example/regex_mas/ppe/Print.cc @ 1645:4698c92bf2ca draft
Regex_mas implement time measurement.
author | Masa <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 Jun 2013 17:28:28 +0900 |
parents | b9f46cc511d3 |
children | 0dcdaa4dfecb |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include "Print.h" #include "Func.h" #include "WordCount.h" /* これは必須 */ SchedDefineTask1(Print,run_print); static int run_print(SchedTask *s, void *rbuf, void *wbuf) { WordCount *w = *(WordCount**)rbuf; unsigned long long *idata = w->o_data; unsigned int idata_task_num = w->out_size * w->out_task_num; int match_count = 0; s->printf("task num : %d\n",w->task_spwaned); s->printf("position\n"); for (int i = 0;i < idata_task_num/2;i++) { if(idata[2*i] != 0x00){ //s->printf("%d ",(int)idata[2*i+1]); //s->printf("%c\n",(unsigned char)idata[2*i]); match_count++; } } s->printf("HIT:%d\n",match_count); return 0; }