annotate TaskManager/test/UtilizationTest/ppe/Multi.cc @ 1737:6bd9a57eb44d draft

minor fix
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Sat, 02 Nov 2013 17:34:40 +0900
parents 7673e2ad2623
children 537707f376c8
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
1698
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
10 long current_task_id = -1;
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
11
1697
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 static int
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 run(SchedTask *s,void *rbuf, void *wbuf)
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 float *A,*B,*C;
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 A = (float*)s->get_input(rbuf, 0);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 B = (float*)s->get_input(rbuf, 1);
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 C = (float*)s->get_output(wbuf, 0);
1698
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
20
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
21 long task_id = (long)s->get_param(0);
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
22 current_task_id = task_id;
1737
6bd9a57eb44d minor fix
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1698
diff changeset
23 long i = s->x;
6bd9a57eb44d minor fix
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1698
diff changeset
24 // for(int i=0; i<DATA_NUM; i++) {
6bd9a57eb44d minor fix
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1698
diff changeset
25 C[i]=A[i]*B[i];
6bd9a57eb44d minor fix
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 1698
diff changeset
26 // }
1698
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
27 if(current_task_id != task_id)
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
28 fprintf(stderr,"duplicate task %ld %ld\n",current_task_id,task_id);
7673e2ad2623 fix profile
kkb
parents: 1697
diff changeset
29
1697
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 return 0;
ef1099c41449 UtilizationTest
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 }