3 Star 0 Fork 1

Gitee 极速下载/isl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://repo.or.cz/isl.git
克隆/下载
isl_opt_mpa_templ.c 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* Copyright 2018 Cerebras Systems
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege,
* Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
*/
#undef TYPE
#define TYPE CAT(isl_,BASE)
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Compute the optima of the set or output dimensions as a function of the
* parameters (and input dimensions), but independently of
* the other set or output dimensions,
* given a function "opt" that computes this optimum
* for a single dimension.
*
* If the resulting multi piecewise affine expression has
* an explicit domain, then assign it the (parameter) domain of the input.
* In other cases, the (parameter) domain is stored in the individual elements.
*/
static __isl_give isl_multi_pw_aff *FN(BASE,opt_mpa)(__isl_take TYPE *obj,
__isl_give isl_pw_aff *(*opt)(__isl_take TYPE *obj, int pos))
{
int i;
isl_size n;
isl_multi_pw_aff *mpa;
mpa = isl_multi_pw_aff_alloc(FN(TYPE,get_space)(obj));
n = isl_multi_pw_aff_size(mpa);
if (n < 0)
mpa = isl_multi_pw_aff_free(mpa);
for (i = 0; i < n; ++i) {
isl_pw_aff *pa;
pa = opt(FN(TYPE,copy)(obj), i);
mpa = isl_multi_pw_aff_set_pw_aff(mpa, i, pa);
}
if (isl_multi_pw_aff_has_explicit_domain(mpa)) {
isl_set *dom;
dom = FN(TYPE,domain)(FN(TYPE,copy)(obj));
mpa = isl_multi_pw_aff_intersect_domain(mpa, dom);
}
FN(TYPE,free)(obj);
return mpa;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/mirrors/isl.git
git@gitee.com:mirrors/isl.git
mirrors
isl
isl
master

搜索帮助