-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBand.h
More file actions
88 lines (75 loc) · 2.11 KB
/
Band.h
File metadata and controls
88 lines (75 loc) · 2.11 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
#ifndef ISL_CXX_Band_H
#define ISL_CXX_Band_H
#include "isl/band.h"
#include "isl/Format.h"
#include "isl/IslBase.h"
#include "isl/IslException.h"
#include <string>
#include "isl/IslFnPtr.h"
namespace isl {
class UnionMap;
class Vec;
class Band {
protected:
Ctx ctx;
void * This;
public:
explicit Band(Ctx ctx, isl_band *That) : ctx(ctx), This(That) {}
Band() : ctx(Ctx(nullptr)), This(nullptr) {}
const Ctx &Context() const { return ctx; }
__isl_give isl_band *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_band *Give();
/// \brief unwrap the stored isl object.
/// \return a the wrapped isl object.
__isl_give isl_band *Get() const;
public:
virtual ~Band() = default;
/// \brief Generated from ::<isl_band_get_partial_schedule>
///
///
/// \returns A new UnionMap
UnionMap getPartialSchedule() const;
/// \brief Generated from ::<isl_band_get_prefix_schedule>
///
///
/// \returns A new UnionMap
UnionMap getPrefixSchedule() const;
/// \brief Generated from ::<isl_band_get_suffix_schedule>
///
///
/// \returns A new UnionMap
UnionMap getSuffixSchedule() const;
/// \brief Generated from ::<isl_band_split>
///
/// \param [in] pos
///
/// \returns A new int
int split(int pos) const;
/// \brief Generated from ::<isl_band_tile>
///
/// \param [in] sizes
///
/// \returns A new int
int tile(const Vec &sizes) const;
Band(const Band &Other) : ctx(Other.Context()), This(Other.GetCopy()) {}
Band &operator=(const Band &Other);
Band (Band && Other) : ctx(Other.Context()), This(Other.Give()) {}
Band &operator=(Band && Other) {
isl_band *New = Other.Give();
isl_band_free((isl_band *)This);
This = New;
ctx = Other.Context();
return *this;
}
/// \brief Implement lt via pointer comparison of the
/// wrapped isl objects.
bool operator<(const Band &RHS) const { return This < RHS.This; }
};
} // namespace isl
#endif //ISL_CXX_Band_H