-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScheduleNode.hpp
More file actions
833 lines (741 loc) · 25.8 KB
/
ScheduleNode.hpp
File metadata and controls
833 lines (741 loc) · 25.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
#ifndef ISL_CXX_ScheduleNode_IMPL_H
#define ISL_CXX_ScheduleNode_IMPL_H
#include "isl/ScheduleNode.h"
#include "isl/Id.hpp"
#include "isl/MultiUnionPwAff.hpp"
#include "isl/MultiVal.hpp"
#include "isl/Schedule.hpp"
#include "isl/Set.hpp"
#include "isl/Space.hpp"
#include "isl/UnionMap.hpp"
#include "isl/UnionPwMultiAff.hpp"
#include "isl/UnionSet.hpp"
#include "isl/UnionSetList.hpp"
#include "isl/Bool.h"
#include "isl/Format.h"
#include "isl/IslBase.h"
#include "isl/IslException.h"
#include "isl/ScheduleNodeType.h"
#include "isl/Stat.h"
#include <string>
#include <cassert>
namespace isl {
inline isl_schedule_node *ScheduleNode::GetCopy() const {
return isl_schedule_node_copy((isl_schedule_node *)This);
}
inline ScheduleNode &ScheduleNode::operator=(const ScheduleNode &Other) {
isl_schedule_node *New = Other.GetCopy();
ctx = Other.Context();
isl_schedule_node_free((isl_schedule_node *)This);
This = New;
return *this;
}
inline ScheduleNode ScheduleNode::fromDomain(const UnionSet &domain) {
const Ctx &_ctx = domain.Context();
_ctx.lock();
isl_schedule_node *That = isl_schedule_node_from_domain((domain).GetCopy());
_ctx.unlock();
if (_ctx.hasError()) {
handleError("isl_schedule_node_from_domain returned a NULL pointer.");
}
return ScheduleNode(_ctx, That);
}
inline ScheduleNode ScheduleNode::fromExtension(const UnionMap &extension) {
const Ctx &_ctx = extension.Context();
_ctx.lock();
isl_schedule_node *That = isl_schedule_node_from_extension((extension).GetCopy());
_ctx.unlock();
if (_ctx.hasError()) {
handleError("isl_schedule_node_from_extension returned a NULL pointer.");
}
return ScheduleNode(_ctx, That);
}
inline ScheduleNode::~ScheduleNode() {
isl_schedule_node_free((isl_schedule_node *)This);
This = nullptr;
}
/// rief Release ownership of the wrapped object.
///
/// You are on your own now buddy.
/// The wrapper cannot be used anymore after calling Give()
///
///@return the wrapped isl object.
inline isl_schedule_node *ScheduleNode::Give() {
isl_schedule_node *res = (isl_schedule_node *)This;
This = nullptr;
return res;
}
/// \brief Unwrap the stored isl object.
/// \returns A the wrapped isl object.
inline isl_schedule_node *ScheduleNode::Get() const { return (isl_schedule_node *)This;
}
inline ScheduleNode ScheduleNode::alignParams(const Space &space) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_align_params((*this).GetCopy(), (space).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_align_params returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::ancestor(int generation) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_ancestor((*this).GetCopy(), generation);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_ancestor returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline UnionSet ScheduleNode::bandGetAstBuildOptions() const {
ctx.lock();
isl_union_set * res = isl_schedule_node_band_get_ast_build_options((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_get_ast_build_options returned a NULL pointer.");
}
return UnionSet(ctx, res);
}
inline MultiUnionPwAff ScheduleNode::bandGetPartialSchedule() const {
ctx.lock();
isl_multi_union_pw_aff * res = isl_schedule_node_band_get_partial_schedule((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_get_partial_schedule returned a NULL pointer.");
}
return MultiUnionPwAff(ctx, res);
}
inline UnionMap ScheduleNode::bandGetPartialScheduleUnionMap() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_band_get_partial_schedule_union_map((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_get_partial_schedule_union_map returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline Bool ScheduleNode::bandGetPermutable() const {
ctx.lock();
isl_bool res = isl_schedule_node_band_get_permutable((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline Space ScheduleNode::bandGetSpace() const {
ctx.lock();
isl_space * res = isl_schedule_node_band_get_space((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_get_space returned a NULL pointer.");
}
return Space(ctx, res);
}
inline enum isl_ast_loop_type ScheduleNode::bandMemberGetAstLoopType(int pos) const {
ctx.lock();
enum isl_ast_loop_type res = isl_schedule_node_band_member_get_ast_loop_type((*this).Get(), pos);
ctx.unlock();
return res;
}
inline Bool ScheduleNode::bandMemberGetCoincident(int pos) const {
ctx.lock();
isl_bool res = isl_schedule_node_band_member_get_coincident((*this).Get(), pos);
ctx.unlock();
return (Bool)res;
}
inline enum isl_ast_loop_type ScheduleNode::bandMemberGetIsolateAstLoopType(int pos) const {
ctx.lock();
enum isl_ast_loop_type res = isl_schedule_node_band_member_get_isolate_ast_loop_type((*this).Get(), pos);
ctx.unlock();
return res;
}
inline ScheduleNode ScheduleNode::bandMemberSetAstLoopType(int pos, enum isl_ast_loop_type type) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_member_set_ast_loop_type((*this).GetCopy(), pos, type);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_member_set_ast_loop_type returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandMemberSetCoincident(int pos, int coincident) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_member_set_coincident((*this).GetCopy(), pos, coincident);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_member_set_coincident returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandMemberSetIsolateAstLoopType(int pos, enum isl_ast_loop_type type) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_member_set_isolate_ast_loop_type((*this).GetCopy(), pos, type);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_member_set_isolate_ast_loop_type returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandMod(const MultiVal &mv) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_mod((*this).GetCopy(), (mv).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_mod returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline unsigned int ScheduleNode::bandNMember() const {
ctx.lock();
unsigned int res = isl_schedule_node_band_n_member((*this).Get());
ctx.unlock();
return res;
}
inline ScheduleNode ScheduleNode::bandScale(const MultiVal &mv) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_scale((*this).GetCopy(), (mv).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_scale returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandScaleDown(const MultiVal &mv) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_scale_down((*this).GetCopy(), (mv).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_scale_down returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandSetAstBuildOptions(const UnionSet &options) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_set_ast_build_options((*this).GetCopy(), (options).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_set_ast_build_options returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandSetPermutable(int permutable) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_set_permutable((*this).GetCopy(), permutable);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_set_permutable returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandShift(const MultiUnionPwAff &shift) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_shift((*this).GetCopy(), (shift).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_shift returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandSink() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_sink((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_sink returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandSplit(int pos) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_split((*this).GetCopy(), pos);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_split returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::bandTile(const MultiVal &sizes) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_band_tile((*this).GetCopy(), (sizes).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_band_tile returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::child(int pos) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_child((*this).GetCopy(), pos);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_child returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline Set ScheduleNode::contextGetContext() const {
ctx.lock();
isl_set * res = isl_schedule_node_context_get_context((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_context_get_context returned a NULL pointer.");
}
return Set(ctx, res);
}
inline ScheduleNode ScheduleNode::copy() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_copy((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_copy returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::cut() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_cut((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_cut returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::delete_() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_delete((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_delete returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline UnionSet ScheduleNode::domainGetDomain() const {
ctx.lock();
isl_union_set * res = isl_schedule_node_domain_get_domain((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_domain_get_domain returned a NULL pointer.");
}
return UnionSet(ctx, res);
}
inline void ScheduleNode::dump() const {
ctx.lock();
isl_schedule_node_dump((*this).Get());
ctx.unlock();
}
inline UnionPwMultiAff ScheduleNode::expansionGetContraction() const {
ctx.lock();
isl_union_pw_multi_aff * res = isl_schedule_node_expansion_get_contraction((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_expansion_get_contraction returned a NULL pointer.");
}
return UnionPwMultiAff(ctx, res);
}
inline UnionMap ScheduleNode::expansionGetExpansion() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_expansion_get_expansion((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_expansion_get_expansion returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionMap ScheduleNode::extensionGetExtension() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_extension_get_extension((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_extension_get_extension returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionSet ScheduleNode::filterGetFilter() const {
ctx.lock();
isl_union_set * res = isl_schedule_node_filter_get_filter((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_filter_get_filter returned a NULL pointer.");
}
return UnionSet(ctx, res);
}
inline ScheduleNode ScheduleNode::firstChild() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_first_child((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_first_child returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline Stat ScheduleNode::foreachAncestorTopDown(const std::function<isl_stat(isl_schedule_node *, void *)> && fn, void * user) const {
ctx.lock();
isl_stat res = isl_schedule_node_foreach_ancestor_top_down((*this).Get(), get_fn_ptr<15>(fn), user);
ctx.unlock();
return (Stat)res;
}
inline Stat ScheduleNode::foreachDescendantTopDown(const std::function<isl_bool(isl_schedule_node *, void *)> && fn, void * user) const {
ctx.lock();
isl_stat res = isl_schedule_node_foreach_descendant_top_down((*this).Get(), get_fn_ptr<16>(fn), user);
ctx.unlock();
return (Stat)res;
}
inline int ScheduleNode::getAncestorChildPosition(const ScheduleNode &ancestor) const {
ctx.lock();
int res = isl_schedule_node_get_ancestor_child_position((*this).Get(), (ancestor).Get());
ctx.unlock();
return res;
}
inline ScheduleNode ScheduleNode::getChild(int pos) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_get_child((*this).Get(), pos);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_child returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline int ScheduleNode::getChildPosition() const {
ctx.lock();
int res = isl_schedule_node_get_child_position((*this).Get());
ctx.unlock();
return res;
}
inline ScheduleNodeType ScheduleNode::getParentType() const {
ctx.lock();
enum isl_schedule_node_type res = isl_schedule_node_get_parent_type((*this).Get());
ctx.unlock();
return (ScheduleNodeType)res;
}
inline MultiUnionPwAff ScheduleNode::getPrefixScheduleMultiUnionPwAff() const {
ctx.lock();
isl_multi_union_pw_aff * res = isl_schedule_node_get_prefix_schedule_multi_union_pw_aff((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_prefix_schedule_multi_union_pw_aff returned a NULL pointer.");
}
return MultiUnionPwAff(ctx, res);
}
inline UnionMap ScheduleNode::getPrefixScheduleRelation() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_get_prefix_schedule_relation((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_prefix_schedule_relation returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionMap ScheduleNode::getPrefixScheduleUnionMap() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_get_prefix_schedule_union_map((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_prefix_schedule_union_map returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionPwMultiAff ScheduleNode::getPrefixScheduleUnionPwMultiAff() const {
ctx.lock();
isl_union_pw_multi_aff * res = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_prefix_schedule_union_pw_multi_aff returned a NULL pointer.");
}
return UnionPwMultiAff(ctx, res);
}
inline Schedule ScheduleNode::getSchedule() const {
ctx.lock();
isl_schedule * res = isl_schedule_node_get_schedule((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_schedule returned a NULL pointer.");
}
return Schedule(ctx, res);
}
inline int ScheduleNode::getScheduleDepth() const {
ctx.lock();
int res = isl_schedule_node_get_schedule_depth((*this).Get());
ctx.unlock();
return res;
}
inline ScheduleNode ScheduleNode::getSharedAncestor(const ScheduleNode &node2) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_get_shared_ancestor((*this).Get(), (node2).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_shared_ancestor returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline UnionPwMultiAff ScheduleNode::getSubtreeContraction() const {
ctx.lock();
isl_union_pw_multi_aff * res = isl_schedule_node_get_subtree_contraction((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_subtree_contraction returned a NULL pointer.");
}
return UnionPwMultiAff(ctx, res);
}
inline UnionMap ScheduleNode::getSubtreeExpansion() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_get_subtree_expansion((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_subtree_expansion returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionMap ScheduleNode::getSubtreeScheduleUnionMap() const {
ctx.lock();
isl_union_map * res = isl_schedule_node_get_subtree_schedule_union_map((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_subtree_schedule_union_map returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline int ScheduleNode::getTreeDepth() const {
ctx.lock();
int res = isl_schedule_node_get_tree_depth((*this).Get());
ctx.unlock();
return res;
}
inline ScheduleNodeType ScheduleNode::getType() const {
ctx.lock();
enum isl_schedule_node_type res = isl_schedule_node_get_type((*this).Get());
ctx.unlock();
return (ScheduleNodeType)res;
}
inline UnionSet ScheduleNode::getUniverseDomain() const {
ctx.lock();
isl_union_set * res = isl_schedule_node_get_universe_domain((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_get_universe_domain returned a NULL pointer.");
}
return UnionSet(ctx, res);
}
inline ScheduleNode ScheduleNode::graftAfter(const ScheduleNode &graft) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_graft_after((*this).GetCopy(), (graft).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_graft_after returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::graftBefore(const ScheduleNode &graft) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_graft_before((*this).GetCopy(), (graft).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_graft_before returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::group(const Id &group_id) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_group((*this).GetCopy(), (group_id).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_group returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline Set ScheduleNode::guardGetGuard() const {
ctx.lock();
isl_set * res = isl_schedule_node_guard_get_guard((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_guard_get_guard returned a NULL pointer.");
}
return Set(ctx, res);
}
inline Bool ScheduleNode::hasChildren() const {
ctx.lock();
isl_bool res = isl_schedule_node_has_children((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline Bool ScheduleNode::hasNextSibling() const {
ctx.lock();
isl_bool res = isl_schedule_node_has_next_sibling((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline Bool ScheduleNode::hasParent() const {
ctx.lock();
isl_bool res = isl_schedule_node_has_parent((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline Bool ScheduleNode::hasPreviousSibling() const {
ctx.lock();
isl_bool res = isl_schedule_node_has_previous_sibling((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline ScheduleNode ScheduleNode::insertContext(const Set &context) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_context((*this).GetCopy(), (context).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_context returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertFilter(const UnionSet &filter) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_filter((*this).GetCopy(), (filter).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_filter returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertGuard(const Set &context) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_guard((*this).GetCopy(), (context).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_guard returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertMark(const Id &mark) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_mark((*this).GetCopy(), (mark).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_mark returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertPartialSchedule(const MultiUnionPwAff &schedule) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_partial_schedule((*this).GetCopy(), (schedule).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_partial_schedule returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertSequence(const UnionSetList &filters) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_sequence((*this).GetCopy(), (filters).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_sequence returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::insertSet(const UnionSetList &filters) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_insert_set((*this).GetCopy(), (filters).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_insert_set returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline Bool ScheduleNode::isEqual(const ScheduleNode &node2) const {
ctx.lock();
isl_bool res = isl_schedule_node_is_equal((*this).Get(), (node2).Get());
ctx.unlock();
return (Bool)res;
}
inline Bool ScheduleNode::isSubtreeAnchored() const {
ctx.lock();
isl_bool res = isl_schedule_node_is_subtree_anchored((*this).Get());
ctx.unlock();
return (Bool)res;
}
inline ScheduleNode ScheduleNode::mapDescendantBottomUp(const std::function<isl_schedule_node *(isl_schedule_node *, void *)> && fn, void * user) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_map_descendant_bottom_up((*this).GetCopy(), get_fn_ptr<17>(fn), user);
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_map_descendant_bottom_up returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline Id ScheduleNode::markGetId() const {
ctx.lock();
isl_id * res = isl_schedule_node_mark_get_id((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_mark_get_id returned a NULL pointer.");
}
return Id(ctx, res);
}
inline int ScheduleNode::nChildren() const {
ctx.lock();
int res = isl_schedule_node_n_children((*this).Get());
ctx.unlock();
return res;
}
inline ScheduleNode ScheduleNode::nextSibling() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_next_sibling((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_next_sibling returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::orderAfter(const UnionSet &filter) const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_order_after((*this).GetCopy(), (filter).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_order_after returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::parent() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_parent((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_parent returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::previousSibling() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_previous_sibling((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_previous_sibling returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::resetUser() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_reset_user((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_reset_user returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline ScheduleNode ScheduleNode::root() const {
ctx.lock();
isl_schedule_node * res = isl_schedule_node_root((*this).GetCopy());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_schedule_node_root returned a NULL pointer.");
}
return ScheduleNode(ctx, res);
}
inline std::string ScheduleNode::toStr() const {
ctx.lock();
char * res = isl_schedule_node_to_str((*this).Get());
ctx.unlock();
std::string res_;
if (ctx.hasError()) {
handleError("isl_schedule_node_to_str returned a NULL pointer.");
}
res_ = res;
free((void *)res);
return res_;
}
} // namespace isl
#endif //ISL_CXX_ScheduleNode_IMPL_H