Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 9aa74be

Browse files
Merge pull request #534 from facebookresearch/pr/clean_up
test_cuda_mapper_memory_promotion.cc: use isl_set_from_multi_aff
2 parents 00029bf + 05d3433 commit 9aa74be

File tree

4 files changed

+30
-31
lines changed

4 files changed

+30
-31
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[submodule "third-party/islpp"]
33
path = third-party/islpp
44
url = https://github.com/nicolasvasilache/isl.git
5-
branch = ntv_dev_cpp
5+
branch = ntv_dev
66
[submodule "third-party/cub"]
77
path = third-party/cub
88
url = https://github.com/nicolasvasilache/cub.git

isl_interface/include/isl/cpp.h

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,6 +2857,7 @@ class set {
28572857
inline isl::set flatten() const;
28582858
inline isl::map flatten_map() const;
28592859
inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
2860+
static inline isl::set from(isl::multi_aff ma);
28602861
inline isl::set from_params() const;
28612862
static inline isl::set from_union_set(isl::union_set uset);
28622863
inline isl::basic_set_list get_basic_set_list() const;
@@ -3263,6 +3264,7 @@ class union_pw_aff {
32633264
inline void foreach_pw_aff(const std::function<void(isl::pw_aff)> &fn) const;
32643265
inline isl::pw_aff_list get_pw_aff_list() const;
32653266
inline isl::space get_space() const;
3267+
inline isl::union_pw_aff intersect_domain(isl::union_set uset) const;
32663268
inline bool involves_param(const isl::id &id) const;
32673269
inline isl::union_pw_aff mod_val(isl::val f) const;
32683270
inline int n_pw_aff() const;
@@ -3421,8 +3423,6 @@ class union_set {
34213423
inline bool is_subset(const isl::union_set &uset2) const;
34223424
inline isl::union_set lexmax() const;
34233425
inline isl::union_set lexmin() const;
3424-
inline isl::multi_val max_multi_union_pw_aff(const isl::multi_union_pw_aff &obj) const;
3425-
inline isl::multi_val min_multi_union_pw_aff(const isl::multi_union_pw_aff &obj) const;
34263426
inline int n_set() const;
34273427
inline isl::set params() const;
34283428
inline isl::union_set polyhedral_hull() const;
@@ -16993,6 +16993,19 @@ void set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
1699316993
return void(res);
1699416994
}
1699516995

16996+
isl::set set::from(isl::multi_aff ma)
16997+
{
16998+
if (ma.is_null())
16999+
throw isl::exception::create(isl_error_invalid,
17000+
"NULL input", __FILE__, __LINE__);
17001+
auto ctx = ma.get_ctx();
17002+
options_scoped_set_on_error saved_on_error(ctx, ISL_ON_ERROR_CONTINUE);
17003+
auto res = isl_set_from_multi_aff(ma.release());
17004+
if (!res)
17005+
throw exception::create_from_last_error(ctx);
17006+
return manage(res);
17007+
}
17008+
1699617009
isl::set set::from_params() const
1699717010
{
1699817011
if (!ptr)
@@ -19955,6 +19968,18 @@ isl::space union_pw_aff::get_space() const
1995519968
return manage(res);
1995619969
}
1995719970

19971+
isl::union_pw_aff union_pw_aff::intersect_domain(isl::union_set uset) const
19972+
{
19973+
if (!ptr || uset.is_null())
19974+
throw isl::exception::create(isl_error_invalid,
19975+
"NULL input", __FILE__, __LINE__);
19976+
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
19977+
auto res = isl_union_pw_aff_intersect_domain(copy(), uset.release());
19978+
if (!res)
19979+
throw exception::create_from_last_error(get_ctx());
19980+
return manage(res);
19981+
}
19982+
1995819983
bool union_pw_aff::involves_param(const isl::id &id) const
1995919984
{
1996019985
if (!ptr || id.is_null())
@@ -21091,30 +21116,6 @@ isl::union_set union_set::lexmin() const
2109121116
return manage(res);
2109221117
}
2109321118

21094-
isl::multi_val union_set::max_multi_union_pw_aff(const isl::multi_union_pw_aff &obj) const
21095-
{
21096-
if (!ptr || obj.is_null())
21097-
throw isl::exception::create(isl_error_invalid,
21098-
"NULL input", __FILE__, __LINE__);
21099-
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
21100-
auto res = isl_union_set_max_multi_union_pw_aff(get(), obj.get());
21101-
if (!res)
21102-
throw exception::create_from_last_error(get_ctx());
21103-
return manage(res);
21104-
}
21105-
21106-
isl::multi_val union_set::min_multi_union_pw_aff(const isl::multi_union_pw_aff &obj) const
21107-
{
21108-
if (!ptr || obj.is_null())
21109-
throw isl::exception::create(isl_error_invalid,
21110-
"NULL input", __FILE__, __LINE__);
21111-
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
21112-
auto res = isl_union_set_min_multi_union_pw_aff(get(), obj.get());
21113-
if (!res)
21114-
throw exception::create_from_last_error(get_ctx());
21115-
return manage(res);
21116-
}
21117-
2111821119
int union_set::n_set() const
2111921120
{
2112021121
if (!ptr)

test/test_cuda_mapper_memory_promotion.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,7 @@ def fun(float(N, M) A, float(N, M) B) -> (C) {
274274
EXPECT_EQ(groups.size(), 3u);
275275

276276
isl::space tileSpace = isl::space(ctx, 0).unnamed_set_from_params(2);
277-
// Work around missing isl_set_from_multi_aff.
278-
auto tileZero =
279-
isl::map(isl::multi_aff::zero(tileSpace.from_range())).range();
277+
auto tileZero = isl::set::from(isl::multi_aff::zero(tileSpace));
280278

281279
// Must have groups for these tensors, in arbitrary order.
282280
unordered_set<string> names{"A", "B", "C"};

third-party/islpp

Submodule islpp updated from 12a5b72 to 639cacc

0 commit comments

Comments
 (0)