• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / sdfglib / 15498944586

06 Jun 2025 08:12PM UTC coverage: 57.303% (-0.001%) from 57.304%
15498944586

Pull #61

github

web-flow
Merge 6adc89d23 into 0d30a6866
Pull Request #61: Copy

57 of 111 new or added lines in 16 files covered. (51.35%)

2 existing lines in 1 file now uncovered.

7584 of 13235 relevant lines covered (57.3%)

116.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.59
/src/serializer/json_serializer.cpp
1
#include "sdfg/serializer/json_serializer.h"
2

3
#include <cassert>
4
#include <memory>
5
#include <unordered_map>
6
#include <utility>
7
#include <vector>
8

9
#include "sdfg/builder/structured_sdfg_builder.h"
10
#include "sdfg/data_flow/library_node.h"
11
#include "sdfg/element.h"
12
#include "sdfg/structured_control_flow/block.h"
13
#include "sdfg/structured_control_flow/for.h"
14
#include "sdfg/structured_control_flow/if_else.h"
15
#include "sdfg/structured_control_flow/return.h"
16
#include "sdfg/structured_control_flow/sequence.h"
17
#include "sdfg/structured_control_flow/while.h"
18
#include "sdfg/structured_sdfg.h"
19
#include "sdfg/symbolic/symbolic.h"
20
#include "sdfg/types/function.h"
21
#include "sdfg/types/scalar.h"
22
#include "sdfg/types/type.h"
23
#include "symengine/expression.h"
24
#include "symengine/logic.h"
25
#include "symengine/symengine_rcp.h"
26

27
namespace sdfg {
28
namespace serializer {
29

30
/*
31
 * * JSONSerializer class
32
 * * Serialization logic
33
 */
34

35
nlohmann::json JSONSerializer::serialize(std::unique_ptr<sdfg::StructuredSDFG>& sdfg) {
3✔
36
    nlohmann::json j;
3✔
37

38
    j["name"] = sdfg->name();
3✔
39
    j["type"] = sdfg->type();
3✔
40

41
    j["structures"] = nlohmann::json::array();
3✔
42
    for (const auto& structure_name : sdfg->structures()) {
3✔
43
        const auto& structure = sdfg->structure(structure_name);
×
44
        nlohmann::json structure_json;
×
45
        structure_definition_to_json(structure_json, structure);
×
46
        j["structures"].push_back(structure_json);
×
47
    }
×
48

49
    j["containers"] = nlohmann::json::object();
3✔
50
    for (const auto& container : sdfg->containers()) {
8✔
51
        nlohmann::json desc;
5✔
52
        type_to_json(desc, sdfg->type(container));
5✔
53
        j["containers"][container] = desc;
5✔
54
    }
5✔
55

56
    j["arguments"] = nlohmann::json::array();
3✔
57
    for (const auto& argument : sdfg->arguments()) {
5✔
58
        j["arguments"].push_back(argument);
2✔
59
    }
60

61
    j["externals"] = nlohmann::json::array();
3✔
62
    for (const auto& external : sdfg->externals()) {
3✔
63
        j["externals"].push_back(external);
×
64
    }
65

66
    j["metadata"] = nlohmann::json::object();
3✔
67
    for (const auto& entry : sdfg->metadata()) {
4✔
68
        j["metadata"][entry.first] = entry.second;
1✔
69
    }
70

71
    // Walk the SDFG
72
    nlohmann::json root_json;
3✔
73
    sequence_to_json(root_json, sdfg->root());
3✔
74
    j["root"] = root_json;
3✔
75

76
    return j;
3✔
77
}
3✔
78

79
void JSONSerializer::dataflow_to_json(nlohmann::json& j, const data_flow::DataFlowGraph& dataflow) {
20✔
80
    j["type"] = "dataflow";
20✔
81
    j["nodes"] = nlohmann::json::array();
20✔
82
    j["edges"] = nlohmann::json::array();
20✔
83

84
    for (auto& node : dataflow.nodes()) {
40✔
85
        nlohmann::json node_json;
20✔
86
        node_json["element_id"] = node.element_id();
20✔
87

88
        node_json["debug_info"] = nlohmann::json::object();
20✔
89
        debug_info_to_json(node_json["debug_info"], node.debug_info());
20✔
90

91
        if (auto tasklet = dynamic_cast<const data_flow::Tasklet*>(&node)) {
20✔
92
            node_json["type"] = "tasklet";
5✔
93
            node_json["code"] = tasklet->code();
5✔
94
            node_json["inputs"] = nlohmann::json::array();
5✔
95
            for (auto& input : tasklet->inputs()) {
15✔
96
                nlohmann::json input_json;
10✔
97
                nlohmann::json type_json;
10✔
98
                type_to_json(type_json, input.second);
10✔
99
                input_json["type"] = type_json;
10✔
100
                input_json["name"] = input.first;
10✔
101
                node_json["inputs"].push_back(input_json);
10✔
102
            }
10✔
103
            node_json["output"] = nlohmann::json::object();
5✔
104
            node_json["output"]["name"] = tasklet->output().first;
5✔
105
            nlohmann::json type_json;
5✔
106
            type_to_json(type_json, tasklet->output().second);
5✔
107
            node_json["output"]["type"] = type_json;
5✔
108
            // node_json["conditional"] = tasklet->is_conditional();
109
            // if (tasklet->is_conditional()) {
110
            //     node_json["condition"] = dumps_expression(tasklet->condition());
111
            // }
112
        } else if (auto lib_node = dynamic_cast<const data_flow::LibraryNode*>(&node)) {
20✔
113
            node_json["type"] = "library_node";
×
NEW
114
            node_json["code"] = lib_node->code();
×
NEW
115
            node_json["side_effect"] = lib_node->side_effect();
×
116
            node_json["inputs"] = nlohmann::json::array();
×
117
            for (auto& input : lib_node->inputs()) {
×
NEW
118
                node_json["inputs"].push_back(input);
×
119
            }
120
            node_json["outputs"] = nlohmann::json::array();
×
121
            for (auto& output : lib_node->outputs()) {
×
NEW
122
                node_json["outputs"].push_back(output);
×
123
            }
124
        } else if (auto code_node = dynamic_cast<const data_flow::AccessNode*>(&node)) {
15✔
125
            node_json["type"] = "access_node";
15✔
126
            node_json["data"] = code_node->data();
15✔
127
        } else {
15✔
128
            throw std::runtime_error("Unknown node type");
×
129
        }
130

131
        j["nodes"].push_back(node_json);
20✔
132
    }
20✔
133

134
    for (auto& edge : dataflow.edges()) {
35✔
135
        nlohmann::json edge_json;
15✔
136
        edge_json["element_id"] = edge.element_id();
15✔
137

138
        edge_json["debug_info"] = nlohmann::json::object();
15✔
139
        debug_info_to_json(edge_json["debug_info"], edge.debug_info());
15✔
140

141
        edge_json["src"] = edge.src().element_id();
15✔
142
        edge_json["dst"] = edge.dst().element_id();
15✔
143

144
        edge_json["src_conn"] = edge.src_conn();
15✔
145
        edge_json["dst_conn"] = edge.dst_conn();
15✔
146

147
        edge_json["subset"] = nlohmann::json::array();
15✔
148
        for (auto& subset : edge.subset()) {
21✔
149
            edge_json["subset"].push_back(expression(subset));
6✔
150
        }
151

152
        j["edges"].push_back(edge_json);
15✔
153
    }
15✔
154
}
20✔
155

156
void JSONSerializer::block_to_json(nlohmann::json& j, const structured_control_flow::Block& block) {
18✔
157
    j["type"] = "block";
18✔
158
    j["element_id"] = block.element_id();
18✔
159

160
    j["debug_info"] = nlohmann::json::object();
18✔
161
    debug_info_to_json(j["debug_info"], block.debug_info());
18✔
162

163
    nlohmann::json dataflow_json;
18✔
164
    dataflow_to_json(dataflow_json, block.dataflow());
18✔
165
    j["dataflow"] = dataflow_json;
18✔
166
}
18✔
167

168
void JSONSerializer::for_to_json(nlohmann::json& j, const structured_control_flow::For& for_node) {
2✔
169
    j["type"] = "for";
2✔
170
    j["element_id"] = for_node.element_id();
2✔
171

172
    j["debug_info"] = nlohmann::json::object();
2✔
173
    debug_info_to_json(j["debug_info"], for_node.debug_info());
2✔
174

175
    j["indvar"] = expression(for_node.indvar());
2✔
176
    j["init"] = expression(for_node.init());
2✔
177
    j["condition"] = expression(for_node.condition());
2✔
178
    j["update"] = expression(for_node.update());
2✔
179

180
    nlohmann::json body_json;
2✔
181
    sequence_to_json(body_json, for_node.root());
2✔
182
    j["root"] = body_json;
2✔
183
}
2✔
184

185
void JSONSerializer::if_else_to_json(nlohmann::json& j,
2✔
186
                                     const structured_control_flow::IfElse& if_else_node) {
187
    j["type"] = "if_else";
2✔
188
    j["element_id"] = if_else_node.element_id();
2✔
189

190
    j["debug_info"] = nlohmann::json::object();
2✔
191
    debug_info_to_json(j["debug_info"], if_else_node.debug_info());
2✔
192

193
    j["branches"] = nlohmann::json::array();
2✔
194
    for (size_t i = 0; i < if_else_node.size(); i++) {
6✔
195
        nlohmann::json branch_json;
4✔
196
        branch_json["condition"] = expression(if_else_node.at(i).second);
4✔
197
        nlohmann::json body_json;
4✔
198
        sequence_to_json(body_json, if_else_node.at(i).first);
4✔
199
        branch_json["root"] = body_json;
4✔
200
        j["branches"].push_back(branch_json);
4✔
201
    }
4✔
202
}
2✔
203

204
void JSONSerializer::while_node_to_json(nlohmann::json& j,
5✔
205
                                        const structured_control_flow::While& while_node) {
206
    j["type"] = "while";
5✔
207
    j["element_id"] = while_node.element_id();
5✔
208

209
    j["debug_info"] = nlohmann::json::object();
5✔
210
    debug_info_to_json(j["debug_info"], while_node.debug_info());
5✔
211

212
    nlohmann::json body_json;
5✔
213
    sequence_to_json(body_json, while_node.root());
5✔
214
    j["root"] = body_json;
5✔
215
}
5✔
216

217
void JSONSerializer::break_node_to_json(nlohmann::json& j,
2✔
218
                                        const structured_control_flow::Break& break_node) {
219
    j["type"] = "break";
2✔
220
    j["element_id"] = break_node.element_id();
2✔
221

222
    j["debug_info"] = nlohmann::json::object();
2✔
223
    debug_info_to_json(j["debug_info"], break_node.debug_info());
2✔
224
}
2✔
225

226
void JSONSerializer::continue_node_to_json(nlohmann::json& j,
2✔
227
                                           const structured_control_flow::Continue& continue_node) {
228
    j["type"] = "continue";
2✔
229
    j["element_id"] = continue_node.element_id();
2✔
230

231
    j["debug_info"] = nlohmann::json::object();
2✔
232
    debug_info_to_json(j["debug_info"], continue_node.debug_info());
2✔
233
}
2✔
234

235
void JSONSerializer::map_to_json(nlohmann::json& j, const structured_control_flow::Map& map_node) {
2✔
236
    j["type"] = "map";
2✔
237
    j["element_id"] = map_node.element_id();
2✔
238

239
    j["debug_info"] = nlohmann::json::object();
2✔
240
    debug_info_to_json(j["debug_info"], map_node.debug_info());
2✔
241

242
    j["indvar"] = expression(map_node.indvar());
2✔
243
    j["num_iterations"] = expression(map_node.num_iterations());
2✔
244
    nlohmann::json body_json;
2✔
245
    sequence_to_json(body_json, map_node.root());
2✔
246
    j["root"] = body_json;
2✔
247
}
2✔
248

249
void JSONSerializer::return_node_to_json(nlohmann::json& j,
2✔
250
                                         const structured_control_flow::Return& return_node) {
251
    j["type"] = "return";
2✔
252
    j["element_id"] = return_node.element_id();
2✔
253

254
    j["debug_info"] = nlohmann::json::object();
2✔
255
    debug_info_to_json(j["debug_info"], return_node.debug_info());
2✔
256
}
2✔
257

258
void JSONSerializer::sequence_to_json(nlohmann::json& j,
19✔
259
                                      const structured_control_flow::Sequence& sequence) {
260
    j["type"] = "sequence";
19✔
261
    j["element_id"] = sequence.element_id();
19✔
262

263
    j["debug_info"] = nlohmann::json::object();
19✔
264
    debug_info_to_json(j["debug_info"], sequence.debug_info());
19✔
265

266
    j["children"] = nlohmann::json::array();
19✔
267
    j["transitions"] = nlohmann::json::array();
19✔
268

269
    for (size_t i = 0; i < sequence.size(); i++) {
39✔
270
        nlohmann::json child_json;
20✔
271
        auto& child = sequence.at(i).first;
20✔
272
        auto& transition = sequence.at(i).second;
20✔
273

274
        if (auto block = dynamic_cast<const structured_control_flow::Block*>(&child)) {
20✔
275
            block_to_json(child_json, *block);
16✔
276
        } else if (auto for_node = dynamic_cast<const structured_control_flow::For*>(&child)) {
20✔
277
            for_to_json(child_json, *for_node);
×
278
        } else if (auto sequence_node =
4✔
279
                       dynamic_cast<const structured_control_flow::Sequence*>(&child)) {
4✔
280
            sequence_to_json(child_json, *sequence_node);
×
281
        } else if (auto condition_node =
4✔
282
                       dynamic_cast<const structured_control_flow::IfElse*>(&child)) {
4✔
283
            if_else_to_json(child_json, *condition_node);
×
284
        } else if (auto while_node = dynamic_cast<const structured_control_flow::While*>(&child)) {
4✔
285
            while_node_to_json(child_json, *while_node);
×
286
        } else if (auto return_node =
4✔
287
                       dynamic_cast<const structured_control_flow::Return*>(&child)) {
4✔
288
            return_node_to_json(child_json, *return_node);
×
289
        } else if (auto break_node = dynamic_cast<const structured_control_flow::Break*>(&child)) {
4✔
290
            break_node_to_json(child_json, *break_node);
2✔
291
        } else if (auto continue_node =
4✔
292
                       dynamic_cast<const structured_control_flow::Continue*>(&child)) {
2✔
293
            continue_node_to_json(child_json, *continue_node);
2✔
294
        } else if (auto map_node = dynamic_cast<const structured_control_flow::Map*>(&child)) {
2✔
295
            map_to_json(child_json, *map_node);
×
296
        } else {
×
297
            throw std::runtime_error("Unknown child type");
×
298
        }
299

300
        j["children"].push_back(child_json);
20✔
301

302
        // Add transition information
303
        nlohmann::json transition_json;
20✔
304
        transition_json["type"] = "transition";
20✔
305
        transition_json["element_id"] = transition.element_id();
20✔
306

307
        transition_json["debug_info"] = nlohmann::json::object();
20✔
308
        debug_info_to_json(transition_json["debug_info"], transition.debug_info());
20✔
309

310
        transition_json["assignments"] = nlohmann::json::array();
20✔
311
        for (const auto& assignment : transition.assignments()) {
22✔
312
            nlohmann::json assignment_json;
2✔
313
            assignment_json["symbol"] = expression(assignment.first);
2✔
314
            assignment_json["expression"] = expression(assignment.second);
2✔
315
            transition_json["assignments"].push_back(assignment_json);
2✔
316
        }
2✔
317

318
        j["transitions"].push_back(transition_json);
20✔
319
    }
20✔
320
}
19✔
321

322
void JSONSerializer::type_to_json(nlohmann::json& j, const types::IType& type) {
43✔
323
    if (auto scalar_type = dynamic_cast<const types::Scalar*>(&type)) {
43✔
324
        j["type"] = "scalar";
33✔
325
        j["primitive_type"] = scalar_type->primitive_type();
33✔
326
        j["storage_type"] = scalar_type->storage_type();
33✔
327
        j["initializer"] = scalar_type->initializer();
33✔
328
        j["alignment"] = scalar_type->alignment();
33✔
329
    } else if (auto array_type = dynamic_cast<const types::Array*>(&type)) {
43✔
330
        j["type"] = "array";
3✔
331
        nlohmann::json element_type_json;
3✔
332
        type_to_json(element_type_json, array_type->element_type());
3✔
333
        j["element_type"] = element_type_json;
3✔
334
        j["num_elements"] = expression(array_type->num_elements());
3✔
335
        j["storage_type"] = array_type->storage_type();
3✔
336
        j["initializer"] = array_type->initializer();
3✔
337
        j["alignment"] = array_type->alignment();
3✔
338
    } else if (auto pointer_type = dynamic_cast<const types::Pointer*>(&type)) {
10✔
339
        j["type"] = "pointer";
3✔
340
        nlohmann::json pointee_type_json;
3✔
341
        type_to_json(pointee_type_json, pointer_type->pointee_type());
3✔
342
        j["pointee_type"] = pointee_type_json;
3✔
343
        j["storage_type"] = pointer_type->storage_type();
3✔
344
        j["initializer"] = pointer_type->initializer();
3✔
345
        j["alignment"] = pointer_type->alignment();
3✔
346
    } else if (auto structure_type = dynamic_cast<const types::Structure*>(&type)) {
7✔
347
        j["type"] = "structure";
2✔
348
        j["name"] = structure_type->name();
2✔
349
        j["storage_type"] = structure_type->storage_type();
2✔
350
        j["initializer"] = structure_type->initializer();
2✔
351
        j["alignment"] = structure_type->alignment();
2✔
352
    } else if (auto function_type = dynamic_cast<const types::Function*>(&type)) {
4✔
353
        j["type"] = "function";
2✔
354
        nlohmann::json return_type_json;
2✔
355
        type_to_json(return_type_json, function_type->return_type());
2✔
356
        j["return_type"] = return_type_json;
2✔
357
        j["params"] = nlohmann::json::array();
2✔
358
        for (size_t i = 0; i < function_type->num_params(); i++) {
5✔
359
            nlohmann::json param_json;
3✔
360
            type_to_json(param_json, function_type->param_type(symbolic::integer(i)));
3✔
361
            j["params"].push_back(param_json);
3✔
362
        }
3✔
363
        j["is_var_arg"] = function_type->is_var_arg();
2✔
364
        j["storage_type"] = function_type->storage_type();
2✔
365
        j["initializer"] = function_type->initializer();
2✔
366
        j["alignment"] = function_type->alignment();
2✔
367
    } else {
2✔
368
        throw std::runtime_error("Unknown type");
×
369
    }
370
}
43✔
371

372
void JSONSerializer::structure_definition_to_json(nlohmann::json& j,
1✔
373
                                                  const types::StructureDefinition& definition) {
374
    j["name"] = definition.name();
1✔
375
    j["members"] = nlohmann::json::array();
1✔
376
    for (size_t i = 0; i < definition.num_members(); i++) {
3✔
377
        nlohmann::json member_json;
2✔
378
        type_to_json(member_json, definition.member_type(symbolic::integer(i)));
2✔
379
        j["members"].push_back(member_json);
2✔
380
    }
2✔
381
    j["is_packed"] = definition.is_packed();
1✔
382
}
1✔
383

384
void JSONSerializer::debug_info_to_json(nlohmann::json& j, const DebugInfo& debug_info) {
109✔
385
    j["has"] = debug_info.has();
109✔
386
    j["filename"] = debug_info.filename();
109✔
387
    j["start_line"] = debug_info.start_line();
109✔
388
    j["start_column"] = debug_info.start_column();
109✔
389
    j["end_line"] = debug_info.end_line();
109✔
390
    j["end_column"] = debug_info.end_column();
109✔
391
}
109✔
392

393
/*
394
 * * Deserialization logic
395
 */
396

397
std::unique_ptr<StructuredSDFG> JSONSerializer::deserialize(nlohmann::json& j) {
3✔
398
    assert(j.contains("name"));
3✔
399
    assert(j["name"].is_string());
3✔
400
    assert(j.contains("type"));
3✔
401
    assert(j["type"].is_number_integer());
3✔
402

403
    builder::StructuredSDFGBuilder builder(j["name"], static_cast<FunctionType>(j["type"]));
3✔
404

405
    // deserialize structures
406
    assert(j.contains("structures"));
3✔
407
    assert(j["structures"].is_array());
3✔
408
    for (const auto& structure : j["structures"]) {
3✔
409
        assert(structure.contains("name"));
×
410
        assert(structure["name"].is_string());
×
411
        json_to_structure_definition(structure, builder);
×
412
    }
413

414
    nlohmann::json& containers = j["containers"];
3✔
415

416
    // deserialize externals
417
    for (const auto& name : j["externals"]) {
3✔
418
        auto& type_desc = containers.at(name.get<std::string>());
×
419
        auto type = json_to_type(type_desc);
×
420
        builder.add_container(name, *type, false, true);
×
421
    }
×
422

423
    // deserialize arguments
424
    for (const auto& name : j["arguments"]) {
5✔
425
        auto& type_desc = containers.at(name.get<std::string>());
2✔
426
        auto type = json_to_type(type_desc);
2✔
427
        builder.add_container(name, *type, true, false);
2✔
428
    }
2✔
429

430
    // deserialize transients
431
    for (const auto& entry : containers.items()) {
8✔
432
        if (builder.subject().is_argument(entry.key())) {
5✔
433
            continue;
2✔
434
        }
435
        if (builder.subject().is_external(entry.key())) {
3✔
436
            continue;
×
437
        }
438
        auto type = json_to_type(entry.value());
3✔
439
        builder.add_container(entry.key(), *type, false, false);
3✔
440
    }
3✔
441

442
    // deserialize root node
443
    assert(j.contains("root"));
3✔
444
    auto& root = builder.subject().root();
3✔
445
    json_to_sequence(j["root"], builder, root);
3✔
446

447
    // deserialize metadata
448
    assert(j.contains("metadata"));
3✔
449
    assert(j["metadata"].is_object());
3✔
450
    for (const auto& entry : j["metadata"].items()) {
4✔
451
        builder.subject().add_metadata(entry.key(), entry.value());
1✔
452
    }
453

454
    return builder.move();
3✔
455
}
3✔
456

457
void JSONSerializer::json_to_structure_definition(const nlohmann::json& j,
1✔
458
                                                  builder::StructuredSDFGBuilder& builder) {
459
    assert(j.contains("name"));
1✔
460
    assert(j["name"].is_string());
1✔
461
    assert(j.contains("members"));
1✔
462
    assert(j["members"].is_array());
1✔
463
    assert(j.contains("is_packed"));
1✔
464
    assert(j["is_packed"].is_boolean());
1✔
465
    auto is_packed = j["is_packed"];
1✔
466
    auto& definition = builder.add_structure(j["name"], is_packed);
1✔
467
    for (const auto& member : j["members"]) {
3✔
468
        nlohmann::json member_json;
2✔
469
        auto member_type = json_to_type(member);
2✔
470
        definition.add_member(*member_type);
2✔
471
    }
2✔
472
}
1✔
473

474
std::vector<std::pair<std::string, types::Scalar>> JSONSerializer::json_to_arguments(
4✔
475
    const nlohmann::json& j) {
476
    std::vector<std::pair<std::string, types::Scalar>> arguments;
4✔
477
    for (const auto& argument : j) {
12✔
478
        assert(argument.contains("name"));
8✔
479
        assert(argument["name"].is_string());
8✔
480
        assert(argument.contains("type"));
8✔
481
        assert(argument["type"].is_object());
8✔
482
        std::string name = argument["name"];
8✔
483
        auto type = json_to_type(argument["type"]);
8✔
484
        arguments.emplace_back(name, *dynamic_cast<types::Scalar*>(type.get()));
8✔
485
    }
8✔
486
    return arguments;
4✔
487
}
4✔
488

489
void JSONSerializer::json_to_dataflow(const nlohmann::json& j,
10✔
490
                                      builder::StructuredSDFGBuilder& builder,
491
                                      structured_control_flow::Block& parent) {
492
    std::unordered_map<std::string, data_flow::DataFlowNode&> nodes_map;
10✔
493

494
    assert(j.contains("nodes"));
10✔
495
    assert(j["nodes"].is_array());
10✔
496
    for (const auto& node : j["nodes"]) {
26✔
497
        assert(node.contains("type"));
16✔
498
        assert(node["type"].is_string());
16✔
499
        assert(node.contains("element_id"));
16✔
500
        assert(node["element_id"].is_string());
16✔
501
        std::string type = node["type"];
16✔
502
        if (type == "tasklet") {
16✔
503
            assert(node.contains("code"));
4✔
504
            assert(node["code"].is_number_integer());
4✔
505
            assert(node.contains("inputs"));
4✔
506
            assert(node["inputs"].is_array());
4✔
507
            assert(node.contains("output"));
4✔
508
            assert(node["output"].is_object());
4✔
509
            assert(node["output"].contains("name"));
4✔
510
            assert(node["output"].contains("type"));
4✔
511
            auto inputs = json_to_arguments(node["inputs"]);
4✔
512

513
            auto output_name = node["output"]["name"];
4✔
514
            auto output_type = json_to_type(node["output"]["type"]);
4✔
515
            auto& output_type_scalar = dynamic_cast<types::Scalar&>(*output_type);
4✔
516

517
            auto& tasklet =
4✔
518
                builder.add_tasklet(parent, node["code"], {output_name, output_type_scalar}, inputs,
8✔
519
                                    json_to_debug_info(node["debug_info"]));
4✔
520
            tasklet.element_id_ = node["element_id"];
4✔
521
            nodes_map.insert({node["element_id"], tasklet});
4✔
522
        } else if (type == "library_node") {
16✔
NEW
523
            assert(node.contains("code"));
×
524
            assert(node.contains("inputs"));
×
525
            assert(node["inputs"].is_array());
×
526
            assert(node.contains("outputs"));
×
527
            assert(node["outputs"].is_array());
×
NEW
528
            std::vector<std::string> outputs;
×
NEW
529
            for (const auto& output : node["outputs"]) {
×
NEW
530
                assert(output.is_string());
×
NEW
531
                outputs.push_back(output);
×
532
            }
NEW
533
            std::vector<std::string> inputs;
×
NEW
534
            for (const auto& input : node["inputs"]) {
×
NEW
535
                assert(input.is_string());
×
NEW
536
                inputs.push_back(input);
×
537
            }
NEW
538
            auto& lib_node =
×
NEW
539
                builder.add_library_node(parent, node["code"], outputs, inputs, node["side_effect"],
×
NEW
540
                                         json_to_debug_info(node["debug_info"]));
×
541
            lib_node.element_id_ = node["element_id"];
×
542
            nodes_map.insert({node["element_id"], lib_node});
×
543
        } else if (type == "access_node") {
12✔
544
            assert(node.contains("data"));
12✔
545
            auto& access_node =
12✔
546
                builder.add_access(parent, node["data"], json_to_debug_info(node["debug_info"]));
12✔
547
            access_node.element_id_ = node["element_id"];
12✔
548
            nodes_map.insert({node["element_id"], access_node});
12✔
549
        } else {
12✔
550
            throw std::runtime_error("Unknown node type");
×
551
        }
552
    }
16✔
553

554
    assert(j.contains("edges"));
10✔
555
    assert(j["edges"].is_array());
10✔
556
    for (const auto& edge : j["edges"]) {
22✔
557
        assert(edge.contains("src"));
12✔
558
        assert(edge["src"].is_string());
12✔
559
        assert(edge.contains("dst"));
12✔
560
        assert(edge["dst"].is_string());
12✔
561
        assert(edge.contains("src_conn"));
12✔
562
        assert(edge["src_conn"].is_string());
12✔
563
        assert(edge.contains("dst_conn"));
12✔
564
        assert(edge["dst_conn"].is_string());
12✔
565
        assert(edge.contains("subset"));
12✔
566
        assert(edge["subset"].is_array());
12✔
567

568
        assert(nodes_map.find(edge["src"]) != nodes_map.end());
12✔
569
        assert(nodes_map.find(edge["dst"]) != nodes_map.end());
12✔
570
        auto& source = nodes_map.at(edge["src"]);
12✔
571
        auto& target = nodes_map.at(edge["dst"]);
12✔
572

573
        assert(edge.contains("subset"));
12✔
574
        assert(edge["subset"].is_array());
12✔
575
        std::vector<symbolic::Expression> subset;
12✔
576
        for (const auto& subset_str : edge["subset"]) {
16✔
577
            assert(subset_str.is_string());
4✔
578
            SymEngine::Expression subset_expr(subset_str);
4✔
579
            subset.push_back(subset_expr);
4✔
580
        }
4✔
581
        auto& memlet =
12✔
582
            builder.add_memlet(parent, source, edge["src_conn"], target, edge["dst_conn"], subset,
24✔
583
                               json_to_debug_info(edge["debug_info"]));
12✔
584
        memlet.element_id_ = edge["element_id"];
12✔
585
    }
12✔
586
}
10✔
587

588
void JSONSerializer::json_to_sequence(const nlohmann::json& j,
12✔
589
                                      builder::StructuredSDFGBuilder& builder,
590
                                      structured_control_flow::Sequence& sequence) {
591
    assert(j.contains("type"));
12✔
592
    assert(j["type"].is_string());
12✔
593
    assert(j.contains("children"));
12✔
594
    assert(j["children"].is_array());
12✔
595
    assert(j.contains("transitions"));
12✔
596
    assert(j["transitions"].is_array());
12✔
597
    assert(j["transitions"].size() == j["children"].size());
12✔
598

599
    sequence.element_id_ = j["element_id"];
12✔
600
    sequence.debug_info_ = json_to_debug_info(j["debug_info"]);
12✔
601

602
    std::string type = j["type"];
12✔
603
    if (type == "sequence") {
12✔
604
        for (size_t i = 0; i < j["children"].size(); i++) {
22✔
605
            auto& child = j["children"][i];
10✔
606
            auto& transition = j["transitions"][i];
10✔
607
            assert(child.contains("type"));
10✔
608
            assert(child["type"].is_string());
10✔
609

610
            assert(transition.contains("type"));
10✔
611
            assert(transition["type"].is_string());
10✔
612
            assert(transition.contains("assignments"));
10✔
613
            assert(transition["assignments"].is_array());
10✔
614
            symbolic::Assignments assignments;
10✔
615
            for (const auto& assignment : transition["assignments"]) {
11✔
616
                assert(assignment.contains("symbol"));
1✔
617
                assert(assignment["symbol"].is_string());
1✔
618
                assert(assignment.contains("expression"));
1✔
619
                assert(assignment["expression"].is_string());
1✔
620
                SymEngine::Expression expr(assignment["expression"]);
1✔
621
                assignments.insert({symbolic::symbol(assignment["symbol"]), expr});
1✔
622
            }
1✔
623

624
            if (child["type"] == "block") {
10✔
625
                json_to_block_node(child, builder, sequence, assignments);
8✔
626
            } else if (child["type"] == "for") {
10✔
627
                json_to_for_node(child, builder, sequence, assignments);
×
628
            } else if (child["type"] == "if_else") {
2✔
629
                json_to_if_else_node(child, builder, sequence, assignments);
×
630
            } else if (child["type"] == "while") {
2✔
631
                json_to_while_node(child, builder, sequence, assignments);
×
632
            } else if (child["type"] == "break") {
2✔
633
                json_to_break_node(child, builder, sequence, assignments);
1✔
634
            } else if (child["type"] == "continue") {
2✔
635
                json_to_continue_node(child, builder, sequence, assignments);
1✔
636
            } else if (child["type"] == "return") {
1✔
637
                json_to_return_node(child, builder, sequence, assignments);
×
638
            } else if (child["type"] == "map") {
×
639
                json_to_map_node(child, builder, sequence, assignments);
×
640
            } else if (child["type"] == "sequence") {
×
641
                auto& subseq = builder.add_sequence(sequence, assignments,
×
642
                                                    json_to_debug_info(child["debug_info"]));
×
643
                json_to_sequence(child, builder, subseq);
×
644
            } else {
×
645
                throw std::runtime_error("Unknown child type");
×
646
            }
647

648
            sequence.at(i).second.debug_info_ = json_to_debug_info(transition["debug_info"]);
10✔
649
            sequence.at(i).second.element_id_ = transition["element_id"];
10✔
650
        }
10✔
651
    } else {
12✔
652
        throw std::runtime_error("expected sequence type");
×
653
    }
654
}
12✔
655

656
void JSONSerializer::json_to_block_node(const nlohmann::json& j,
9✔
657
                                        builder::StructuredSDFGBuilder& builder,
658
                                        structured_control_flow::Sequence& parent,
659
                                        symbolic::Assignments& assignments) {
660
    assert(j.contains("type"));
9✔
661
    assert(j["type"].is_string());
9✔
662
    assert(j.contains("dataflow"));
9✔
663
    assert(j["dataflow"].is_object());
9✔
664
    auto& block = builder.add_block(parent, assignments, json_to_debug_info(j["debug_info"]));
9✔
665
    block.element_id_ = j["element_id"];
9✔
666
    assert(j["dataflow"].contains("type"));
9✔
667
    assert(j["dataflow"]["type"].is_string());
9✔
668
    std::string type = j["dataflow"]["type"];
9✔
669
    if (type == "dataflow") {
9✔
670
        json_to_dataflow(j["dataflow"], builder, block);
9✔
671
    } else {
9✔
672
        throw std::runtime_error("Unknown dataflow type");
×
673
    }
674
}
9✔
675

676
void JSONSerializer::json_to_for_node(const nlohmann::json& j,
1✔
677
                                      builder::StructuredSDFGBuilder& builder,
678
                                      structured_control_flow::Sequence& parent,
679
                                      symbolic::Assignments& assignments) {
680
    assert(j.contains("type"));
1✔
681
    assert(j["type"].is_string());
1✔
682
    assert(j.contains("indvar"));
1✔
683
    assert(j["indvar"].is_string());
1✔
684
    assert(j.contains("init"));
1✔
685
    assert(j["init"].is_string());
1✔
686
    assert(j.contains("condition"));
1✔
687
    assert(j["condition"].is_string());
1✔
688
    assert(j.contains("update"));
1✔
689
    assert(j["update"].is_string());
1✔
690
    assert(j.contains("root"));
1✔
691
    assert(j["root"].is_object());
1✔
692

693
    symbolic::Symbol indvar = symbolic::symbol(j["indvar"]);
1✔
694
    SymEngine::Expression init(j["init"]);
1✔
695
    SymEngine::Expression condition_expr(j["condition"]);
1✔
696
    assert(!SymEngine::rcp_static_cast<const SymEngine::Boolean>(condition_expr.get_basic())
1✔
697
                .is_null());
698
    symbolic::Condition condition =
699
        SymEngine::rcp_static_cast<const SymEngine::Boolean>(condition_expr.get_basic());
1✔
700
    SymEngine::Expression update(j["update"]);
1✔
701
    auto& for_node = builder.add_for(parent, indvar, condition, init, update, assignments,
2✔
702
                                     json_to_debug_info(j["debug_info"]));
1✔
703
    for_node.element_id_ = j["element_id"];
1✔
704

705
    assert(j["root"].contains("type"));
1✔
706
    assert(j["root"]["type"].is_string());
1✔
707
    assert(j["root"]["type"] == "sequence");
1✔
708
    json_to_sequence(j["root"], builder, for_node.root());
1✔
709
}
1✔
710

711
void JSONSerializer::json_to_if_else_node(const nlohmann::json& j,
1✔
712
                                          builder::StructuredSDFGBuilder& builder,
713
                                          structured_control_flow::Sequence& parent,
714
                                          symbolic::Assignments& assignments) {
715
    assert(j.contains("type"));
1✔
716
    assert(j["type"].is_string());
1✔
717
    assert(j["type"] == "if_else");
1✔
718
    assert(j.contains("branches"));
1✔
719
    assert(j["branches"].is_array());
1✔
720
    auto& if_else_node =
1✔
721
        builder.add_if_else(parent, assignments, json_to_debug_info(j["debug_info"]));
1✔
722
    if_else_node.element_id_ = j["element_id"];
1✔
723
    for (const auto& branch : j["branches"]) {
3✔
724
        assert(branch.contains("condition"));
2✔
725
        assert(branch["condition"].is_string());
2✔
726
        assert(branch.contains("root"));
2✔
727
        assert(branch["root"].is_object());
2✔
728
        SymEngine::Expression condition_expr(branch["condition"]);
2✔
729
        assert(!SymEngine::rcp_static_cast<const SymEngine::Boolean>(condition_expr.get_basic())
2✔
730
                    .is_null());
731
        symbolic::Condition condition =
732
            SymEngine::rcp_static_cast<const SymEngine::Boolean>(condition_expr.get_basic());
2✔
733
        auto& branch_node = builder.add_case(if_else_node, condition);
2✔
734
        assert(branch["root"].contains("type"));
2✔
735
        assert(branch["root"]["type"].is_string());
2✔
736
        std::string type = branch["root"]["type"];
2✔
737
        if (type == "sequence") {
2✔
738
            json_to_sequence(branch["root"], builder, branch_node);
2✔
739
        } else {
2✔
740
            throw std::runtime_error("Unknown child type");
×
741
        }
742
    }
2✔
743
}
1✔
744

745
void JSONSerializer::json_to_while_node(const nlohmann::json& j,
3✔
746
                                        builder::StructuredSDFGBuilder& builder,
747
                                        structured_control_flow::Sequence& parent,
748
                                        symbolic::Assignments& assignments) {
749
    assert(j.contains("type"));
3✔
750
    assert(j["type"].is_string());
3✔
751
    assert(j["type"] == "while");
3✔
752
    assert(j.contains("root"));
3✔
753
    assert(j["root"].is_object());
3✔
754

755
    auto& while_node = builder.add_while(parent, assignments, json_to_debug_info(j["debug_info"]));
3✔
756
    while_node.element_id_ = j["element_id"];
3✔
757

758
    assert(j["root"]["type"] == "sequence");
3✔
759
    json_to_sequence(j["root"], builder, while_node.root());
3✔
760
}
3✔
761

762
void JSONSerializer::json_to_break_node(const nlohmann::json& j,
1✔
763
                                        builder::StructuredSDFGBuilder& builder,
764
                                        structured_control_flow::Sequence& parent,
765
                                        symbolic::Assignments& assignments) {
766
    assert(j.contains("type"));
1✔
767
    assert(j["type"].is_string());
1✔
768
    assert(j["type"] == "break");
1✔
769
    auto& node = builder.add_break(parent, assignments, json_to_debug_info(j["debug_info"]));
1✔
770
    node.element_id_ = j["element_id"];
1✔
771
}
1✔
772

773
void JSONSerializer::json_to_continue_node(const nlohmann::json& j,
1✔
774
                                           builder::StructuredSDFGBuilder& builder,
775
                                           structured_control_flow::Sequence& parent,
776
                                           symbolic::Assignments& assignments) {
777
    assert(j.contains("type"));
1✔
778
    assert(j["type"].is_string());
1✔
779
    assert(j["type"] == "continue");
1✔
780
    auto& node = builder.add_continue(parent, assignments, json_to_debug_info(j["debug_info"]));
1✔
781
    node.element_id_ = j["element_id"];
1✔
782
}
1✔
783

784
void JSONSerializer::json_to_map_node(const nlohmann::json& j,
1✔
785
                                      builder::StructuredSDFGBuilder& builder,
786
                                      structured_control_flow::Sequence& parent,
787
                                      symbolic::Assignments& assignments) {
788
    assert(j.contains("type"));
1✔
789
    assert(j["type"].is_string());
1✔
790
    assert(j["type"] == "map");
1✔
791
    assert(j.contains("indvar"));
1✔
792
    assert(j["indvar"].is_string());
1✔
793
    assert(j.contains("num_iterations"));
1✔
794
    assert(j["num_iterations"].is_string());
1✔
795
    assert(j.contains("root"));
1✔
796
    assert(j["root"].is_object());
1✔
797
    symbolic::Symbol indvar = symbolic::symbol(j["indvar"]);
1✔
798
    SymEngine::Expression num_iterations(j["num_iterations"]);
1✔
799

800
    auto& map_node = builder.add_map(parent, indvar, num_iterations, assignments,
2✔
801
                                     json_to_debug_info(j["debug_info"]));
1✔
802
    map_node.element_id_ = j["element_id"];
1✔
803

804
    assert(j["root"].contains("type"));
1✔
805
    assert(j["root"]["type"].is_string());
1✔
806
    assert(j["root"]["type"] == "sequence");
1✔
807
    json_to_sequence(j["root"], builder, map_node.root());
1✔
808
}
1✔
809

810
void JSONSerializer::json_to_return_node(const nlohmann::json& j,
1✔
811
                                         builder::StructuredSDFGBuilder& builder,
812
                                         structured_control_flow::Sequence& parent,
813
                                         symbolic::Assignments& assignments) {
814
    assert(j.contains("type"));
1✔
815
    assert(j["type"].is_string());
1✔
816
    assert(j["type"] == "return");
1✔
817

818
    auto& node = builder.add_return(parent, assignments, json_to_debug_info(j["debug_info"]));
1✔
819
    node.element_id_ = j["element_id"];
1✔
820
}
1✔
821

822
std::unique_ptr<types::IType> JSONSerializer::json_to_type(const nlohmann::json& j) {
31✔
823
    if (j.contains("type")) {
31✔
824
        if (j["type"] == "scalar") {
31✔
825
            // Deserialize scalar type
826
            assert(j.contains("primitive_type"));
25✔
827
            types::PrimitiveType primitive_type = j["primitive_type"];
25✔
828
            assert(j.contains("storage_type"));
25✔
829
            types::StorageType storage_type = j["storage_type"];
25✔
830
            ;
831
            assert(j.contains("initializer"));
25✔
832
            std::string initializer = j["initializer"];
25✔
833
            assert(j.contains("alignment"));
25✔
834
            size_t alignment = j["alignment"];
25✔
835
            return std::make_unique<types::Scalar>(storage_type, alignment, initializer,
25✔
836
                                                   primitive_type);
837
        } else if (j["type"] == "array") {
31✔
838
            // Deserialize array type
839
            assert(j.contains("element_type"));
2✔
840
            std::unique_ptr<types::IType> member_type = json_to_type(j["element_type"]);
2✔
841
            assert(j.contains("num_elements"));
2✔
842
            std::string num_elements_str = j["num_elements"];
2✔
843
            // Convert num_elements_str to symbolic::Expression
844
            SymEngine::Expression num_elements(num_elements_str);
2✔
845
            assert(j.contains("storage_type"));
2✔
846
            types::StorageType storage_type = j["storage_type"];
2✔
847
            assert(j.contains("initializer"));
2✔
848
            std::string initializer = j["initializer"];
2✔
849
            assert(j.contains("alignment"));
2✔
850
            size_t alignment = j["alignment"];
2✔
851
            return std::make_unique<types::Array>(storage_type, alignment, initializer,
2✔
852
                                                  *member_type, num_elements);
2✔
853
        } else if (j["type"] == "pointer") {
6✔
854
            // Deserialize pointer type
855
            assert(j.contains("pointee_type"));
2✔
856
            std::unique_ptr<types::IType> pointee_type = json_to_type(j["pointee_type"]);
2✔
857
            assert(j.contains("storage_type"));
2✔
858
            types::StorageType storage_type = j["storage_type"];
2✔
859
            assert(j.contains("initializer"));
2✔
860
            std::string initializer = j["initializer"];
2✔
861
            assert(j.contains("alignment"));
2✔
862
            size_t alignment = j["alignment"];
2✔
863
            return std::make_unique<types::Pointer>(storage_type, alignment, initializer,
2✔
864
                                                    *pointee_type);
2✔
865
        } else if (j["type"] == "structure") {
4✔
866
            // Deserialize structure type
867
            assert(j.contains("name"));
1✔
868
            std::string name = j["name"];
1✔
869
            assert(j.contains("storage_type"));
1✔
870
            types::StorageType storage_type = j["storage_type"];
1✔
871
            assert(j.contains("initializer"));
1✔
872
            std::string initializer = j["initializer"];
1✔
873
            assert(j.contains("alignment"));
1✔
874
            size_t alignment = j["alignment"];
1✔
875
            return std::make_unique<types::Structure>(storage_type, alignment, initializer, name);
1✔
876
        } else if (j["type"] == "function") {
2✔
877
            // Deserialize function type
878
            assert(j.contains("return_type"));
1✔
879
            std::unique_ptr<types::IType> return_type = json_to_type(j["return_type"]);
1✔
880
            assert(j.contains("params"));
1✔
881
            std::vector<std::unique_ptr<types::IType>> params;
1✔
882
            for (const auto& param : j["params"]) {
3✔
883
                params.push_back(json_to_type(param));
2✔
884
            }
885
            assert(j.contains("is_var_arg"));
1✔
886
            bool is_var_arg = j["is_var_arg"];
1✔
887
            assert(j.contains("storage_type"));
1✔
888
            types::StorageType storage_type = j["storage_type"];
1✔
889
            assert(j.contains("initializer"));
1✔
890
            std::string initializer = j["initializer"];
1✔
891
            assert(j.contains("alignment"));
1✔
892
            size_t alignment = j["alignment"];
1✔
893
            auto function = std::make_unique<types::Function>(storage_type, alignment, initializer,
1✔
894
                                                              *return_type, is_var_arg);
1✔
895
            for (const auto& param : params) {
3✔
896
                function->add_param(*param);
2✔
897
            }
898
            return function->clone();
1✔
899

900
        } else {
1✔
901
            throw std::runtime_error("Unknown type");
×
902
        }
903
    } else {
904
        throw std::runtime_error("Type not found");
×
905
    }
906
}
31✔
907

908
DebugInfo JSONSerializer::json_to_debug_info(const nlohmann::json& j) {
68✔
909
    assert(j.contains("has"));
68✔
910
    assert(j["has"].is_boolean());
68✔
911
    if (!j["has"]) {
68✔
912
        return DebugInfo();
68✔
913
    }
914
    assert(j.contains("filename"));
×
915
    assert(j["filename"].is_string());
×
916
    std::string filename = j["filename"];
×
917
    assert(j.contains("start_line"));
×
918
    assert(j["start_line"].is_number_integer());
×
919
    size_t start_line = j["start_line"];
×
920
    assert(j.contains("start_column"));
×
921
    assert(j["start_column"].is_number_integer());
×
922
    size_t start_column = j["start_column"];
×
923
    assert(j.contains("end_line"));
×
924
    assert(j["end_line"].is_number_integer());
×
925
    size_t end_line = j["end_line"];
×
926
    assert(j.contains("end_column"));
×
927
    assert(j["end_column"].is_number_integer());
×
928
    size_t end_column = j["end_column"];
×
929
    return DebugInfo(filename, start_line, start_column, end_line, end_column);
×
930
}
68✔
931

932
std::string JSONSerializer::expression(const symbolic::Expression& expr) {
29✔
933
    JSONSymbolicPrinter printer;
29✔
934
    return printer.apply(expr);
29✔
935
};
29✔
936

937
void JSONSymbolicPrinter::bvisit(const SymEngine::Equality& x) {
×
938
    str_ = apply(x.get_args()[0]) + " == " + apply(x.get_args()[1]);
×
939
    str_ = parenthesize(str_);
×
940
};
×
941

942
void JSONSymbolicPrinter::bvisit(const SymEngine::Unequality& x) {
×
943
    str_ = apply(x.get_args()[0]) + " != " + apply(x.get_args()[1]);
×
944
    str_ = parenthesize(str_);
×
945
};
×
946

947
void JSONSymbolicPrinter::bvisit(const SymEngine::LessThan& x) {
×
948
    str_ = apply(x.get_args()[0]) + " <= " + apply(x.get_args()[1]);
×
949
    str_ = parenthesize(str_);
×
950
};
×
951

952
void JSONSymbolicPrinter::bvisit(const SymEngine::StrictLessThan& x) {
2✔
953
    str_ = apply(x.get_args()[0]) + " < " + apply(x.get_args()[1]);
2✔
954
    str_ = parenthesize(str_);
2✔
955
};
2✔
956

957
void JSONSymbolicPrinter::bvisit(const SymEngine::Min& x) {
×
958
    std::ostringstream s;
×
959
    auto container = x.get_args();
×
960
    if (container.size() == 1) {
×
961
        s << apply(*container.begin());
×
962
    } else {
×
963
        s << "min(";
×
964
        s << apply(*container.begin());
×
965

966
        // Recursively apply __daisy_min to the arguments
967
        SymEngine::vec_basic subargs;
×
968
        for (auto it = ++(container.begin()); it != container.end(); ++it) {
×
969
            subargs.push_back(*it);
×
970
        }
×
971
        auto submin = SymEngine::min(subargs);
×
972
        s << ", " << apply(submin);
×
973

974
        s << ")";
×
975
    }
×
976

977
    str_ = s.str();
×
978
};
×
979

980
void JSONSymbolicPrinter::bvisit(const SymEngine::Max& x) {
×
981
    std::ostringstream s;
×
982
    auto container = x.get_args();
×
983
    if (container.size() == 1) {
×
984
        s << apply(*container.begin());
×
985
    } else {
×
986
        s << "max(";
×
987
        s << apply(*container.begin());
×
988

989
        // Recursively apply __daisy_max to the arguments
990
        SymEngine::vec_basic subargs;
×
991
        for (auto it = ++(container.begin()); it != container.end(); ++it) {
×
992
            subargs.push_back(*it);
×
993
        }
×
994
        auto submax = SymEngine::max(subargs);
×
995
        s << ", " << apply(submax);
×
996

997
        s << ")";
×
998
    }
×
999

1000
    str_ = s.str();
×
1001
};
×
1002

1003
}  // namespace serializer
1004
}  // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc