view example/share_task/spe/Load.cc @ 1095:652791a4a324 draft

remove spe function
author yutaka@localhost.localdomain
date Sat, 25 Dec 2010 18:30:17 +0900
parents 0e91ddaad798
children
line wrap: on
line source

#include <stdio.h>
#include <string.h>
#include "Load.h"
#include "Func.h"

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

static int
run(SchedTask *s, void *rbuf, void *wbuf)
{
    int *idata = (int*)s->get_input(rbuf, 0);
    int *odata;
    int length = (long)s->get_param(0);

    // SPU LS 内に領域確保し、データをコピー
    odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length);
    memcpy(odata, idata, sizeof(int)*length);

    s->printf("[TASK_LOAD]    ");
    for (int i = 0; i < length; i++) {
	s->printf("%03d ", odata[i]);
    }
    s->printf("\n");

    return 0;
}