2 import argparse
, isl
, os
7 domain
= isl
.USet('{}')
9 for statement
in scop
['statements']:
10 domain
= domain
.union(isl
.USet(statement
['domain']))
13 print str(domain
) + ";"
15 def printAccesses(scop
):
19 for statement
in scop
['statements']:
20 for access
in statement
['accesses']:
21 if access
['kind'] == 'read':
22 read
= read
.union(isl
.UMap(access
['relation']))
27 write
= isl
.UMap('{}')
29 for statement
in scop
['statements']:
30 for access
in statement
['accesses']:
31 if access
['kind'] == 'write':
32 write
= write
.union(isl
.UMap(access
['relation']))
35 print str(write
) + ";"
37 def printSchedule(scop
):
39 schedule
= isl
.UMap('{}')
41 for statement
in scop
['statements']:
42 schedule
= schedule
.union(isl
.UMap(statement
['schedule']))
45 print str(schedule
) + ";"
48 description
= 'Translate JSCoP into iscc input'
49 parser
= argparse
.ArgumentParser(description
)
50 parser
.add_argument('inputFile', metavar
='N', type=file,
51 help='The JSCoP file')
53 args
= parser
.parse_args()
54 inputFile
= args
.inputFile
55 scop
= json
.load(inputFile
)
63 print 'Dep := (last W before R under S)[0];'
64 print 'schedule D respecting Dep minimizing Dep;'