annotate TaskManager/kernel/ppe/HTask.h @ 1546:61164c687b29 draft

fix GpuScheduler flip
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 05 Feb 2013 13:15:46 +0900
parents a7895ab4d0e3
children 614a3f62c881
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
307
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
4 #include "base.h"
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
5 #include "types.h"
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
6 #include "Task.h"
1462
8cf62aea798f HTask/TaskList fix (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1425
diff changeset
7 #include "TaskList.h"
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
8 #include "TaskQueue.h"
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
9 #include "QueueInfo.h"
1423
515a0f15b5d2 add to log taskdependency
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1412
diff changeset
10 #include "TaskLog.h"
1142
801d57ae1e29 cut compile CreatePolygonTask on spe side because not enough spe memory. We have to use code loading.
yutaka@localhost.localdomain
parents: 1110
diff changeset
11 //#include <stdio.h>
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 class TaskManagerImpl;
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
14 class SchedTask;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
15
547
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
16 typedef void (*PostFunction)(SchedTask *s, void *read, void *write);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17
956
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
18 extern QueueInfo<TaskQueue>* taskQueuePool;
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
19
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
20 /*!
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
21 @class
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
22
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
23 @brief
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
24
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
25 Cerium の Task で、spawn() でキューに格納されて順次実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
26 cpu の指定があれば並列に実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
27 特定の Task を待ち合わせる事が可能。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
28 Task の入出力は dma などで copy される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
29 */
688
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
30
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
31 #include "SimpleTask.h"
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
32
641
0605f27ba7d9 Regression on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
33 class HTask : public SimpleTask {
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 public:
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 BASE_NEW_DELETE(HTask);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
37 QueueInfo<TaskQueue> *wait_me; // List of task waiting for me
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
38 QueueInfo<TaskQueue> *wait_i; // List of task for which I am waiting
546
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
39 PostFunction post_func;
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
40 void *post_arg1;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
41 void *post_arg2;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 CPU_TYPE cpu_type;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 TaskManagerImpl *mimpl;
1466
cb57420a8219 TaskList on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1462
diff changeset
44 TaskPtr last;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45
1479
163220e54cc0 remove hard code for TaskLog
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1474
diff changeset
46 int export_task_log;
1423
515a0f15b5d2 add to log taskdependency
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1412
diff changeset
47 TaskLog *tasklog;
515a0f15b5d2 add to log taskdependency
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents: 1412
diff changeset
48
498
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
49 HTask *waiter;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
50 HTask *next;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
51 HTask *prev;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
52
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
53 struct htask_flag {
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
54 unsigned no_auto_free:1; // bit 0 auto free flag (0 .. auto, 1 manual)
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
55 unsigned flip:1; // use read write buffers for all
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
56 unsigned nd_range:1; // openCL nd_range
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
57 } flag;
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
58
689
ecf63089f5bb Task Array generation worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 688
diff changeset
59 void spawn();
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
60 void wait_for(HTask *);
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
61 void set_cpu(CPU_TYPE type);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
62 void set_post(PostFunction func, void *read, void *write);
700
ef08dd70eafb fix fix ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 689
diff changeset
63 Task *create_task_array(int task_id, int num_task, int num_param, int num_inData, int num_outData);
ef08dd70eafb fix fix ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 689
diff changeset
64 Task *next_task_array(int task_id, Task *t);
1425
8bd889db45a1 add API
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1423
diff changeset
65 Task *next_task_array(int id, Task *t, int param_count, int inData_count, int outData_count);
700
ef08dd70eafb fix fix ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 689
diff changeset
66 void spawn_task_array(Task *t);
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
67
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
68 HTask *init(int cmd, memaddr rbuf, int rs, memaddr wbuf, int ws) {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
69 init(cmd);
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
70 set_input(rbuf, rs);
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
71 set_output(wbuf, ws);
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
72 return this;
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
73 }
714
878ed6e80286 HTask fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
74
956
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
75 void initOnce() {
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
76 wait_me = new QueueInfo<TaskQueue>(taskQueuePool);
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
77 wait_i = new QueueInfo<TaskQueue>(taskQueuePool);
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
78 }
197b7e19a345 unified queue worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
79
958
338523ff6986 add freeOnce()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 956
diff changeset
80 void freeOnce() {
338523ff6986 add freeOnce()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 956
diff changeset
81 delete wait_me;
338523ff6986 add freeOnce()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 956
diff changeset
82 delete wait_i;
338523ff6986 add freeOnce()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 956
diff changeset
83 }
338523ff6986 add freeOnce()
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 956
diff changeset
84
713
97adb3fe85c6 remove SIMPLE_TASK conditional
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 703
diff changeset
85 private:
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
86
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
87 // compatibility
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
88 public: // functions
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
89 void set_inData_t(int index, memaddr addr, int size) {
949
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
90 #ifdef EARLY_TOUCH
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
91 if ((unsigned long)addr&0xf) {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
92 printf("inData is not aligned. command = %d, index = %d, addr = 0x%lx, size = %d\n",
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
93 command, index, (unsigned long)addr, size);
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
94 }
949
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
95 char *p = (char *)addr; char b = *p;
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
96 p = (char *)(addr+size-1); b += *p;
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
97 #endif
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
98 Task *t = ((TaskList*)rbuf)->tasks;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
99 t->set_inData_t(index, addr,size);
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
100 }
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
101 void set_outData_t(int index, memaddr addr, int size) {
949
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
102 #ifdef EARLY_TOUCH
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
103 if ((unsigned long)addr&0xf) {
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
104 printf("inData is not aligned. command = %d, index = %d, addr = 0x%lx, size = %d\n",
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
105 command, index, (unsigned long)addr, size);
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
106 }
949
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
107 char *p = (char *)addr; char b = *p;
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
108 p = (char *)(addr+size-1); b += *p;
5f0135ca75ee word count size fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
109 #endif
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
110 Task *t = ((TaskList*)rbuf)->tasks;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
111 t->set_outData_t(index, addr,size);
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
112 }
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
113 void set_param_t(int index, memaddr param) {
1474
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
114 Task *t = ((TaskList*)rbuf)->tasks;
b158873485f6 fix simple task
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1466
diff changeset
115 t->set_param_t(index, param);
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
116 }
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
117
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
118 void no_auto_free() {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
119 flag.no_auto_free = 1;
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
120 }
954
774eba654643 auto_free
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
121 void auto_free() {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
122 flag.no_auto_free = 0;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
123 }
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
124
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
125 void flip() {
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
126 flag.flip = 1;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
127 }
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
128 void no_flip() {
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
129 flag.flip = 0;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
130 }
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
131
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
132 htask_flag get_flag(){
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
133 return flag;
954
774eba654643 auto_free
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
134 }
941
fc6cfaae6de7 add no_auto_free flag on HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 895
diff changeset
135
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
136 void init() {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
137 next = prev = NULL;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
138 waiter = NULL;
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
139 }
714
878ed6e80286 HTask fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
140
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
141 void init(int cmd) {
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
142 command = cmd;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
143 flag.no_auto_free = 0;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
144 flag.flip = 0;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
145 flag.nd_range = 0;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
146 self = (memaddr) this;
714
878ed6e80286 HTask fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
147
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
148 post_func = NULL;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
149 mimpl = NULL;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
150 cpu_type = CPU_PPE;
1089
c0dc96c6f209 htask->init fix.
tkaito
parents: 958
diff changeset
151
1506
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
152 post_arg1 = NULL;
a7895ab4d0e3 add flip flag and NDRange flag
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1479
diff changeset
153 post_arg2 = NULL;
714
878ed6e80286 HTask fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
154 }
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
155 #define set_param(index,param) set_param_t(index, (memaddr) (param))
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 700
diff changeset
156
895
b662e9dd26b0 add alignment of classes in SPU
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 788
diff changeset
157 } __attribute__ ((aligned (DEFAULT_ALIGNMENT)));
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
158
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
159 typedef HTask* HTaskPtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
160
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
161 #endif