/* * 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 */ #include <isl/space.h> /* Merge parameter "param" into the input dimension "i" of "obj". * * First plug in the parameter for the input dimension in "obj". * The drop the (now defunct) input dimension and * move the parameter in its original position. * Since dimension manipulations destroy spaces, modify the space * separately by only dropping the parameter. */ static __isl_give TYPE *FN(TYPE,merge_param)(__isl_take TYPE *obj, int i, int param) { … } /* Given a tuple of identifiers "tuple" that correspond * to the initial input dimensions of "obj", * if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_initial_params)(__isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { … } /* Given a tuple of identifiers "tuple" in a space that corresponds * to the domain of "obj", if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_domain_params)(__isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { … } /* Bind the domain dimensions of the function "obj" to parameters * with identifiers specified by "tuple", living in the same space * as the domain of "obj". * * If no parameters with these identifiers appear in "obj" already, * then the domain dimensions are simply reinterpreted as parameters. * Otherwise, the parameters are first equated to the corresponding * domain dimensions. */ __isl_give TYPE *FN(TYPE,bind_domain)(__isl_take TYPE *obj, __isl_take isl_multi_id *tuple) { … } /* Given a tuple of identifiers "tuple" in a space that corresponds * to the domain of the wrapped relation in the domain of "obj", * if any of those identifiers appear as parameters * in "obj", then equate those parameters with the corresponding * input dimensions and project out the parameters. * The result therefore has no such parameters. */ static __isl_give TYPE *FN(TYPE,equate_domain_wrapped_domain_params)( __isl_take TYPE *obj, __isl_keep isl_multi_id *tuple) { … } /* Given a function living in a space of the form [A -> B] -> C and * a tuple of identifiers in A, bind the domain dimensions of the relation * wrapped in the domain of "obj" with identifiers specified by "tuple", * returning a function in the space B -> C. * * If no parameters with these identifiers appear in "obj" already, * then the domain dimensions are simply reinterpreted as parameters. * Otherwise, the parameters are first equated to the corresponding * domain dimensions. */ __isl_give TYPE *FN(TYPE,bind_domain_wrapped_domain)(__isl_take TYPE *obj, __isl_take isl_multi_id *tuple) { … }