| 488 | } |
| 489 | |
| 490 | void |
| 491 | raft::map::inline_split( split_stack_t &split_stack, |
| 492 | kernels_t &groups, |
| 493 | kernels_t &temp_groups, |
| 494 | kpair * const next ) |
| 495 | { |
| 496 | split_stack.push( next->src_out_count ); |
| 497 | /** |
| 498 | * for each kernel, create a destination |
| 499 | * for each of it's output ports, link it |
| 500 | */ |
| 501 | for( auto &group : groups ) |
| 502 | { |
| 503 | /** each group will have the same # of out-edges, save **/ |
| 504 | for( auto *kernel : *group ) |
| 505 | { |
| 506 | //TODO: throw an exception for |
| 507 | //only one port, user meant |
| 508 | //to use raft::out likely not |
| 509 | //the static split |
| 510 | |
| 511 | //TODO: throw exception for more |
| 512 | //than one input port for destination |
| 513 | //won't work with split/join |
| 514 | temp_groups.push_back( up_group_t( new group_t() ) ); |
| 515 | //for each output port in kernel |
| 516 | if( temp_groups[ 0 ]->size() == 0 ) |
| 517 | { |
| 518 | auto &port( kernel->output ); |
| 519 | for( auto it( port.begin() ); |
| 520 | it != port.end(); ++it ) |
| 521 | { |
| 522 | next->src = kernel; |
| 523 | //next->dst already eq dst |
| 524 | next->src_name = it.name(); |
| 525 | next->has_src_name = true; |
| 526 | if( it == port.begin() ) |
| 527 | { |
| 528 | temp_groups.back()->emplace_back( next->dst ); |
| 529 | } |
| 530 | else |
| 531 | { |
| 532 | auto * const dst_clone( next->dst->clone() ); |
| 533 | next->dst = dst_clone; |
| 534 | //dst name should be same as first |
| 535 | temp_groups.back()->emplace_back( dst_clone ); |
| 536 | } |
| 537 | joink( next ); |
| 538 | } |
| 539 | } |
| 540 | else |
| 541 | { |
| 542 | auto &port( kernel->output ); |
| 543 | for( auto it( port.begin() ); |
| 544 | it != port.end(); ++it ) |
| 545 | { |
| 546 | next->src = kernel; |
| 547 | //next->dst already eq dst |