view TaskManager/test/UtilizationTest/ppe/Multi.cc @ 1697:ef1099c41449 draft

UtilizationTest
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Fri, 04 Oct 2013 16:41:23 +0900
parents
children 7673e2ad2623
line wrap: on
line source

#include <stdio.h>
#include "SchedTask.h"
#include "Multi.h"
#include "Func.h"
#include "GpuScheduler.h"

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

static int
run(SchedTask *s,void *rbuf, void *wbuf)
{
    float *A,*B,*C;

    A = (float*)s->get_input(rbuf, 0);
    B = (float*)s->get_input(rbuf, 1);
    C = (float*)s->get_output(wbuf, 0);

    //    long i = s->x;
    for(int i=0; i<DATA_NUM; i++) {
        C[i]=A[i]*B[i];
    }
    return 0;
}