diff --git a/loopy/auto_test.py b/loopy/auto_test.py index 8497f0c5e32cd6fcb8c197ddde01047ad8350609..f08a95614bd58723eced6023b8ddb7257c442289 100644 --- a/loopy/auto_test.py +++ b/loopy/auto_test.py @@ -425,7 +425,7 @@ def auto_test_vs_ref( ref_queue, parameters, fill_value=fill_value_ref) ref_args["out_host"] = False - except cl.RuntimeError, e: + except cl.RuntimeError as e: if e.code == cl.status_code.IMAGE_FORMAT_NOT_SUPPORTED: import traceback ref_errors.append("\n".join([ diff --git a/loopy/check.py b/loopy/check.py index 715a0740ccc97bc70ba87788f719d9e1f5b12c80..45e42945075ac96fe5f992a503a2b563f9100e7e 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -394,7 +394,7 @@ def check_sizes(kernel, device): try: glens = evaluate(glens, parameters) llens = evaluate(llens, parameters) - except UnknownVariableError, name: + except UnknownVariableError as name: from warnings import warn warn("could not check axis bounds because no value " "for variable '%s' was passed to check_kernels()" diff --git a/loopy/codegen/loop.py b/loopy/codegen/loop.py index 2004fe215a80032b167eb5301f43a9bf6822bdf3..c3b2881ad0561324c28b859f66a0d063420a12e6 100644 --- a/loopy/codegen/loop.py +++ b/loopy/codegen/loop.py @@ -129,7 +129,7 @@ def generate_unroll_loop(kernel, sched_index, codegen_state): lower_bound_aff = static_value_of_pw_aff( bounds.lower_bound_pw_aff.coalesce(), constants_only=False) - except Exception, e: + except Exception as e: raise type(e)("while finding lower bound of '%s': " % iname) result = [] diff --git a/loopy/compiled.py b/loopy/compiled.py index da3269bba3d5e015b3b01c626473f90b40638470..3e6b506475616121f7a20bce2fbeb17393fc02ec 100644 --- a/loopy/compiled.py +++ b/loopy/compiled.py @@ -163,7 +163,7 @@ def generate_integer_arg_finding_from_shapes(gen, kernel, impl_arg_info, options [integer_arg_var.name], [(shape_i, sym_shape.index(axis_nr))] )[integer_arg_var] - except Exception, e: + except Exception as e: #from traceback import print_exc #print_exc() diff --git a/loopy/schedule.py b/loopy/schedule.py index c570e6d20b1084bdadbd144ccf3e07c5da2c68bd..62ab00fc5cfea611589cf9456d1e52a85b21a638 100644 --- a/loopy/schedule.py +++ b/loopy/schedule.py @@ -355,10 +355,10 @@ def generate_loop_schedules_internal(sched_state, loop_priority, schedule=[], print("(LEGEND: entry into loop: <iname>, exit from loop: </iname>, " "instructions w/ no delimiters)") #print("boost allowed:", allow_boost) - print(75*"=" + print(75*"=") print("LOOP NEST MAP:") for iname, val in sched_state.loop_nest_map.iteritems(): - print("%s : %s" % (iname, ", ".join(val)) + print("%s : %s" % (iname, ", ".join(val))) print(75*"=") print("WHY IS THIS A DEAD-END SCHEDULE?") @@ -1079,18 +1079,18 @@ def generate_loop_schedules(kernel, debug_args={}): if not schedule_count: if debug.interactive: - print(75*"-" - print("ERROR: Sorry--loo.py did not find a schedule for your kernel." - print(75*"-" - print("Loo.py will now show you the scheduler state at the point" - print("where the longest (dead-end) schedule was generated, in the" - print("the hope that some of this makes sense and helps you find" - print("the issue." + print(75*"-") + print("ERROR: Sorry--loo.py did not find a schedule for your kernel.") + print(75*"-") + print("Loo.py will now show you the scheduler state at the point") + print("where the longest (dead-end) schedule was generated, in the") + print("the hope that some of this makes sense and helps you find") + print("the issue.") print() print("To disable this interactive behavior, pass") print(" debug_args=dict(interactive=False)") print("to generate_loop_schedules().") - print(75*"-" + print(75*"-") six.input("Enter:") print() print()