view example/share_task/ppe/Exec.cc @ 1678:9ceb824e9be1 draft

fix TaskArray last().
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 04 Aug 2013 01:58:09 +0900 (2013-08-03)
parents 94d82f2c842f
children
line wrap: on
line source
#include <stdio.h>
#include "Exec.h"
#include "Func.h"

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

static int
run(SchedTask *s, void *rbuf, void *wbuf)
{
    int *idata = (int*)s->global_get(DATA_ID);
    long length = (long)s->get_param(0);
    long number = (long)s->get_param(1);
    long calnum = (long)s->get_param(2);

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

    return 0;
}