forked from simbuerg/isl-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnionAccessInfo.h
102 lines (86 loc) · 2.94 KB
/
UnionAccessInfo.h
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
#ifndef ISL_CXX_UnionAccessInfo_H
#define ISL_CXX_UnionAccessInfo_H
#include "isl/union_access_info.h"
#include "isl/IslBase.h"
#include "isl/IslException.h"
#include <string>
#include "isl/IslFnPtr.h"
namespace isl {
class Schedule;
class UnionFlow;
class UnionMap;
class UnionAccessInfo {
protected:
Ctx ctx;
void * This;
public:
explicit UnionAccessInfo(Ctx ctx, isl_union_access_info *That) : ctx(ctx), This(That) {}
UnionAccessInfo() : ctx(Ctx(nullptr)), This(nullptr) {}
const Ctx &Context() const { return ctx; }
__isl_give isl_union_access_info *GetCopy() const;
/// \brief Release ownership of the wrapped object.
///
/// You are on your own now buddy.
/// The wrapper cannot be used anymore after calling Give()
///
/// \returns the wrapped isl object.
__isl_give isl_union_access_info *Give();
/// \brief unwrap the stored isl object.
/// \return a the wrapped isl object.
__isl_give isl_union_access_info *Get() const;
/// \brief Constructor for isl_union_access_info_from_sink
///
/// \param sink
static UnionAccessInfo fromSink(const UnionMap &sink);
public:
virtual ~UnionAccessInfo();
/// \brief Generated from ::<isl_union_access_info_compute_flow>
///
///
/// \returns A new UnionFlow
UnionFlow computeFlow() const;
/// \brief Generated from ::<isl_union_access_info_set_may_source>
///
/// \param [in] may_source
///
/// \returns A new UnionAccessInfo
UnionAccessInfo setMaySource(const UnionMap &may_source) const;
/// \brief Generated from ::<isl_union_access_info_set_must_source>
///
/// \param [in] must_source
///
/// \returns A new UnionAccessInfo
UnionAccessInfo setMustSource(const UnionMap &must_source) const;
/// \brief Generated from ::<isl_union_access_info_set_schedule>
///
/// \param [in] schedule
///
/// \returns A new UnionAccessInfo
UnionAccessInfo setSchedule(const Schedule &schedule) const;
/// \brief Generated from ::<isl_union_access_info_set_schedule_map>
///
/// \param [in] schedule_map
///
/// \returns A new UnionAccessInfo
UnionAccessInfo setScheduleMap(const UnionMap &schedule_map) const;
/// \brief Generated from ::<isl_union_access_info_to_str>
///
///
/// \returns A new std::string
std::string toStr() const;
UnionAccessInfo(const UnionAccessInfo &Other) : ctx(Other.Context()), This(Other.GetCopy()) {}
UnionAccessInfo &operator=(const UnionAccessInfo &Other);
UnionAccessInfo (UnionAccessInfo && Other) : ctx(Other.Context()), This(Other.Give()) {}
UnionAccessInfo &operator=(UnionAccessInfo && Other) {
isl_union_access_info *New = Other.Give();
isl_union_access_info_free((isl_union_access_info *)This);
This = New;
ctx = Other.Context();
return *this;
}
/// \brief Implement lt via pointer comparison of the
/// wrapped isl objects.
bool operator<(const UnionAccessInfo &RHS) const { return This < RHS.This; }
};
} // namespace isl
#endif //ISL_CXX_UnionAccessInfo_H