@@ -3800,21 +3800,26 @@ namespace ttg_parsec {
38003800 while (flowidx < MAX_PARAM_COUNT &&
38013801 gpu_task->flow [flowidx] != nullptr ) {
38023802 if (gpu_task->flow [flowidx]->flow_flags == PARSEC_FLOW_ACCESS_NONE ) {
3803- empty_flowidx = flowidx;
3803+ if (empty_flowidx == -1 ) {
3804+ empty_flowidx = flowidx;
3805+ }
3806+ flowidx++;
3807+ continue ;
38043808 }
38053809 if (detail::parsec_ttg_caller->parsec_task .data [flowidx].data_in ->original == data) {
38063810 /* found the right data, set the corresponding flow as pushout */
38073811 break ;
38083812 }
38093813 ++flowidx;
38103814 }
3811- if (flowidx == MAX_PARAM_COUNT && empty_flowidx == -1 ) {
3812- throw std::runtime_error (" Cannot add more than MAX_PARAM_COUNT flows to a task!" );
3813- } else if (empty_flowidx != -1 ) {
3814- /* we found an empty flow, use it */
3815- empty_flowidx = flowidx;
3815+ if (flowidx == MAX_PARAM_COUNT ) {
3816+ if (empty_flowidx == -1 ) {
3817+ throw std::runtime_error (" Cannot add more than MAX_PARAM_COUNT flows to a task!" );
3818+ } else {
3819+ /* we found an empty flow, use it */
3820+ flowidx = empty_flowidx;
3821+ }
38163822 }
3817- flowidx = (empty_flowidx != -1 ) ? empty_flowidx : flowidx;
38183823 if (gpu_task->flow [flowidx]->flow_flags == PARSEC_FLOW_ACCESS_NONE ) {
38193824 /* no flow found, add one and mark it pushout */
38203825 detail::parsec_ttg_caller->parsec_task .data [flowidx].data_in = data->device_copies [0 ];
0 commit comments