view example/share_task/ppe/Exec.cc @ 436:7fa3c6fff296 draft

merge
author game@henri.cr.ie.u-ryukyu.ac.jp
date Thu, 24 Sep 2009 22:36:13 +0900
parents 768452fab95e
children 839e34d0cc3c
line wrap: on
line source

#include <stdio.h>
#include "Exec.h"
#include "Func.h"

/* これは必須 */
SchedDefineTask(Exec);

int
Exec::run(void *rbuf, void *wbuf)
{
    int *idata = (int*)global_get(DATA_ID);
    int length = get_param(0);
    int number = get_param(1);
    int calnum = get_param(2);

    printf("[TASK_EXEC %02d] ", number);
    for (int i = 0; i < length; i++) {
	idata[i] += calnum;
	printf("%03d ", idata[i]);
    }
    printf("\n");

    return 0;
}