docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
rpc_node_transform.h
Go to the documentation of this file.
1#pragma once
2#include <curl/curl.h>
3#include <nlohmann/json.hpp>
4#include <nlohmann/json_fwd.hpp>
5#include <string>
6#include <variant>
11
17
18namespace sdfg {
19namespace transformations {
20
22private:
24 std::string target_;
25 std::string category_;
26
28
29 std::unique_ptr<passes::rpc::RpcOptResponse> opt_resp_;
30
31 bool dump_steps_;
32
33 bool enable_fusion_;
34
35 bool normalize_;
36
37 bool schedule_loops_;
38
39 std::optional<std::string> session_id_;
40
41 std::string get_node_id_str() const;
42
43 std::variant<std::unique_ptr<passes::rpc::RpcOptResponse>, std::string>
44 query_rpc_server(passes::rpc::RpcOptRequest request, sdfg::passes::rpc::RpcContext& context);
45
46 void print_transformation_sequence(const nlohmann::json& sequence) const;
47
48public:
51 const std::string& target,
52 const std::string& category,
54 bool enable_fusion = true,
55 bool normalize = true,
56 bool schedule_loops = true,
57 bool print_steps = false
58 );
59
60 virtual std::string name() const override;
61
62 virtual bool can_be_applied(
64 ) override;
65
67 override;
68
69 passes::rpc::RpcOptResponse& applied_recipe() const { return *opt_resp_; }
70
71 void to_json(nlohmann::json& j) const override;
72
73 std::variant<std::unique_ptr<passes::rpc::RpcOptResponse>, std::string> parse_rpc_response(HttpResult result);
74};
75
76
77} // namespace transformations
78} // namespace sdfg
Definition analysis.h:53
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Definition rpc_context.h:11
Base class for all structured control flow nodes in a StructuredSDFG.
Definition control_flow_node.h:44
passes::rpc::RpcOptResponse & applied_recipe() const
Definition rpc_node_transform.h:69
virtual void apply(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager) override
Apply this transformation to the SDFG.
virtual bool can_be_applied(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager) override
Check if this transformation can be safely applied.
RPCNodeTransform(structured_control_flow::ControlFlowNode &node, const std::string &target, const std::string &category, sdfg::passes::rpc::RpcContext &rpc_context, bool enable_fusion=true, bool normalize=true, bool schedule_loops=true, bool print_steps=false)
std::variant< std::unique_ptr< passes::rpc::RpcOptResponse >, std::string > parse_rpc_response(HttpResult result)
void to_json(nlohmann::json &j) const override
Serialize this transformation to JSON.
virtual std::string name() const override
Get the name of this transformation.
Base class for all SDFG transformations.
Definition transformation.h:25
Definition function_builder.h:10
Definition loop_parallelization.h:8
Definition analysis.h:7
Definition utils_curl.h:6
Definition rpc_responses.h:45
Definition rpc_responses.h:37