Mercurial > hg > Game > Cerium
comparison example/word_count/main.cc @ 1894:b37dfbf3380d draft
fix GpuTaskManagerFactory
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 12 Jan 2014 10:28:52 +0900 |
parents | 44fa0f1320a9 |
children | 606f6f6cb784 |
comparison
equal
deleted
inserted
replaced
1893:b72db78232bc | 1894:b37dfbf3380d |
---|---|
132 h_exec->spawn(); | 132 h_exec->spawn(); |
133 } else if (use_iterate) { | 133 } else if (use_iterate) { |
134 w->size -= size*array_task_num; | 134 w->size -= size*array_task_num; |
135 if(w->size < 0) array_task_num -= 1; | 135 if(w->size < 0) array_task_num -= 1; |
136 h_exec = manager->create_task(TASK_EXEC_DATA_PARALLEL); | 136 h_exec = manager->create_task(TASK_EXEC_DATA_PARALLEL); |
137 h_exec->flip(); | 137 // h_exec->flip(); |
138 h_exec->set_inData(0,w->file_mmap,w->file_size); | 138 h_exec->set_inData(0,w->file_mmap,w->file_size); |
139 h_exec->set_inData(1,w->o_data,w->out_size_); | 139 // h_exec->set_inData(1,w->o_data,w->out_size_); |
140 h_exec->set_outData(0,w->file_mmap,w->file_size); | 140 // h_exec->set_outData(0,w->file_mmap,w->file_size); |
141 h_exec->set_outData(1,w->o_data,w->out_size_); | 141 h_exec->set_outData(0,w->o_data,w->out_size_); |
142 h_exec->set_param(0,(long)i); | 142 h_exec->set_param(0,(long)i); |
143 h_exec->set_param(1,(long)w->division_size); | 143 h_exec->set_param(1,(long)w->division_size); |
144 h_exec->set_param(2,(long)size); | 144 h_exec->set_param(2,(long)size); |
145 h_exec->set_param(3,(long)w->out_size); | 145 h_exec->set_param(3,(long)w->out_size); |
146 | 146 |
151 w->task_num -= array_task_num; | 151 w->task_num -= array_task_num; |
152 w->task_spwaned += array_task_num-1; | 152 w->task_spwaned += array_task_num-1; |
153 | 153 |
154 if(w->size < 0) { | 154 if(w->size < 0) { |
155 h_exec = manager->create_task(TASK_EXEC_DATA_PARALLEL); | 155 h_exec = manager->create_task(TASK_EXEC_DATA_PARALLEL); |
156 h_exec->flip(); | 156 // h_exec->flip(); |
157 h_exec->set_inData(0,w->file_mmap,w->file_size); | 157 h_exec->set_inData(0,w->file_mmap,w->file_size); |
158 h_exec->set_inData(1,w->o_data,w->out_size_); | 158 // h_exec->set_inData(1,w->o_data,w->out_size_); |
159 h_exec->set_outData(0,w->file_mmap,w->file_size); | 159 // h_exec->set_outData(0,w->file_mmap,w->file_size); |
160 h_exec->set_outData(1,w->o_data,w->out_size_); | 160 h_exec->set_outData(0,w->o_data,w->out_size_); |
161 h_exec->set_param(0,(long)w->task_spwaned); | 161 h_exec->set_param(0,(long)w->task_spwaned); |
162 h_exec->set_param(1,(long)w->division_size); | 162 h_exec->set_param(1,(long)w->division_size); |
163 h_exec->set_param(2,(long)(size+w->size)); | 163 h_exec->set_param(2,(long)(size+w->size)); |
164 h_exec->set_param(3,(long)w->out_size); | 164 h_exec->set_param(3,(long)w->out_size); |
165 | 165 |
332 use_task_array = 0; | 332 use_task_array = 0; |
333 use_compat = 0; | 333 use_compat = 0; |
334 } else if (strcmp(argv[i], "-anum") == 0) { | 334 } else if (strcmp(argv[i], "-anum") == 0) { |
335 array_task_num = atoi(argv[i+1]); | 335 array_task_num = atoi(argv[i+1]); |
336 i++; | 336 i++; |
337 } else if (strcmp(argv[i], "-g") == 0 ) { | 337 } else if (strcmp(argv[i], "-g") == 0) { |
338 spe_cpu = GPU_ANY; | 338 spe_cpu = GPU_ANY; |
339 } else if (strcmp(argv[i], "-any") == 0) { | |
340 spe_cpu = ANY_ANY; | |
339 } else if (strcmp(argv[i], "-i") == 0) { | 341 } else if (strcmp(argv[i], "-i") == 0) { |
340 use_iterate = 1; | 342 use_iterate = 1; |
341 use_task_array = 0; | 343 use_task_array = 0; |
342 }/* else if (strcmp(argv[i], "-cpu") == 0) { | 344 }/* else if (strcmp(argv[i], "-cpu") == 0) { |
343 spe_num = atoi(argv[i+1]); | 345 spe_num = atoi(argv[i+1]); |