@@ -504,6 +504,31 @@ static bool read_device_global_mem_defs(
504
504
return result;
505
505
}
506
506
507
+ static bool read_streaming_kernel_arg_info (
508
+ const std::string &config_str, std::string::size_type &curr_pos,
509
+ std::optional<acl_streaming_kernel_arg_info> &streaming_info,
510
+ std::vector<int > &counters) noexcept {
511
+ int num_fields = 0 ;
512
+ bool result = read_int_counters (config_str, curr_pos, num_fields, counters);
513
+ counters.emplace_back (num_fields);
514
+
515
+ if (result && counters.back () > 0 ) {
516
+ streaming_info = std::make_optional (acl_streaming_kernel_arg_info{});
517
+ result = read_string_counters (config_str, curr_pos,
518
+ streaming_info->interface_name , counters);
519
+ }
520
+
521
+ while (result && counters.back () > 0 ) {
522
+ std::string tmp;
523
+ result =
524
+ result && read_string_counters (config_str, curr_pos, tmp, counters);
525
+ }
526
+ check_section_counters (counters);
527
+ counters.pop_back ();
528
+
529
+ return result;
530
+ }
531
+
507
532
static bool read_kernel_args (const std::string &config_str,
508
533
const bool kernel_arg_info_available,
509
534
std::string::size_type &curr_pos,
@@ -597,6 +622,12 @@ static bool read_kernel_args(const std::string &config_str,
597
622
type_name = " " ;
598
623
}
599
624
625
+ std::optional<acl_streaming_kernel_arg_info> streaming_info;
626
+ if (result && counters.back () > 0 ) {
627
+ result = read_streaming_kernel_arg_info (config_str, curr_pos,
628
+ streaming_info, counters);
629
+ }
630
+
600
631
/* ****************************************************************
601
632
Since the introduction of autodiscovery forwards-compatibility,
602
633
new entries for each kernel argument section start here.
@@ -619,6 +650,7 @@ static bool read_kernel_args(const std::string &config_str,
619
650
args[j].host_accessible = host_accessible;
620
651
args[j].pipe_channel_id = pipe_channel_id;
621
652
args[j].buffer_location = buffer_location;
653
+ args[j].streaming_info = streaming_info;
622
654
}
623
655
// forward compatibility: bypassing remaining fields at the end of
624
656
// arguments section
@@ -635,6 +667,37 @@ static bool read_kernel_args(const std::string &config_str,
635
667
return result;
636
668
}
637
669
670
+ static bool read_streaming_kernel_info (
671
+ const std::string &config_str, std::string::size_type &curr_pos,
672
+ std::optional<acl_streaming_kernel_info> &streaming_info,
673
+ std::vector<int > &counters) noexcept {
674
+ int num_fields = 0 ;
675
+ bool result = read_int_counters (config_str, curr_pos, num_fields, counters);
676
+ counters.emplace_back (num_fields);
677
+
678
+ if (result && counters.back () > 0 ) {
679
+ streaming_info = std::make_optional (acl_streaming_kernel_info{});
680
+ result = read_string_counters (config_str, curr_pos, streaming_info->start ,
681
+ counters) &&
682
+ read_string_counters (config_str, curr_pos, streaming_info->done ,
683
+ counters) &&
684
+ read_string_counters (config_str, curr_pos,
685
+ streaming_info->stall_in , counters) &&
686
+ read_string_counters (config_str, curr_pos,
687
+ streaming_info->stall_out , counters);
688
+ }
689
+
690
+ while (result && counters.back () > 0 ) {
691
+ std::string tmp;
692
+ result =
693
+ result && read_string_counters (config_str, curr_pos, tmp, counters);
694
+ }
695
+ check_section_counters (counters);
696
+ counters.pop_back ();
697
+
698
+ return result;
699
+ }
700
+
638
701
static bool read_accel_defs (const std::string &config_str,
639
702
std::string::size_type &curr_pos,
640
703
const bool kernel_arg_info_available,
@@ -872,6 +935,11 @@ static bool read_accel_defs(const std::string &config_str,
872
935
accel[i].is_sycl_compile , counters);
873
936
}
874
937
938
+ if (result && counters.back () > 0 ) {
939
+ result = read_streaming_kernel_info (config_str, curr_pos,
940
+ accel[i].streaming_info , counters);
941
+ }
942
+
875
943
// forward compatibility: bypassing remaining fields at the end of kernel
876
944
// description section
877
945
while (result && counters.size () > 0 &&
0 commit comments