-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBand.hpp
More file actions
87 lines (76 loc) · 2.11 KB
/
Band.hpp
File metadata and controls
87 lines (76 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
#ifndef ISL_CXX_Band_IMPL_H
#define ISL_CXX_Band_IMPL_H
#include "isl/Band.h"
#include "isl/UnionMap.hpp"
#include "isl/Vec.hpp"
#include "isl/Format.h"
#include "isl/IslBase.h"
#include "isl/IslException.h"
#include <string>
#include <cassert>
namespace isl {
inline isl_band *Band::GetCopy() const {
return isl_band_copy((isl_band *)This);
}
inline Band &Band::operator=(const Band &Other) {
isl_band *New = Other.GetCopy();
ctx = Other.Context();
isl_band_free((isl_band *)This);
This = New;
return *this;
}/// 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_band *Band::Give() {
isl_band *res = (isl_band *)This;
This = nullptr;
return res;
}
/// \brief Unwrap the stored isl object.
/// \returns A the wrapped isl object.
inline isl_band *Band::Get() const { return (isl_band *)This;
}
inline UnionMap Band::getPartialSchedule() const {
ctx.lock();
isl_union_map * res = isl_band_get_partial_schedule((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_band_get_partial_schedule returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionMap Band::getPrefixSchedule() const {
ctx.lock();
isl_union_map * res = isl_band_get_prefix_schedule((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_band_get_prefix_schedule returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline UnionMap Band::getSuffixSchedule() const {
ctx.lock();
isl_union_map * res = isl_band_get_suffix_schedule((*this).Get());
ctx.unlock();
if (ctx.hasError()) {
handleError("isl_band_get_suffix_schedule returned a NULL pointer.");
}
return UnionMap(ctx, res);
}
inline int Band::split(int pos) const {
ctx.lock();
int res = isl_band_split((*this).Get(), pos);
ctx.unlock();
return res;
}
inline int Band::tile(const Vec &sizes) const {
ctx.lock();
int res = isl_band_tile((*this).Get(), (sizes).GetCopy());
ctx.unlock();
return res;
}
} // namespace isl
#endif //ISL_CXX_Band_IMPL_H