annotate example/many_task/sort.cc @ 1519:9a5f87f4b60f draft

add spe_cpu for gpu
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 10 Nov 2012 18:21:16 +0900
parents e544f9747169
children 027d99ecb50e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
1 #include "TaskManager.h"
573
31d37456bbd4 example fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 567
diff changeset
2 #include "SchedTask.h"
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
3 #include "sort.h"
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
4 #include "Func.h"
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
5 #include <string.h>
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
6
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
7 extern int get_split_num(int len, int num);
940
e01b551f25d6 unknown dead lock still...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 939
diff changeset
8 extern int all; // allocate task at once
1519
9a5f87f4b60f add spe_cpu for gpu
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1516
diff changeset
9 extern CPU_TYPE spe_cpu ;
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
10
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
11 /**
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
12 * 一つの block にある data の数が MAX_BLOCK_SIZE 超えないような
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
13 * len の分割数を返す
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
14 *
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
15 * @param len sort する data の総数
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
16 * @param num 使用する SPE の数
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
17 *
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
18 * @return data の分割数
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
19 *
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
20 * TODO:
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
21 * len が num 以下とか考えてません
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
22 */
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
23 int
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
24 get_split_num(int len, int num)
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
25 {
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
26 if (len / num < MAX_BLOCK_SIZE) {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
27 return num;
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
28 } else {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
29 // 切り上げ
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
30 return (len + MAX_BLOCK_SIZE - 1) / MAX_BLOCK_SIZE;
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
31 }
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
32 }
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
33
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
34
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
35 /**
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
36 * btask が全て終了したら、再び sort_start を実行する
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
37 * @param d 生成された btask の数
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
38 */
935
11b19708e613 -a option for sort
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 934
diff changeset
39
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
40 SchedDefineTask1(SortSimple, sort_start );
935
11b19708e613 -a option for sort
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 934
diff changeset
41
11b19708e613 -a option for sort
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 934
diff changeset
42 static int
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
43 sort_start(SchedTask *manager, void *d, void *e)
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
44 {
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
45 Sort *s = (Sort*)manager->get_param(0);
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
46 int half_num = s->split_num-1;
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
47 static int sort_count = s->split_num; // sort 完了に必要な回数
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
48
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
49 // 一つのタスクで sort する data 数
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
50 int block_num = (s->data_length + s->split_num -1)/s->split_num;
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
51 int half_block_num = block_num/2;
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
52
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
53 int last_block_num = s->data_length - (s->split_num-1)*block_num;
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
54 int last_half_block_num = half_block_num+(last_block_num/2);
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
55
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
56 if (--sort_count < 0) {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
57 return 0;
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
58 }
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
59
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
60
1516
e544f9747169 fix gpu kernel source
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1515
diff changeset
61
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
62 for (int i = 0; i < s->split_num-1; i++) {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
63 s->fsort[i] = manager->create_task(QUICK_SORT,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
64 (memaddr)&s->data[i*block_num], sizeof(Data)*block_num,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
65 (memaddr)&s->data[i*block_num], sizeof(Data)*block_num);
1516
e544f9747169 fix gpu kernel source
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1515
diff changeset
66
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
67 s->fsort[i]->flip();
1516
e544f9747169 fix gpu kernel source
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1515
diff changeset
68
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
69 if (i>0 && s->bsort[i-1]) {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
70 s->fsort[i]->wait_for(s->bsort[i-1]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
71 }
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
72 if (i<s->split_num-2 && s->bsort[i]) {
1516
e544f9747169 fix gpu kernel source
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1515
diff changeset
73 s->fsort[i]->wait_for(s->bsort[i]);
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
74 }
1519
9a5f87f4b60f add spe_cpu for gpu
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1516
diff changeset
75 s->fsort[i]->set_cpu(spe_cpu);
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
76 s->fsort[i]->set_param(0,(memaddr)block_num);
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
77 }
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
78
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
79 // 最後の block は端数なので last_block_num を使う
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
80 {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
81 int i = s->split_num-1;
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
82
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
83 s->fsort[i] = manager->create_task(QUICK_SORT,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
84 (memaddr)&s->data[i*block_num], sizeof(Data)*last_block_num,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
85 (memaddr)&s->data[i*block_num], sizeof(Data)*last_block_num);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
86 s->fsort[i]->flip();
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
87 if (i>0 && s->bsort[i-1]) {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
88 s->fsort[i]->wait_for(s->bsort[i-1]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
89 }
1519
9a5f87f4b60f add spe_cpu for gpu
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1516
diff changeset
90 s->fsort[i]->set_cpu(spe_cpu);
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
91 s->fsort[i]->set_param(0,(memaddr)last_block_num);
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
92 }
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
93
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
94 if (s->split_num > 1) {
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
95
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
96 for (int i = 0; i < half_num-1; i++) {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
97 if (s->bsort[i]) manager->free_htask(s->bsort[i]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
98 s->bsort[i] = manager->create_task(QUICK_SORT,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
99 (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*block_num,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
100 (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*block_num);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
101 s->bsort[i]->flip();
1519
9a5f87f4b60f add spe_cpu for gpu
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1516
diff changeset
102 s->bsort[i]->set_cpu(spe_cpu);
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
103 s->bsort[i]->set_param(0,(memaddr)block_num);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
104 }
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
105
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
106 {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
107 int i = half_num-1;
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
108
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
109 if (s->bsort[i]) manager->free_htask(s->bsort[i]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
110 s->bsort[i] = manager->create_task(QUICK_SORT,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
111 (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*last_half_block_num,
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
112 (memaddr)&s->data[i*block_num+half_block_num], sizeof(Data)*last_half_block_num);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
113 s->bsort[i]->flip();
1519
9a5f87f4b60f add spe_cpu for gpu
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1516
diff changeset
114 s->bsort[i]->set_cpu(spe_cpu);
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
115 s->bsort[i]->set_param(0,(memaddr)last_half_block_num);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
116 }
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
117
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
118 for (int i = 0; i < half_num; i++) {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
119 s->bsort[i]->wait_for(s->fsort[i]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
120 s->bsort[i]->wait_for(s->fsort[i+1]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
121 s->bsort[i]->no_auto_free();
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
122 s->bsort[i]->spawn();
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
123 }
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
124 }
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
125
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
126 HTaskPtr restart = manager->create_task(SortSimple,0,0,0,0);
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
127 restart->set_param(0,(memaddr)s);
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
128 if (!all) restart->wait_for(s->fsort[0]);
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
129 for (int i = 0; i < s->split_num; i++) {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
130 s->fsort[i]->spawn();
932
53ad3a61b40b sort test (add swap())
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
131 }
954
774eba654643 auto_free
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
132 if (sort_count == 1) {
1515
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
133 // last loop wait for all task
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
134 // we should not need this?
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
135 for (int i = 0; i < half_num; i++) {
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
136 restart->wait_for(s->bsort[i]);
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
137 s->bsort[i]->auto_free();
b3644b73d2cf add flip flag test
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
138 }
954
774eba654643 auto_free
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 945
diff changeset
139 }
935
11b19708e613 -a option for sort
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 934
diff changeset
140 restart->spawn();
1516
e544f9747169 fix gpu kernel source
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents: 1515
diff changeset
141
945
9ed1c4a877ca sort example fix ( simple task accepts one param and more compatible with old task)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 941
diff changeset
142 return 0;
934
83b64b7a51bd sort fix ( not working now )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 932
diff changeset
143 }
227
e7faaf516be1 add sort
gongo@localhost.localdomain
parents:
diff changeset
144
935
11b19708e613 -a option for sort
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 934
diff changeset
145
651
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
146 /* end */