comparison example/word_count/main.cc @ 1727:e99dc86d39e2 draft

minor fix
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Wed, 30 Oct 2013 19:05:38 +0900
parents 1755ae347fce
children 6bd9a57eb44d
comparison
equal deleted inserted replaced
1726:9e4d2827d804 1727:e99dc86d39e2
117 if (w->size < size) size = w->size; 117 if (w->size < size) size = w->size;
118 int length = size/sizeof(char); 118 int length = size/sizeof(char);
119 if (size==0) break; 119 if (size==0) break;
120 if (use_task_array) { 120 if (use_task_array) {
121 t_exec = task_array->next_task_array(TASK_EXEC,t_exec); 121 t_exec = task_array->next_task_array(TASK_EXEC,t_exec);
122 t_exec->set_param(0,(memaddr)length); 122 t_exec->set_param(0,&length);
123 t_exec->set_inData(0,w->file_mmap + i*w->division_size, size); 123 t_exec->set_inData(0,w->file_mmap + i*w->division_size, size);
124 t_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size); 124 t_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size);
125 } else if (use_compat) { 125 } else if (use_compat) {
126 h_exec = manager->create_task(TASK_EXEC); 126 h_exec = manager->create_task(TASK_EXEC);
127 h_exec->set_inData(0,w->file_mmap + i*w->division_size, size); 127 h_exec->set_inData(0,w->file_mmap + i*w->division_size, size);
133 h_exec->spawn(); 133 h_exec->spawn();
134 } else { 134 } else {
135 h_exec = manager->create_task(TASK_EXEC, 135 h_exec = manager->create_task(TASK_EXEC,
136 (memaddr)(w->file_mmap + i*w->division_size), size, 136 (memaddr)(w->file_mmap + i*w->division_size), size,
137 (memaddr)(w->o_data + i*w->out_size), w->division_out_size); 137 (memaddr)(w->o_data + i*w->out_size), w->division_out_size);
138 h_exec->set_param(0,(memaddr)length); 138 h_exec->set_param(0,&length);
139 t_next->wait_for(h_exec); 139 t_next->wait_for(h_exec);
140 h_exec->set_cpu(SPE_ANY); 140 h_exec->set_cpu(SPE_ANY);
141 h_exec->spawn(); 141 h_exec->spawn();
142 } 142 }
143 w->size -= size; 143 w->size -= size;