view TaskManager/test/UtilizationTest/ppe/Multi.cc @ 1698:7673e2ad2623 draft

fix profile
author kkb
date Fri, 04 Oct 2013 19:44:09 +0900
parents ef1099c41449
children 6bd9a57eb44d
line wrap: on
line source

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

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

long current_task_id = -1;

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 task_id = (long)s->get_param(0);
    current_task_id = task_id;
    //    long i = s->x;
    for(int i=0; i<DATA_NUM; i++) {
        C[i]=A[i]*B[i];
    }
    if(current_task_id != task_id)
        fprintf(stderr,"duplicate task %ld %ld\n",current_task_id,task_id);

    return 0;
}