diff --git a/polly/lib/External/isl/imath/tools/findthreshold.py b/polly/lib/External/isl/imath/tools/findthreshold.py --- a/polly/lib/External/isl/imath/tools/findthreshold.py +++ b/polly/lib/External/isl/imath/tools/findthreshold.py @@ -62,13 +62,13 @@ check_binary('imtimer') seed = int(time.time()) - print >> sys.stderr, "Computing timer statistics (this may take a while)" + print("Computing timer statistics (this may take a while)", file=sys.stderr) stats = {} for prec in (32, 40, 64, 80, 128, 150, 256, 384, 512, 600, 768, 1024): sys.stderr.write('%-4d ' % prec) stats[prec] = (None, 1000000., 0.) - for thresh in xrange(8, 65, 2): + for thresh in range(8, 65, 2): s, b, t = get_timing_stats(1000, prec, thresh, seed) sp, bp, tp = get_timing_stats(1000, prec, prec + 1, seed) @@ -79,16 +79,16 @@ sys.stderr.write('.') sys.stderr.write('\n') - return list((p, h, t, tp) for p, (h, t, tp) in stats.iteritems()) + return list((p, h, t, tp) for p, (h, t, tp) in stats.items()) if __name__ == "__main__": stats = compute_stats() stats.sort(key=lambda s: s[3] / s[2]) for prec, thresh, trec, tnorm in stats: - print "%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm, - tnorm / trec) + print("%d\t%d\t%.3f\t%.3f\t%.4f" % (prec, thresh, trec, tnorm, + tnorm / trec)) - print + print() # Here there be dragons diff --git a/polly/utils/argparse.py b/polly/utils/argparse.py --- a/polly/utils/argparse.py +++ b/polly/utils/argparse.py @@ -103,7 +103,7 @@ from sets import Set as _set try: - _basestring = basestring + _basestring = str except NameError: _basestring = str @@ -163,7 +163,7 @@ return '%s(%s)' % (type_name, ', '.join(arg_strings)) def _get_kwargs(self): - return _sorted(self.__dict__.items()) + return _sorted(list(self.__dict__.items())) def _get_args(self): return [] diff --git a/polly/utils/jscop2cloog.py b/polly/utils/jscop2cloog.py --- a/polly/utils/jscop2cloog.py +++ b/polly/utils/jscop2cloog.py @@ -50,7 +50,7 @@ context = scop['context'] domains = getDomains(scop) schedules = getSchedules(scop) - print template % (context, domains, schedules) + print(template % (context, domains, schedules)) def __main__(): description = 'Translate JSCoP into iscc input' diff --git a/polly/utils/pyscop/jscop2iscc.py b/polly/utils/pyscop/jscop2iscc.py --- a/polly/utils/pyscop/jscop2iscc.py +++ b/polly/utils/pyscop/jscop2iscc.py @@ -9,8 +9,8 @@ for statement in scop['statements']: domain = domain.union(isl.USet(statement['domain'])) - print "D :=", - print str(domain) + ";" + print("D :=", end=' ') + print(str(domain) + ";") def printAccesses(scop): @@ -21,8 +21,8 @@ if access['kind'] == 'read': read = read.union(isl.UMap(access['relation'])) - print "R :=", - print str(read) + ";" + print("R :=", end=' ') + print(str(read) + ";") write = isl.UMap('{}') @@ -31,8 +31,8 @@ if access['kind'] == 'write': write = write.union(isl.UMap(access['relation'])) - print "W :=", - print str(write) + ";" + print("W :=", end=' ') + print(str(write) + ";") def printSchedule(scop): @@ -41,8 +41,8 @@ for statement in scop['statements']: schedule = schedule.union(isl.UMap(statement['schedule'])) - print "S :=", - print str(schedule) + ";" + print("S :=", end=' ') + print(str(schedule) + ";") def __main__(): description = 'Translate JSCoP into iscc input' @@ -58,10 +58,10 @@ printAccesses(scop) printSchedule(scop) - print 'R := R * D;' - print 'W := W * D;' - print 'Dep := (last W before R under S)[0];' - print 'schedule D respecting Dep minimizing Dep;' + print('R := R * D;') + print('W := W * D;') + print('Dep := (last W before R under S)[0];') + print('schedule D respecting Dep minimizing Dep;') __main__()