Help Required: Finding the set of iteration points executed before an iteration point

12 views
Skip to first unread message

abhilash bhandari

unread,
Mar 3, 2014, 3:20:09 PM3/3/14
to cl...@googlegroups.com
Hi All,

As a part of my project which I'm currently implementing using CLooG, I want to know the set of iteration points 'S' executed before any iteration point, say 'p'. This is not possible with multiplication of iteration domain and scattering function (which contain the loop bounds for a tiled loop). Also I see that scattering functions contain more than the loop bounds, they also store the ordering between the statements in the loop. Is there a way to eliminate all the extra information so that the scattering function only contains the loop bounds?
Given the loop bounds and the iteration domain, is it possible to use any of the isl functions on these matrices and generate the set 'S'?  


Thanks and Regards,
Abhilash Bhandari
IIT Madras
Chennai
India

Cédric Bastoul

unread,
Mar 4, 2014, 10:58:46 AM3/4/14
to abhilash bhandari, CLooG
Hi Abhilash Bhandari,

On Mon, Mar 3, 2014 at 9:20 PM, abhilash bhandari <abhilashr...@gmail.com> wrote:
Hi All,

As a part of my project which I'm currently implementing using CLooG, I want to know the set of iteration points 'S' executed before any iteration point, say 'p'.

This does not seem to be a job for CLooG (but of a polyhedral intersection using isl or PolyLib): you should first compute the set 'S' then you may use CLooG to generate the code to scan iteration points of 'S'. CLooG is only about code generation. If you only want the generated code, see below.
 
This is not possible with multiplication of iteration domain and scattering function (which contain the loop bounds for a tiled loop). Also I see that scattering functions contain more than the loop bounds, they also store the ordering between the statements in the loop. Is there a way to eliminate all the extra information so that the scattering function only contains the loop bounds?

The scattering is about ordering. You should not remove ordering information unless you do not care about it (but you do since "executed before" is about ordering !).  It is possible to restrict the domain from the scattering. This is actually what you want. For instance, let us consider a domain {i | 0 <= i <= 10}, ordered according to i. A possible CLooG input file is :

-------------------
# language: C
c

# Context
0 2
0

1 # Number of statements

# Statement 1, D_S1 : {i | 0 <= i <= 10}
2 3
#  i  1
1  1  0 # i >= 0
1 -1 10 # i <= 10

0  0  0
0

1 # Scattering functions

1 4
#   t   i   1
0   1  -1   0 # t = i  (ordering)

1
t
-------------------

The generated code is:

for (t=0;t<=10;t++) {
  S1(t);
}

Now, you want to generate the code only for points scheduled before 'p' which is scheduled at, say, t = 6. Simply add the corresponding constraint to the scattering :

-------------------
# language: C
c

# Context
0 2
0

1 # Number of statements

# Statement 1, D_S1 : {i | 0 <= i <= 10}
2 3
#  i  1
1  1  0 # i >= 0
1 -1 10 # i <= 10

0  0  0
0

1 # Scattering functions

2 4
#   t   i   1
0   1  -1   0 # t = i  (ordering)
1  -1   0   5 # t < 6 (restriction)

1
t
-------------------

The generated code that scans all points executed before 'p' is now:

for (t=0;t<=5;t++) {
  S1(t);
}

There would be no difference with a tiled code : add the constraints you need to all scattering and you are done.
++

Ced.
 
Given the loop bounds and the iteration domain, is it possible to use any of the isl functions on these matrices and generate the set 'S'?   

Thanks and Regards,
Abhilash Bhandari
IIT Madras
Chennai
India

--
--
You got this message because you subscribed to the CLooG mailing list.
To send messages to this list, use cl...@googlegroups.com
To stop subscribing, send a mail to cloog+un...@googlegroups.com
For more options and to visit the group, http://groups.google.fr/group/cloog?hl=en
 
---
You received this message because you are subscribed to the Google Groups "CLooG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloog+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

abhilash bhandari

unread,
Mar 5, 2014, 9:17:05 AM3/5/14
to cl...@googlegroups.com, abhilash bhandari, cedric....@unistra.fr
Hi Cedric Bastoul,

Thanks a lot for your reply.
This cleared a lot of doubts and made my understanding clearer.
The solution you gave is sufficient enough for my requirement and it works :)

Thanks and Regards,
Abhilash
Reply all
Reply to author
Forward
0 new messages