@@ -21,19 +21,28 @@ REFL_END
21
21
REFL_TYPE(ggml_opt_context::ggml_grad )
22
22
REFL_END
23
23
#endif
24
+
25
+ REFL_TYPE (ggml_task_type )
26
+ REFL_END
27
+ REFL_TYPE(ggml_type )
28
+ REFL_END
29
+ REFL_TYPE(ggml_backend_type )
30
+ REFL_END
31
+ // REFL_TYPE(long int * )
32
+ // REFL_END
24
33
REFL_TYPE(gpt_params )
25
34
26
- REFL_FIELD( seed )
27
- REFL_FIELD( n_threads)
28
- REFL_FIELD( n_threads_batch)
29
- REFL_FIELD( n_predict )
30
- REFL_FIELD( n_ctx )
31
- REFL_FIELD( n_batch)
32
- REFL_FIELD( n_keep )
33
- REFL_FIELD( n_draft)
34
- REFL_FIELD( n_chunks )
35
- REFL_FIELD( n_parallel)
36
- REFL_FIELD( n_sequences)
35
+ // REFL_FIELD( seed )
36
+ // REFL_FIELD( n_threads)
37
+ // REFL_FIELD( n_threads_batch)
38
+ // REFL_FIELD( n_predict )
39
+ // REFL_FIELD( n_ctx )
40
+ // REFL_FIELD( n_batch)
41
+ // REFL_FIELD( n_keep )
42
+ // REFL_FIELD( n_draft)
43
+ // REFL_FIELD( n_chunks )
44
+ // REFL_FIELD( n_parallel)
45
+ // REFL_FIELD( n_sequences)
37
46
REFL_FIELD( p_accept )
38
47
REFL_FIELD( p_split )
39
48
REFL_FIELD( n_gpu_layers)
@@ -586,6 +595,7 @@ REFL_END
586
595
template <typename T>
587
596
constexpr auto get_value_type_name (const T t) noexcept
588
597
{
598
+
589
599
return t.value_type ;
590
600
}
591
601
@@ -635,15 +645,19 @@ namespace runtime2
635
645
using type_descriptor = type_descriptor<T>;
636
646
bool compact = depth == -1 ;
637
647
// print type with members enclosed in braces
638
- os << type_descriptor::name << " { " ;
648
+ os << " Type2: " << type_descriptor::name << " { " ;
639
649
if (!compact) os << ' \n ' ;
640
650
641
651
constexpr auto readable_members = filter (type_descriptor::members, [](auto member) { return is_readable (member); });
642
652
for_each (readable_members, [&](auto member, [[maybe_unused]] auto index) {
643
653
int new_depth = next_depth (depth);
644
654
645
655
indent (os, new_depth);
646
- os << get_display_name (member) << " = " ;
656
+ os << get_display_name (member) << " /" ;
657
+ // using typename member_descriptor_base<T, 0>::member;
658
+ // static_assert(trait::is_field_v<member>);
659
+
660
+ // os << get_value_type_name(member) << " = ";
647
661
648
662
if constexpr (util::contains_instance<attr::debug>(member.attributes )) {
649
663
// use the debug attribute to print
@@ -679,6 +693,9 @@ namespace runtime2
679
693
}
680
694
else if constexpr (detail::is_ostream_printable_v<CharT, T>) {
681
695
// type supports printing natively, just use that
696
+ // constexpr auto vtype = refl::reflect<T>();
697
+ using type_descriptor = refl::descriptor::type_descriptor<T>;
698
+ os << " Type:" << type_descriptor::name << " :" ;
682
699
683
700
os << value;
684
701
@@ -719,26 +736,34 @@ namespace runtime2
719
736
void debug_impl (std::basic_ostream<CharT>& os, const T& value, [[maybe_unused]] int depth)
720
737
{
721
738
using no_pointer_t = std::remove_pointer_t <T>;
739
+ using type_descriptor = type_descriptor<T>;
722
740
723
741
if constexpr (std::is_same_v<bool , T>) {
724
- os << (value ? " true" : " false" );
742
+
743
+ os << " BOOL" << (value ? " true" : " false" );
725
744
}
726
745
else if constexpr (std::is_pointer_v<T> && !std::is_void_v<no_pointer_t > && trait::is_reflectable_v<no_pointer_t >) {
727
746
if (value == nullptr ) {
728
- os << " nullptr" ;
747
+ os << " POINTER: " << " nullptr" ;
729
748
}
730
749
else {
750
+ os << " Type0:" <<type_descriptor::name << " =" ;
731
751
os << ' &' ;
732
752
debug_impl (os, *value, -1 );
733
753
}
734
754
}
735
755
else if constexpr (trait::is_reflectable_v<T>) {
756
+ os << " Type2:" <<type_descriptor::name << " =" ;
736
757
debug_reflectable (os, value, depth);
737
758
}
738
759
else if constexpr (detail::is_ostream_printable_v<CharT, T>) {
760
+ // os << "Type3:" <<type_descriptor::name << "=";
761
+ os << " TypeSimple:" << typeid (T).name () << " //" ;
739
762
os << value;
740
763
}
741
764
else if constexpr (trait::is_container_v<T>) {
765
+ // os << "Type4:" <<type_descriptor::name << "=";
766
+ os << " TypeContainer:" << typeid (T).name () << " //" ;
742
767
debug_container (os, value, depth);
743
768
}
744
769
else {
@@ -799,7 +824,7 @@ namespace runtime2
799
824
template <typename T>
800
825
void print_fields (const T& t) {
801
826
runtime2::debug (std::cout, t);
802
- constexpr auto type = refl::reflect<T>();
827
+ // constexpr auto type = refl::reflect<T>();
803
828
804
829
// constexpr auto membertype = refl::member_list<T>();
805
830
0 commit comments