Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
1294 lines
85 KiB
XML
1294 lines
85 KiB
XML
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
|
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.13.2" xml:lang="en-US">
|
|
<compounddef id="namespaceserif_1_1utils_1_1dependencies" kind="namespace" language="C++">
|
|
<compoundname>serif::utils::dependencies</compoundname>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_all_nodes_observer" prot="public">serif::utils::dependencies::AllNodesObserver</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_binding" prot="public">serif::utils::dependencies::Binding</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_bindings" prot="public">serif::utils::dependencies::Bindings</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_bound_type" prot="public">serif::utils::dependencies::BoundType</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_computation" prot="public">serif::utils::dependencies::Computation</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_computation_cache" prot="public">serif::utils::dependencies::ComputationCache</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_computation_graph" prot="public">serif::utils::dependencies::ComputationGraph</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_dependency_context" prot="public">serif::utils::dependencies::DependencyContext</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_dependency_context_view" prot="public">serif::utils::dependencies::DependencyContextView</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_dependency_context_view_3_01_parent_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4" prot="public">serif::utils::dependencies::DependencyContextView< ParentT, KeyList< KeyTs... > ></innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_edge_observer" prot="public">serif::utils::dependencies::EdgeObserver</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_graph_timing" prot="public">serif::utils::dependencies::GraphTiming</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_graph_timing_factory" prot="public">serif::utils::dependencies::GraphTimingFactory</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_graph_timing_run" prot="public">serif::utils::dependencies::GraphTimingRun</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_has_binding" prot="public">serif::utils::dependencies::HasBinding</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_key_list" prot="public">serif::utils::dependencies::KeyList</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_key_list_bindings" prot="public">serif::utils::dependencies::KeyListBindings</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_key_list_bindings_3_01_bindings_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4" prot="public">serif::utils::dependencies::KeyListBindings< BindingsT, KeyList< KeyTs... > ></innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_node_observer" prot="public">serif::utils::dependencies::NodeObserver</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_node_timing" prot="public">serif::utils::dependencies::NodeTiming</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_no_graph_observers" prot="public">serif::utils::dependencies::NoGraphObservers</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_observers" prot="public">serif::utils::dependencies::Observers</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_preparation_failure" prot="public">serif::utils::dependencies::PreparationFailure</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_preparation_report" prot="public">serif::utils::dependencies::PreparationReport</innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_projected_snapshot" prot="public">serif::utils::dependencies::ProjectedSnapshot</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_resolve_keys" prot="public">serif::utils::dependencies::ResolveKeys</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_resolve_keys_3_01_bindings_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4" prot="public">serif::utils::dependencies::ResolveKeys< BindingsT, KeyList< KeyTs... > ></innerclass>
|
|
<innerclass refid="classserif_1_1utils_1_1dependencies_1_1_resource" prot="public">serif::utils::dependencies::Resource</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_steady_node_clock" prot="public">serif::utils::dependencies::SteadyNodeClock</innerclass>
|
|
<innerclass refid="structserif_1_1utils_1_1dependencies_1_1_value_snapshot" prot="public">serif::utils::dependencies::ValueSnapshot</innerclass>
|
|
<innernamespace refid="namespaceserif_1_1utils_1_1dependencies_1_1detail">serif::utils::dependencies::detail</innernamespace>
|
|
<innernamespace refid="namespaceserif_1_1utils_1_1dependencies_1_1keys">serif::utils::dependencies::keys</innernamespace>
|
|
<sectiondef kind="enum">
|
|
<memberdef kind="enum" id="namespaceserif_1_1utils_1_1dependencies_1af2f6dab3a0204175602c7fc2348344f7" prot="public" static="no" strong="yes">
|
|
<type></type>
|
|
<name>NodeOutcome</name>
|
|
<qualifiedname>serif::utils::dependencies::NodeOutcome</qualifiedname>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1af2f6dab3a0204175602c7fc2348344f7aaa8fb77e57d1ca18d593e909729871fe" prot="public">
|
|
<name>completed</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1af2f6dab3a0204175602c7fc2348344f7ac7537d6d48ecf261749c09a9f284bd45" prot="public">
|
|
<name>rejected</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1af2f6dab3a0204175602c7fc2348344f7a42552b1f133f9f8eb406d4f306ea9fd1" prot="public">
|
|
<name>exception</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<briefdescription>
|
|
<para>Describe a node invocation, independently of whether the whole graph request is later accepted. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/observers.hpp" line="18" column="5" bodyfile="src/include/serif/utils/dependencies/observers.hpp" bodystart="18" bodyend="22"/>
|
|
</memberdef>
|
|
<memberdef kind="enum" id="namespaceserif_1_1utils_1_1dependencies_1a84cfff3388a09373636c15a3817a0782" prot="public" static="no" strong="yes">
|
|
<type></type>
|
|
<name>PreparationMode</name>
|
|
<qualifiedname>serif::utils::dependencies::PreparationMode</qualifiedname>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1a84cfff3388a09373636c15a3817a0782aa49991912bafff4aa74bb3b4dbd42038" prot="public">
|
|
<name>reuse_unchanged</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1a84cfff3388a09373636c15a3817a0782a9e67f9a60581ce784117ff2047627d2f" prot="public">
|
|
<name>rebuild</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/preparation.hpp" line="13" column="5" bodyfile="src/include/serif/utils/dependencies/preparation.hpp" bodystart="13" bodyend="16"/>
|
|
</memberdef>
|
|
<memberdef kind="enum" id="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463" prot="public" static="no" strong="yes">
|
|
<type></type>
|
|
<name>PreparationStatus</name>
|
|
<qualifiedname>serif::utils::dependencies::PreparationStatus</qualifiedname>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463a20ab085a3c46af7db87fc1806865b329" prot="public">
|
|
<name>not_required</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463a657be30363225dfa595d3c8e59577181" prot="public">
|
|
<name>reused</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<enumvalue id="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463a5a317d3dd3f7a2f675975a6d0c11c629" prot="public">
|
|
<name>computed</name>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
</enumvalue>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/preparation.hpp" line="17" column="5" bodyfile="src/include/serif/utils/dependencies/preparation.hpp" bodystart="17" bodyend="21"/>
|
|
</memberdef>
|
|
</sectiondef>
|
|
<sectiondef kind="typedef">
|
|
<memberdef kind="typedef" id="namespaceserif_1_1utils_1_1dependencies_1adc0d56ab32ca6ea92c3732dde92fa6a1" prot="public" static="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename BindingsT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type><ref refid="structserif_1_1utils_1_1dependencies_1_1_bound_type" kindref="compound">BoundType</ref>< BindingsT, KeyT >::target_type</type>
|
|
<definition>using serif::utils::dependencies::bound_type_t = BoundType<BindingsT, KeyT>::target_type</definition>
|
|
<argsstring></argsstring>
|
|
<name>bound_type_t</name>
|
|
<qualifiedname>serif::utils::dependencies::bound_type_t</qualifiedname>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/binding.hpp" line="91" column="5" bodyfile="src/include/serif/utils/dependencies/binding.hpp" bodystart="91" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="typedef" id="namespaceserif_1_1utils_1_1dependencies_1a22eef682b02dad9de4774e4b68b003ba" prot="public" static="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>KeyTs</declname>
|
|
<defname>KeyTs</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type><ref refid="structserif_1_1utils_1_1dependencies_1_1_key_list" kindref="compound">KeyList</ref>< KeyTs... ></type>
|
|
<definition>using serif::utils::dependencies::InputList = KeyList<KeyTs...></definition>
|
|
<argsstring></argsstring>
|
|
<name>InputList</name>
|
|
<qualifiedname>serif::utils::dependencies::InputList</qualifiedname>
|
|
<briefdescription>
|
|
<para><ref refid="classserif_1_1utils_1_1dependencies_1_1_computation" kindref="compound">Computation</ref> arguments are supplied in this key order. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list.hpp" line="17" column="5" bodyfile="src/include/serif/utils/dependencies/key_list.hpp" bodystart="17" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="typedef" id="namespaceserif_1_1utils_1_1dependencies_1a0674f826a11ecdab76236fa550cd88d5" prot="public" static="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>KeyTs</declname>
|
|
<defname>KeyTs</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type><ref refid="structserif_1_1utils_1_1dependencies_1_1_key_list" kindref="compound">KeyList</ref>< KeyTs... ></type>
|
|
<definition>using serif::utils::dependencies::RequestedResults = KeyList<KeyTs...></definition>
|
|
<argsstring></argsstring>
|
|
<name>RequestedResults</name>
|
|
<qualifiedname>serif::utils::dependencies::RequestedResults</qualifiedname>
|
|
<briefdescription>
|
|
<para>Preparing these results also prepares their required intermediate computations. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list.hpp" line="21" column="5" bodyfile="src/include/serif/utils/dependencies/key_list.hpp" bodystart="21" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="typedef" id="namespaceserif_1_1utils_1_1dependencies_1ad50a04df4c202c11f49d6a2cf594b5da" prot="public" static="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename BindingsT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename KeysT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type><ref refid="structserif_1_1utils_1_1dependencies_1_1_resolve_keys" kindref="compound">ResolveKeys</ref>< BindingsT, std::remove_cvref_t< KeysT > >::type</type>
|
|
<definition>using serif::utils::dependencies::ResolvedTargets = ResolveKeys<BindingsT, std::remove_cvref_t<KeysT>>::type</definition>
|
|
<argsstring></argsstring>
|
|
<name>ResolvedTargets</name>
|
|
<qualifiedname>serif::utils::dependencies::ResolvedTargets</qualifiedname>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list.hpp" line="52" column="5" bodyfile="src/include/serif/utils/dependencies/key_list.hpp" bodystart="52" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="typedef" id="namespaceserif_1_1utils_1_1dependencies_1a4b225a37465f007a877f89860d3627c1" prot="public" static="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>IsKeyList...</type>
|
|
<declname>Lists</declname>
|
|
<defname>Lists</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type><ref refid="structserif_1_1utils_1_1dependencies_1_1detail_1_1_merge_key_lists" kindref="compound">detail::MergeKeyLists</ref>< <ref refid="structserif_1_1utils_1_1dependencies_1_1_key_list" kindref="compound">KeyList</ref><>, std::remove_cvref_t< Lists >... >::type</type>
|
|
<definition>using serif::utils::dependencies::CombinedKeyList = detail::MergeKeyLists<KeyList<>, std::remove_cvref_t<Lists>...>::type</definition>
|
|
<argsstring></argsstring>
|
|
<name>CombinedKeyList</name>
|
|
<qualifiedname>serif::utils::dependencies::CombinedKeyList</qualifiedname>
|
|
<briefdescription>
|
|
<para>Combine requirements in first-appearance order, retaining distinct keys with shared targets. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list_operations.hpp" line="25" column="5" bodyfile="src/include/serif/utils/dependencies/key_list_operations.hpp" bodystart="25" bodyend="-1"/>
|
|
</memberdef>
|
|
</sectiondef>
|
|
<sectiondef kind="var">
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ab54a589695456ce4f7b3fb4e3bd97947" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_bindings_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_bindings_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_bindings_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/binding.hpp" line="36" column="27" bodyfile="src/include/serif/utils/dependencies/binding.hpp" bodystart="36" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a3a8a1a7fd56af08612f141f2bb50e0a1" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>BindingTs</declname>
|
|
<defname>BindingTs</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_bindings_v< Bindings< BindingTs... > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_bindings_v< Bindings< BindingTs... > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_bindings_v< Bindings< BindingTs... > ></qualifiedname>
|
|
<initializer>= <ref refid="namespaceserif_1_1utils_1_1misc_1_1traits_1a8cb5b9ce5869ecf88101859ace70f92a" kindref="member">misc::traits::all_unique_types_v</ref><typename BindingTs::Key...></initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/binding.hpp" line="39" column="22" bodyfile="src/include/serif/utils/dependencies/binding.hpp" bodystart="39" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a1563a020c811fac185bcc81b95b1035a" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>IsBindings</type>
|
|
<declname>BindingsT</declname>
|
|
<defname>BindingsT</defname>
|
|
</param>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::has_binding_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>has_binding_v</name>
|
|
<qualifiedname>serif::utils::dependencies::has_binding_v</qualifiedname>
|
|
<initializer>= <ref refid="structserif_1_1utils_1_1dependencies_1_1_has_binding" kindref="compound">HasBinding</ref><BindingsT, KeyT>::value</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/binding.hpp" line="81" column="27" bodyfile="src/include/serif/utils/dependencies/binding.hpp" bodystart="81" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a6da3a3b9a8f33ce1fbf5bcc8ed74f133" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_computation_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_computation_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_computation_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation.hpp" line="33" column="27" bodyfile="src/include/serif/utils/dependencies/computation.hpp" bodystart="33" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ac2f7973ec74922857a6f764d1faaae2f" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename InputsT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename FunctionT</type>
|
|
</param>
|
|
<param>
|
|
<type>bool</type>
|
|
<declname>OwnsInputs</declname>
|
|
<defname>OwnsInputs</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_computation_v< Computation< KeyT, InputsT, FunctionT, OwnsInputs > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_computation_v< Computation< KeyT, InputsT, FunctionT, OwnsInputs > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_computation_v< Computation< KeyT, InputsT, FunctionT, OwnsInputs > ></qualifiedname>
|
|
<initializer>= true</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation.hpp" line="36" column="22" bodyfile="src/include/serif/utils/dependencies/computation.hpp" bodystart="36" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a785d1764613ef1db8cfbb8d3d8d401e5" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_computation_graph_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_computation_graph_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_computation_graph_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation_graph.hpp" line="61" column="27" bodyfile="src/include/serif/utils/dependencies/computation_graph.hpp" bodystart="61" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a5bede32254345d0f43a09fc929dd07a9" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Computations</declname>
|
|
<defname>Computations</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_computation_graph_v< ComputationGraph< Computations... > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_computation_graph_v< ComputationGraph< Computations... > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_computation_graph_v< ComputationGraph< Computations... > ></qualifiedname>
|
|
<initializer>= true</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation_graph.hpp" line="64" column="22" bodyfile="src/include/serif/utils/dependencies/computation_graph.hpp" bodystart="64" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1aa187a1c3b0db631f8752bebcf8a16af7" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_dependency_context_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_dependency_context_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_dependency_context_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/dependency_context.hpp" line="87" column="27" bodyfile="src/include/serif/utils/dependencies/dependency_context.hpp" bodystart="87" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ab42cde4e64e4612056fbeaa5c383bc2d" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Resources</declname>
|
|
<defname>Resources</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_dependency_context_v< DependencyContext< Resources... > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_dependency_context_v< DependencyContext< Resources... > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_dependency_context_v< DependencyContext< Resources... > ></qualifiedname>
|
|
<initializer>= true</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/dependency_context.hpp" line="90" column="22" bodyfile="src/include/serif/utils/dependencies/dependency_context.hpp" bodystart="90" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ae3cc546046ae8957136c778b9c8c0682" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename ParentT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename KeysT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_dependency_context_v< DependencyContextView< ParentT, KeysT > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_dependency_context_v< DependencyContextView< ParentT, KeysT > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_dependency_context_v< DependencyContextView< ParentT, KeysT > ></qualifiedname>
|
|
<initializer>= true</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/dependency_context.hpp" line="93" column="22" bodyfile="src/include/serif/utils/dependencies/dependency_context.hpp" bodystart="93" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a25fa55523bb000e3162a850a7912b249" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_key_list_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_key_list_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_key_list_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list.hpp" line="24" column="27" bodyfile="src/include/serif/utils/dependencies/key_list.hpp" bodystart="24" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ac02e21a813bf00c2f5debac9b251b757" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>KeyTs</declname>
|
|
<defname>KeyTs</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_key_list_v< KeyList< KeyTs... > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_key_list_v< KeyList< KeyTs... > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_key_list_v< KeyList< KeyTs... > ></qualifiedname>
|
|
<initializer>= <ref refid="namespaceserif_1_1utils_1_1misc_1_1traits_1a8cb5b9ce5869ecf88101859ace70f92a" kindref="member">misc::traits::all_unique_types_v</ref><KeyTs...></initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list.hpp" line="27" column="22" bodyfile="src/include/serif/utils/dependencies/key_list.hpp" bodystart="27" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a317a69acc139be6b2d45f95cf1c1412c" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>IsKeyList</type>
|
|
<declname>KeysT</declname>
|
|
<defname>KeysT</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>std::size_t</type>
|
|
<definition>std::size_t serif::utils::dependencies::key_count_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>key_count_v</name>
|
|
<qualifiedname>serif::utils::dependencies::key_count_v</qualifiedname>
|
|
<initializer>= <ref refid="structserif_1_1utils_1_1dependencies_1_1detail_1_1_key_list_size" kindref="compound">detail::KeyListSize</ref><std::remove_cvref_t<KeysT>>::value</initializer>
|
|
<briefdescription>
|
|
<para>Count distinct declared keys without constructing their associated values. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list_operations.hpp" line="14" column="34" bodyfile="src/include/serif/utils/dependencies/key_list_operations.hpp" bodystart="14" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1ab3b86a8b49e4a73b04c3fa547b45f8b2" prot="public" static="no" mutable="no">
|
|
<type>std::unordered_map< <ref refid="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463" kindref="member">PreparationStatus</ref>, std::string_view ></type>
|
|
<definition>std::unordered_map<PreparationStatus, std::string_view> serif::utils::dependencies::preparation_status_name_map</definition>
|
|
<argsstring></argsstring>
|
|
<name>preparation_status_name_map</name>
|
|
<qualifiedname>serif::utils::dependencies::preparation_status_name_map</qualifiedname>
|
|
<initializer>= <ref refid="namespaceserif_1_1meta_1a228074fe1d60918db17444e31b601c2f" kindref="member">meta::enum_to_enum_string_map</ref><<ref refid="namespaceserif_1_1utils_1_1dependencies_1aabcbd6673ef3efcfc167ceb73cc7d463" kindref="member">PreparationStatus</ref>>()</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/preparation.hpp" line="23" column="31" bodyfile="src/include/serif/utils/dependencies/preparation.hpp" bodystart="23" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a08ffdf8776f919989660acf4c0cde988" prot="public" static="no" mutable="no">
|
|
<type>std::unordered_map< <ref refid="namespaceserif_1_1utils_1_1dependencies_1a84cfff3388a09373636c15a3817a0782" kindref="member">PreparationMode</ref>, std::string_view ></type>
|
|
<definition>std::unordered_map<PreparationMode, std::string_view> serif::utils::dependencies::preparation_mode_name_map</definition>
|
|
<argsstring></argsstring>
|
|
<name>preparation_mode_name_map</name>
|
|
<qualifiedname>serif::utils::dependencies::preparation_mode_name_map</qualifiedname>
|
|
<initializer>= <ref refid="namespaceserif_1_1meta_1a228074fe1d60918db17444e31b601c2f" kindref="member">meta::enum_to_enum_string_map</ref><<ref refid="namespaceserif_1_1utils_1_1dependencies_1a84cfff3388a09373636c15a3817a0782" kindref="member">PreparationMode</ref>>()</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/preparation.hpp" line="24" column="31" bodyfile="src/include/serif/utils/dependencies/preparation.hpp" bodystart="24" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a97396efb03530235b2aa83115cf2f921" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename T</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_resource_v</definition>
|
|
<argsstring></argsstring>
|
|
<name>is_resource_v</name>
|
|
<qualifiedname>serif::utils::dependencies::is_resource_v</qualifiedname>
|
|
<initializer>= false</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/resource.hpp" line="51" column="27" bodyfile="src/include/serif/utils/dependencies/resource.hpp" bodystart="51" bodyend="-1"/>
|
|
</memberdef>
|
|
<memberdef kind="variable" id="namespaceserif_1_1utils_1_1dependencies_1a6059315fec7209b8443d75ac7a680880" prot="public" static="no" constexpr="yes" mutable="no">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename StorageT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename PolicyT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>bool</type>
|
|
<definition>bool serif::utils::dependencies::is_resource_v< Resource< KeyT, StorageT, PolicyT > ></definition>
|
|
<argsstring></argsstring>
|
|
<name>is_resource_v< Resource< KeyT, StorageT, PolicyT > ></name>
|
|
<qualifiedname>serif::utils::dependencies::is_resource_v< Resource< KeyT, StorageT, PolicyT > ></qualifiedname>
|
|
<initializer>= true</initializer>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/resource.hpp" line="54" column="22" bodyfile="src/include/serif/utils/dependencies/resource.hpp" bodystart="54" bodyend="-1"/>
|
|
</memberdef>
|
|
</sectiondef>
|
|
<sectiondef kind="func">
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a70e11340fa044443fefa79ba7e0c11d5" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>IsKeyList</type>
|
|
<declname>InputsT</declname>
|
|
<defname>InputsT</defname>
|
|
</param>
|
|
<param>
|
|
<type>typename FunctionT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_computation</definition>
|
|
<argsstring>(FunctionT &&function)</argsstring>
|
|
<name>make_computation</name>
|
|
<qualifiedname>serif::utils::dependencies::make_computation</qualifiedname>
|
|
<param>
|
|
<type>FunctionT &&</type>
|
|
<declname>function</declname>
|
|
</param>
|
|
<requiresclause>std::constructible_from<std::decay_t<FunctionT>, FunctionT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Attach an output key and ordered input keys to a lambda, function, or other callable. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation.hpp" line="44" column="11" bodyfile="src/include/serif/utils/dependencies/computation.hpp" bodystart="44" bodyend="46"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1ad18195932b89cba96fd203584bfac47a" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>IsKeyList</type>
|
|
<declname>InputsT</declname>
|
|
<defname>InputsT</defname>
|
|
</param>
|
|
<param>
|
|
<type>typename FunctionT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_owning_computation</definition>
|
|
<argsstring>(FunctionT &&function)</argsstring>
|
|
<name>make_owning_computation</name>
|
|
<qualifiedname>serif::utils::dependencies::make_owning_computation</qualifiedname>
|
|
<param>
|
|
<type>FunctionT &&</type>
|
|
<declname>function</declname>
|
|
</param>
|
|
<requiresclause>std::constructible_from<std::decay_t<FunctionT>, FunctionT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Supply immutable shared handles to computed prerequisites so results can retain them without copying. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
<para><simplesect kind="note"><para>Every input must be produced by this graph. Context sources remain borrowed and cannot be retained this way. Resources borrowed inside a prerequisite must still outlive their use; the handle owns only the computed result. </para>
|
|
</simplesect>
|
|
</para>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation.hpp" line="55" column="11" bodyfile="src/include/serif/utils/dependencies/computation.hpp" bodystart="55" bodyend="57"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1ad583eaa88367daf4af4d420047f24d38" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename ErrorT</type>
|
|
<defval>std::string</defval>
|
|
</param>
|
|
<param>
|
|
<type>IsComputationGraph</type>
|
|
<declname>GraphT</declname>
|
|
<defname>GraphT</defname>
|
|
</param>
|
|
<param>
|
|
<type>IsDependencyContext</type>
|
|
<declname>ContextT</declname>
|
|
<defname>ContextT</defname>
|
|
</param>
|
|
<param>
|
|
<type>typename ObserversT</type>
|
|
<defval>Observers<></defval>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_computation_cache</definition>
|
|
<argsstring>(GraphT &&graph, const ContextT &, ObserversT &&observers=ObserversT{})</argsstring>
|
|
<name>make_computation_cache</name>
|
|
<qualifiedname>serif::utils::dependencies::make_computation_cache</qualifiedname>
|
|
<param>
|
|
<type>GraphT &&</type>
|
|
<declname>graph</declname>
|
|
</param>
|
|
<param>
|
|
<type>const ContextT &</type>
|
|
</param>
|
|
<param>
|
|
<type>ObserversT &&</type>
|
|
<declname>observers</declname>
|
|
<defval>ObserversT{}</defval>
|
|
</param>
|
|
<requiresclause>CanPrepare<GraphT, ContextT, ErrorT> && ObserversFor<ObserversT, GraphT, ContextT> && std::constructible_from<std::remove_cvref_t<GraphT>, GraphT> && std::constructible_from<std::remove_cvref_t<ObserversT>, ObserversT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Fix the graph's source types without retaining the supplied context or evaluating any computations. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation_cache.hpp" line="318" column="11" bodyfile="src/include/serif/utils/dependencies/computation_cache.hpp" bodystart="318" bodyend="321"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a37ad94611656a36bf3584940465302ec" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename ErrorT</type>
|
|
<defval>std::string</defval>
|
|
</param>
|
|
<param>
|
|
<type>IsDependencyContext</type>
|
|
<declname>ContextT</declname>
|
|
<defname>ContextT</defname>
|
|
</param>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Computations</declname>
|
|
<defname>Computations</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_computation_cache</definition>
|
|
<argsstring>(const ContextT &context, Computations &&... computations)</argsstring>
|
|
<name>make_computation_cache</name>
|
|
<qualifiedname>serif::utils::dependencies::make_computation_cache</qualifiedname>
|
|
<param>
|
|
<type>const ContextT &</type>
|
|
<declname>context</declname>
|
|
</param>
|
|
<param>
|
|
<type>Computations &&...</type>
|
|
<declname>computations</declname>
|
|
</param>
|
|
<requiresclause>CompatibleComputations<Computations...> && (std::constructible_from<std::remove_cvref_t<Computations>, Computations> && ...) && CanPrepare<ComputationGraph<std::remove_cvref_t<Computations>...>, ContextT, ErrorT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Build a checked graph and an empty cache directly from named computations. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation_cache.hpp" line="328" column="11" bodyfile="src/include/serif/utils/dependencies/computation_cache.hpp" bodystart="328" bodyend="330"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1aaa065b5bd3823bd3835f159462af09d0" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Computations</declname>
|
|
<defname>Computations</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_computation_graph</definition>
|
|
<argsstring>(Computations &&... computations)</argsstring>
|
|
<name>make_computation_graph</name>
|
|
<qualifiedname>serif::utils::dependencies::make_computation_graph</qualifiedname>
|
|
<param>
|
|
<type>Computations &&...</type>
|
|
<declname>computations</declname>
|
|
</param>
|
|
<requiresclause>CompatibleComputations<Computations...> && (std::constructible_from<std::remove_cvref_t<Computations>, Computations> && ...) </requiresclause>
|
|
<briefdescription>
|
|
<para>Reject duplicate producers and cyclic computational graphs at the declaration site. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/computation_graph.hpp" line="73" column="11" bodyfile="src/include/serif/utils/dependencies/computation_graph.hpp" bodystart="73" bodyend="75"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1ab0cfd959e8c00f5e1641f26798333972" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Resources</declname>
|
|
<defname>Resources</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_dependency_context</definition>
|
|
<argsstring>(Resources &&... resources)</argsstring>
|
|
<name>make_dependency_context</name>
|
|
<qualifiedname>serif::utils::dependencies::make_dependency_context</qualifiedname>
|
|
<param>
|
|
<type>Resources &&...</type>
|
|
<declname>resources</declname>
|
|
</param>
|
|
<requiresclause>(IsResource<Resources> && ...) && misc::traits::all_unique_types_v<typename std::remove_cvref_t<Resources>::Key...> </requiresclause>
|
|
<briefdescription>
|
|
<para>Build a context whose schema follows directly from its resource keys and types. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/dependency_context.hpp" line="101" column="11" bodyfile="src/include/serif/utils/dependencies/dependency_context.hpp" bodystart="101" bodyend="103"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1ae031216d69a09aa3921c363e36856e44" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>IsDependencyContext...</type>
|
|
<declname>Contexts</declname>
|
|
<defname>Contexts</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::combine_dependency_contexts</definition>
|
|
<argsstring>(const Contexts &... contexts)</argsstring>
|
|
<name>combine_dependency_contexts</name>
|
|
<qualifiedname>serif::utils::dependencies::combine_dependency_contexts</qualifiedname>
|
|
<param>
|
|
<type>const Contexts &...</type>
|
|
<declname>contexts</declname>
|
|
</param>
|
|
<requiresclause>(detail::combinable_resources(misc::concepts::ConcatT<typename Contexts::Resources...>{})) </requiresclause>
|
|
<briefdescription>
|
|
<para>Copy disjoint resources and their tracking policies into one context; borrowed objects retain their original lifetime. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/dependency_context.hpp" line="116" column="11" bodyfile="src/include/serif/utils/dependencies/dependency_context.hpp" bodystart="116" bodyend="123"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a2b6e1389a71419222053720f4bd9cd43" prot="public" static="no" nodiscard="yes" consteval="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename KeysT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>std::size_t</type>
|
|
<definition>std::size_t serif::utils::dependencies::key_index</definition>
|
|
<argsstring>()</argsstring>
|
|
<name>key_index</name>
|
|
<qualifiedname>serif::utils::dependencies::key_index</qualifiedname>
|
|
<requiresclause>ContainsKey<KeyT, KeysT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Locate a declared key in its ordered list; absent keys are rejected at compile time. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/key_list_operations.hpp" line="19" column="28" bodyfile="src/include/serif/utils/dependencies/key_list_operations.hpp" bodystart="19" bodyend="21"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a427c6ce690c7551cbdbbb5261bd8c125" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename BeforeT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename AfterT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::observe_node</definition>
|
|
<argsstring>(BeforeT &&before, AfterT &&after)</argsstring>
|
|
<name>observe_node</name>
|
|
<qualifiedname>serif::utils::dependencies::observe_node</qualifiedname>
|
|
<param>
|
|
<type>BeforeT &&</type>
|
|
<declname>before</declname>
|
|
</param>
|
|
<param>
|
|
<type>AfterT &&</type>
|
|
<declname>after</declname>
|
|
</param>
|
|
<requiresclause>NodeObserverCallbacks<std::decay_t<BeforeT>, std::decay_t<AfterT>> && std::constructible_from<std::decay_t<BeforeT>, BeforeT> && std::constructible_from<std::decay_t<AfterT>, AfterT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Bind before/after callbacks to a result key; callback captures determine any external storage lifetime. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/observers.hpp" line="181" column="11" bodyfile="src/include/serif/utils/dependencies/observers.hpp" bodystart="181" bodyend="184"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a1011c9c6c8b4e2ca4e87b9826743dde5" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename BeforeT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename AfterT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::observe_nodes</definition>
|
|
<argsstring>(BeforeT &&before, AfterT &&after)</argsstring>
|
|
<name>observe_nodes</name>
|
|
<qualifiedname>serif::utils::dependencies::observe_nodes</qualifiedname>
|
|
<param>
|
|
<type>BeforeT &&</type>
|
|
<declname>before</declname>
|
|
</param>
|
|
<param>
|
|
<type>AfterT &&</type>
|
|
<declname>after</declname>
|
|
</param>
|
|
<requiresclause>std::constructible_from<std::decay_t<BeforeT>, BeforeT> && std::constructible_from<std::decay_t<AfterT>, AfterT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Observe all executed nodes; cache construction checks the callback contract for every result key. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/observers.hpp" line="189" column="11" bodyfile="src/include/serif/utils/dependencies/observers.hpp" bodystart="189" bodyend="192"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a1156ef3083e1e54eaabb23309b17fb57" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename InputT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename ConsumerT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename FunctionT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::observe_edge</definition>
|
|
<argsstring>(FunctionT &&function)</argsstring>
|
|
<name>observe_edge</name>
|
|
<qualifiedname>serif::utils::dependencies::observe_edge</qualifiedname>
|
|
<param>
|
|
<type>FunctionT &&</type>
|
|
<declname>function</declname>
|
|
</param>
|
|
<requiresclause>std::constructible_from<std::decay_t<FunctionT>, FunctionT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Bind a read-only callback to one input of one consumer; graph construction validates the edge and value type. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/observers.hpp" line="197" column="11" bodyfile="src/include/serif/utils/dependencies/observers.hpp" bodystart="197" bodyend="199"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1af617b846949f46d528f63c89b218887b" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename...</type>
|
|
<declname>Registrations</declname>
|
|
<defname>Registrations</defname>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::make_observers</definition>
|
|
<argsstring>(Registrations &&... observers)</argsstring>
|
|
<name>make_observers</name>
|
|
<qualifiedname>serif::utils::dependencies::make_observers</qualifiedname>
|
|
<param>
|
|
<type>Registrations &&...</type>
|
|
<declname>observers</declname>
|
|
</param>
|
|
<requiresclause>(detail::is_observer_v<std::remove_cvref_t<Registrations>> && ...) && (std::constructible_from<std::remove_cvref_t<Registrations>, Registrations> && ...) </requiresclause>
|
|
<briefdescription>
|
|
<para>Collect any number of registrations, including several observers of the same node or edge. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/observers.hpp" line="205" column="11" bodyfile="src/include/serif/utils/dependencies/observers.hpp" bodystart="205" bodyend="207"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a80612ee1a5c84ccd1b36e5aab14c17d5" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename ValueT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename PolicyT</type>
|
|
<defval>ValueSnapshot</defval>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::own</definition>
|
|
<argsstring>(ValueT &&value, PolicyT policy={})</argsstring>
|
|
<name>own</name>
|
|
<qualifiedname>serif::utils::dependencies::own</qualifiedname>
|
|
<param>
|
|
<type>ValueT &&</type>
|
|
<declname>value</declname>
|
|
</param>
|
|
<param>
|
|
<type>PolicyT</type>
|
|
<declname>policy</declname>
|
|
<defval>{}</defval>
|
|
</param>
|
|
<briefdescription>
|
|
<para>Store a value in the context; rvalues transfer ownership and lvalues are copied. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/resource.hpp" line="61" column="11" bodyfile="src/include/serif/utils/dependencies/resource.hpp" bodystart="61" bodyend="64"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1abdacec2dea2bb64ecda1946529961565" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename ValueT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename PolicyT</type>
|
|
<defval>ValueSnapshot</defval>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::borrow</definition>
|
|
<argsstring>(ValueT &value, PolicyT policy={})</argsstring>
|
|
<name>borrow</name>
|
|
<qualifiedname>serif::utils::dependencies::borrow</qualifiedname>
|
|
<param>
|
|
<type>ValueT &</type>
|
|
<declname>value</declname>
|
|
</param>
|
|
<param>
|
|
<type>PolicyT</type>
|
|
<declname>policy</declname>
|
|
<defval>{}</defval>
|
|
</param>
|
|
<briefdescription>
|
|
<para>Bind an existing object whose lifetime must cover every use of the context. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/resource.hpp" line="68" column="11" bodyfile="src/include/serif/utils/dependencies/resource.hpp" bodystart="68" bodyend="71"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a2b9af58b739c7c1217fad649158a1063" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename KeyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename ValueT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename PolicyT</type>
|
|
<defval>ValueSnapshot</defval>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::borrow</definition>
|
|
<argsstring>(const ValueT &&, PolicyT={})=delete</argsstring>
|
|
<name>borrow</name>
|
|
<qualifiedname>serif::utils::dependencies::borrow</qualifiedname>
|
|
<param>
|
|
<type>const ValueT &&</type>
|
|
</param>
|
|
<param>
|
|
<type>PolicyT</type>
|
|
<defval>{}</defval>
|
|
</param>
|
|
<briefdescription>
|
|
<para>Borrowed storage must never refer to a temporary, including a const temporary. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/resource.hpp" line="75" column="10" declfile="src/include/serif/utils/dependencies/resource.hpp" declline="75" declcolumn="10"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1abd3aa4196f4454ea6052835065181c5f" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename FunctionT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::track_by</definition>
|
|
<argsstring>(FunctionT &&function)</argsstring>
|
|
<name>track_by</name>
|
|
<qualifiedname>serif::utils::dependencies::track_by</qualifiedname>
|
|
<param>
|
|
<type>FunctionT &&</type>
|
|
<declname>function</declname>
|
|
</param>
|
|
<briefdescription>
|
|
<para>Select the state that determines whether a source needs recomputation. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/snapshot.hpp" line="44" column="11" bodyfile="src/include/serif/utils/dependencies/snapshot.hpp" bodystart="44" bodyend="46"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1ae72aa784367f082484e9e998653de2d0" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>typename PolicyT</type>
|
|
</param>
|
|
<param>
|
|
<type>typename ValueT</type>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>const void *</type>
|
|
<definition>const void * serif::utils::dependencies::source_identity</definition>
|
|
<argsstring>(const PolicyT &policy, const ValueT &value)</argsstring>
|
|
<name>source_identity</name>
|
|
<qualifiedname>serif::utils::dependencies::source_identity</qualifiedname>
|
|
<param>
|
|
<type>const PolicyT &</type>
|
|
<declname>policy</declname>
|
|
</param>
|
|
<param>
|
|
<type>const ValueT &</type>
|
|
<declname>value</declname>
|
|
</param>
|
|
<requiresclause>SnapshotPolicyFor<PolicyT, ValueT> </requiresclause>
|
|
<briefdescription>
|
|
<para>Views may identify their underlying resource; ordinary sources retain object identity. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/snapshot.hpp" line="59" column="17" bodyfile="src/include/serif/utils/dependencies/snapshot.hpp" bodystart="59" bodyend="62"/>
|
|
</memberdef>
|
|
<memberdef kind="function" id="namespaceserif_1_1utils_1_1dependencies_1a48e42d1b80ff447550fed30ad60f0687" prot="public" static="no" nodiscard="yes" const="no" explicit="no" inline="no" virt="non-virtual">
|
|
<templateparamlist>
|
|
<param>
|
|
<type>NodeTimingClock</type>
|
|
<declname>Clock</declname>
|
|
<defname>Clock</defname>
|
|
<defval>SteadyNodeClock</defval>
|
|
</param>
|
|
</templateparamlist>
|
|
<type>auto</type>
|
|
<definition>auto serif::utils::dependencies::time_graph_nodes</definition>
|
|
<argsstring>(GraphTiming &timing, Clock clock={})</argsstring>
|
|
<name>time_graph_nodes</name>
|
|
<qualifiedname>serif::utils::dependencies::time_graph_nodes</qualifiedname>
|
|
<param>
|
|
<type><ref refid="classserif_1_1utils_1_1dependencies_1_1_graph_timing" kindref="compound">GraphTiming</ref> &</type>
|
|
<declname>timing</declname>
|
|
</param>
|
|
<param>
|
|
<type>Clock</type>
|
|
<declname>clock</declname>
|
|
<defval>{}</defval>
|
|
</param>
|
|
<briefdescription>
|
|
<para>Opt into node timings; a custom clock supports deterministic accounting tests without sleeps. </para>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
</detaileddescription>
|
|
<inbodydescription>
|
|
</inbodydescription>
|
|
<location file="src/include/serif/utils/dependencies/timing.hpp" line="124" column="11" bodyfile="src/include/serif/utils/dependencies/timing.hpp" bodystart="124" bodyend="126"/>
|
|
</memberdef>
|
|
</sectiondef>
|
|
<briefdescription>
|
|
</briefdescription>
|
|
<detaileddescription>
|
|
<para><emphasis>Computational Graphs</emphasis></para>
|
|
<para>Demonstration code for how to use the SERiF computational graph system The broad idea here is that there are many calculations which depend on each other but which may not necessarily always need to be recomputed just because another part of the model has changed. We model this as a combination of an acyclic computational graph, defined at compile time, and a runtime cache of values. The general workflow is that a developer defines the "context" of the computational graph, think of this as all of the inputs to the graph, or maybe more specifically, anything that could change due to some external event (e.g. a time step, a newton step, etc...) This context is probably the most CS intensive part of this code as the developer needs to think about lifetimes and ownership.</para>
|
|
<para><bold>Context</bold> Contexts are made with the make_dependency_context function, this accepts a variadic pack of bindings between a type and a runtime value. You can generate these yourself using the binding functions and types; however, we provide two convenience wrappers which generally developers should consider using.<itemizedlist>
|
|
<listitem><para>borrow: Used to bind a type to a reference to a value. This is useful for values which are owned by the caller and which the caller will manage the lifetime of (takes an lvalue).</para>
|
|
</listitem><listitem><para>own: Used to bind a type to a value which is owned by the context (copies an lvalue or moves an rvalue) Each of these functions accepts a type as a template parameter and a runtime value as an argument. The type is used as an ID, this is key to understand, if we write <programlisting filename=".cpp"><codeline><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceserif_1_1utils_1_1dependencies" kindref="compound">serif::utils::dependencies</ref>;</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x{1.0};</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>context<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab0cfd959e8c00f5e1641f26798333972" kindref="member">make_dependency_context</ref>(<ref refid="namespaceserif_1_1utils_1_1dependencies_1abdacec2dea2bb64ecda1946529961565" kindref="member">borrow<keys::Input></ref>(x));</highlight></codeline>
|
|
</programlisting></para>
|
|
</listitem></itemizedlist>
|
|
</para>
|
|
<para>we are not saying that x is of type <ref refid="structserif_1_1utils_1_1dependencies_1_1keys_1_1_input" kindref="compound">keys::Input</ref>, this is clearly not the case. Rather, we are registering in the computational graph a binding between the type <ref refid="structserif_1_1utils_1_1dependencies_1_1keys_1_1_input" kindref="compound">keys::Input</ref> and the runtime value x. Think of this as naming the various inputs to the graph.</para>
|
|
<para><bold>Computations</bold> After defining a context we can define a computation, each computation defines a node, while its ordered input keys define the incoming edges. Consider the following example (assuming the context from above):</para>
|
|
<para><programlisting filename=".cpp"><codeline><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1a70e11340fa044443fefa79ba7e0c11d5" kindref="member">make_computation<keys::Output, InputList<keys::Input></ref>>(</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/>[](</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>_x)<sp/>-><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>_x<sp/>*<sp/>_x;</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/>}</highlight></codeline>
|
|
<codeline><highlight class="normal">);</highlight></codeline>
|
|
</programlisting></para>
|
|
<para>what we have defined here is a node which takes a single input tagged <ref refid="structserif_1_1utils_1_1dependencies_1_1keys_1_1_input" kindref="compound">keys::Input</ref> and produces an output tagged as <ref refid="structserif_1_1utils_1_1dependencies_1_1keys_1_1_output" kindref="compound">keys::Output</ref>. The input key declares an edge from that source to this node. Other nodes can use <ref refid="structserif_1_1utils_1_1dependencies_1_1keys_1_1_output" kindref="compound">keys::Output</ref> as an input, and a successfully prepared result can be read with get or retained with share. These connections allow us to form a larger graph. Consider now the following code</para>
|
|
<para><programlisting filename=".cpp"><codeline><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceserif_1_1utils_1_1dependencies" kindref="compound">serif::utils::dependencies</ref>;</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">tags<sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">X{};</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">Y{};</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">Output1{};</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">Output2{};</highlight></codeline>
|
|
<codeline><highlight class="normal">};</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>x{1.0};</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>y{2.0};</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>context<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab0cfd959e8c00f5e1641f26798333972" kindref="member">make_dependency_context</ref>(<ref refid="namespaceserif_1_1utils_1_1dependencies_1abdacec2dea2bb64ecda1946529961565" kindref="member">borrow<tags::X></ref>(x),<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1abdacec2dea2bb64ecda1946529961565" kindref="member">borrow<tags::Y></ref>(y));</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func1<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1a70e11340fa044443fefa79ba7e0c11d5" kindref="member">make_computation<tags::Output1, InputList<tags::X></ref>>(</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>[](</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>_x)<sp/>-><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>_x<sp/>*<sp/>_x;</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline><highlight class="normal">);</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func2<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1a70e11340fa044443fefa79ba7e0c11d5" kindref="member">make_computation<tags::Output2, InputList<tags::Output1, tags::Y></ref>>(</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/>[](</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>_x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>_y)<sp/>-><sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>_x<sp/>+<sp/>_y;</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline><highlight class="normal">);</highlight></codeline>
|
|
</programlisting></para>
|
|
<para>we have now defined two computations, the first takes a single input, whichever input is tagged as tags::X and produces an output tagged as tags::Output1. The second computation takes two inputs, the first is the output of the first computation (lookup by the tag) and the second is whichever input is tagged as tags::Y, and produces an output tagged as tags::Output2. Note that the order of arguments to the lambda must be the same as the order of the tags in the <ref refid="namespaceserif_1_1utils_1_1dependencies_1a22eef682b02dad9de4774e4b68b003ba" kindref="member">InputList</ref>, the dependencies module will automatically order arguments based on the <ref refid="namespaceserif_1_1utils_1_1dependencies_1a22eef682b02dad9de4774e4b68b003ba" kindref="member">InputList</ref>. There is type checking to ensure that the types match, but if you have two inputs of the same type that are flipped there is no way for the system to inspect that and warn you. Further, depending on your compiler and flags there may be implicit casting between convertable types (e.g. int <-> double).</para>
|
|
<para><xrefsect id="todo_1_todo000045"><xreftitle>Todo</xreftitle><xrefdescription><para>We may want to remove the ability to have implicit casting between types, this is a bit of a footgun and may lead to subtle bugs.</para>
|
|
</xrefdescription></xrefsect></para>
|
|
<para><simplesect kind="note"><para>This is primary goal of this system, split computations into small pieces with the ability to cache intermediate results and reuse as many of those intermediate results as we can can prove is safe to do. The whole reason this system is so complex is that very purpose. There is a fundamental problem with high dimensional stellar models, they are always going to be slow, therefore we need to accept some degree of complexity in order to make them tractable.</para>
|
|
</simplesect>
|
|
<bold><ref refid="classserif_1_1utils_1_1dependencies_1_1_computation" kindref="compound">Computation</ref> Cache</bold> Once we have the computations we need to connect them together, generally use the helper function make_computation_cache which takes a context and a variadic pack of computations. There are <emphasis>a lot</emphasis> of compile time checks which run to ensure that the graph is valid, the context describes what is needed to compute the graph, and that each computation is valid. Generally if a static analysis error or compile error pops up here it probably means there is a mistake in the definition of the context or the computations. I've tried to make these errors as clear as possible; however, there is only so much that you can do with the C++ compiler. I recommend first checking, probably with a drawn-out diagram, that all the tags are correct and what you expect.</para>
|
|
<para>A developer can also choose to use the make_computation_graph function to explicitly name a graph. This is useful when naming or reusing a collection of computations (make_computation_cache calls make_computation_graph and then fixes the source types from the supplied context without retaining the context). Now consider the following code assuming the context and computations from above:</para>
|
|
<para><programlisting filename=".cpp"><codeline><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>graph_cache<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ad583eaa88367daf4af4d420047f24d38" kindref="member">make_computation_cache</ref>(context,<sp/>func1,<sp/>func2);</highlight></codeline>
|
|
</programlisting></para>
|
|
<para>At this point we have a cache which we can access various parts of; however, no computations have been run yet. To run a computation we must call try_prepare.</para>
|
|
<para>try_prepare returns std::expected: ordinary rejection is a value, and no candidate results or snapshots are published on failure. Exceptions from a callable or snapshot policy propagate with the same cache protection. Previously retained results remain valid, but get and share require a successful current preparation. Always check the report before reading results.</para>
|
|
<para>try_prepare takes the context and evaluates the requested nodes and their prerequisites, reusing unchanged results. By default every result is requested, so the first call evaluates the entire graph. <ref refid="namespaceserif_1_1utils_1_1dependencies_1a0674f826a11ecdab76236fa550cd88d5" kindref="member">RequestedResults</ref> can restrict evaluation to a branch.</para>
|
|
<para><programlisting filename=".cpp"><codeline><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>report<sp/>=<sp/>graph_cache.try_prepare(context);</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!report)<sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//<sp/>Handle<sp/>report.error()<sp/>before<sp/>reading<sp/>the<sp/>cache.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">}</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>func1_result<sp/>=<sp/>graph_cache.template<sp/>get<tags::Output1>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>func2_result<sp/>=<sp/>graph_cache.template<sp/>get<tags::Output2>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func1_status<sp/>=<sp/>report->template<sp/>status<tags::Output1>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func2_status<sp/>=<sp/>report->template<sp/>status<tags::Output2>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::string_view<sp/>func1_status_string<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab3b86a8b49e4a73b04c3fa547b45f8b2" kindref="member">preparation_status_name_map</ref>[func1_status];<sp/></highlight><highlight class="comment">//<sp/>note<sp/>this<sp/>is<sp/>an<sp/>inline<sp/>map<sp/>defined<sp/>in<sp/>serif::utils::dependencies</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::string_view<sp/>func2_status_string<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab3b86a8b49e4a73b04c3fa547b45f8b2" kindref="member">preparation_status_name_map</ref>[func2_status];</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::println(</highlight><highlight class="stringliteral">"Func1<sp/>Result:<sp/>{},<sp/>Func2<sp/>Result:<sp/>{},<sp/>Func1<sp/>Status:<sp/>{},<sp/>Func2<sp/>Status:<sp/>{}"</highlight><highlight class="normal">,<sp/>func1_result,<sp/>func2_result,<sp/>func1_status_string,<sp/>func2_status_string);</highlight></codeline>
|
|
</programlisting></para>
|
|
<para>Now what we could do is change only one part of the input context and call try_prepare again. Lets say we change only y, such that only func2 is stale.</para>
|
|
<para><programlisting filename=".cpp"><codeline><highlight class="normal">y<sp/>=<sp/>3.0;</highlight></codeline>
|
|
<codeline><highlight class="normal">report<sp/>=<sp/>graph_cache.try_prepare(context);</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!report)<sp/>{</highlight></codeline>
|
|
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;<sp/></highlight><highlight class="comment">//<sp/>Handle<sp/>report.error()<sp/>before<sp/>reading<sp/>the<sp/>cache.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">}</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>func1_result<sp/>=<sp/>graph_cache.template<sp/>get<tags::Output1>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>func2_result<sp/>=<sp/>graph_cache.template<sp/>get<tags::Output2>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func1_status<sp/>=<sp/>report->template<sp/>status<tags::Output1>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>func2_status<sp/>=<sp/>report->template<sp/>status<tags::Output2>();</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::string_view<sp/>func1_status_string<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab3b86a8b49e4a73b04c3fa547b45f8b2" kindref="member">preparation_status_name_map</ref>[func1_status];<sp/></highlight><highlight class="comment">//<sp/>note<sp/>this<sp/>is<sp/>an<sp/>inline<sp/>map<sp/>defined<sp/>in<sp/>serif::utils::dependencies</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::string_view<sp/>func2_status_string<sp/>=<sp/><ref refid="namespaceserif_1_1utils_1_1dependencies_1ab3b86a8b49e4a73b04c3fa547b45f8b2" kindref="member">preparation_status_name_map</ref>[func2_status];</highlight></codeline>
|
|
<codeline><highlight class="normal"></highlight></codeline>
|
|
<codeline><highlight class="normal">std::println(</highlight><highlight class="stringliteral">"Func1<sp/>Result:<sp/>{},<sp/>Func2<sp/>Result:<sp/>{},<sp/>Func1<sp/>Status:<sp/>{},<sp/>Func2<sp/>Status:<sp/>{}"</highlight><highlight class="normal">,<sp/>func1_result,<sp/>func2_result,<sp/>func1_status_string,<sp/>func2_status_string);</highlight></codeline>
|
|
</programlisting> </para>
|
|
</detaileddescription>
|
|
<location file="src/include/serif/utils/dependencies/binding.hpp" line="7" column="1"/>
|
|
</compounddef>
|
|
</doxygen>
|