Mercurial > hg > Game > Cerium
view example/mainMem/ppe/Hello.cc @ 1621:f907bbac14f2 draft
Implement Boyer-Moore String Search Algorithm.(But incomplete divided file point)
author | Masa <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 21 May 2013 17:03:53 +0900 |
parents | d17459601f28 |
children |
line wrap: on
line source
#include <stdio.h> #include "Hello.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Hello); #define PP_STORE 3 #define SIZE (4096*sizeof(int)) static int run(SchedTask *smanager, void *rbuf, void *wbuf) { long task_id = (long)smanager->get_param(0); int *ptr = 0; #if 1 ptr = (int*)smanager->allocate(SIZE); smanager->mainMem_alloc(0, SIZE); int i; for(i=0;i<4096;i++) { ptr[i] = i; } #endif void *next = 0; #if 1 smanager->mainMem_wait(); next = (void *)smanager->mainMem_get(0); smanager->dma_wait(PP_STORE); smanager->dma_store(ptr, (memaddr)next, SIZE, PP_STORE); #endif //smanager->fprintf(smanager->stderr_,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); //smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); smanager->printf("sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); smanager->printf("[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); return 0; }