annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1697
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdio.h>
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "SchedTask.h"
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "Multi.h"
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "Func.h"
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include "GpuScheduler.h"
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 /* これは必須 */
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 SchedDefineTask(Multiply);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 static int
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 run(SchedTask *s,void *rbuf, void *wbuf)
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 {
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 float *A,*B,*C;
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 A = (float*)s->get_input(rbuf, 0);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 B = (float*)s->get_input(rbuf, 1);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 C = (float*)s->get_output(wbuf, 0);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 // long i = s->x;
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 for(int i=0; i<DATA_NUM; i++) {
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 C[i]=A[i]*B[i];
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 }
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 return 0;
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 }