comparison example/many_task/sort.cc @ 1561:e8c9a7099bcc draft

add set NDRange param
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 12 Mar 2013 16:52:49 +0900
parents 096412ad80fb
children 8bf0a27f5dff
comparison
equal deleted inserted replaced
1556:f71632373220 1561:e8c9a7099bcc
201 for (int i = 0; i < half_num; i++) { 201 for (int i = 0; i < half_num; i++) {
202 s->bsort[i]->wait_for(s->fsort[i]); 202 s->bsort[i]->wait_for(s->fsort[i]);
203 s->bsort[i]->wait_for(s->fsort[i+1]); 203 s->bsort[i]->wait_for(s->fsort[i+1]);
204 s->bsort[i]->no_auto_free(); 204 s->bsort[i]->no_auto_free();
205 s->bsort[i]->spawn(); 205 s->bsort[i]->spawn();
206 printf("task list spawn \n");
207 } 206 }
208 } 207 }
209 208
210 HTaskPtr restart = manager->create_task(SortSimple,0,0,0,0); 209 HTaskPtr restart = manager->create_task(SortSimple,0,0,0,0);
211 restart->set_param(0,(memaddr)s); 210 restart->set_param(0,(memaddr)s);
212 if (!all) restart->wait_for(s->fsort[0]); 211 if (!all) restart->wait_for(s->fsort[0]);
213 for (int i = 0; i < s->split_num; i++) { 212 for (int i = 0; i < s->split_num; i++) {
214 s->fsort[i]->spawn(); 213 s->fsort[i]->spawn();
215 printf("task list spawn\n");
216 } 214 }
217 if (sort_count == 1) { 215 if (sort_count == 1) {
218 // last loop wait for all task 216 // last loop wait for all task
219 // we should not need this? 217 // we should not need this?
220 for (int i = 0; i < half_num; i++) { 218 for (int i = 0; i < half_num; i++) {