Mercurial > hg > Game > Cerium
changeset 2065:53643db3f0f9 draft
bm_search implemented
author | masa |
---|---|
date | Wed, 17 Feb 2016 17:49:13 +0900 |
parents | f786ffb2a198 |
children | cf10def20fb7 0e2389a5ac4e |
files | example/bm_search/main.cc example/bm_search/ppe/Read.cc example/bm_search/ppe/Read.h |
diffstat | 3 files changed, 2 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/example/bm_search/main.cc Wed Feb 17 17:37:06 2016 +0900 +++ b/example/bm_search/main.cc Wed Feb 17 17:49:13 2016 +0900 @@ -28,6 +28,7 @@ static void create_BMskiptable(BMPtr bm) { + bm->skip_table = (int*)malloc(sizeof(int)*256); for (int i = 0; i < 256; ++i) { bm->skip_table[i] = bm->search_word_len; } @@ -66,6 +67,7 @@ return -1; } fmp->w->global = (void*)bmp; + fmp->overrap = bmp->search_word_len - 1; fmp->division_out_size = sizeof(unsigned long long); task_init(); st_time = getTime();
--- a/example/bm_search/ppe/Read.cc Wed Feb 17 17:37:06 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/stat.h> -#include <iostream> -#include <vector> -#include <cstdlib> - -#include "SchedTask.h" -#include "Print.h" -#include "Func.h" -#include "WordCount.h" - -/* これは必須 */ -SchedDefineTask1(READ_TASK,read_task); - -static int -read_task(SchedTask *s, void *rbuf, void *wbuf) -{ - long fd = (long)s->get_param(0); - long start_read_position = (long)s->get_param(1); - long end_read_position = (long)s->get_param(2); - char *read_text = (char*)s->get_output(wbuf,0); - - long read_size = end_read_position - start_read_position; - - //char *read_text = (char*)s->get_output(wbuf,0); - //s->printf("[read No %d : wbuf addr 0x%llx]\n",task_number,read_text); - - pread(fd, read_text, read_size , start_read_position); - - //s->printf("[start read task No. %d]\n",task_number); - //s->printf("%s\n",read_text); - //s->printf("in divide_read\n"); - return 0; -}