From 036c90f6ecc82ad64b05ec8335bb9f2cc4e78a70 Mon Sep 17 00:00:00 2001 From: Matt Wala <wala1@illinois.edu> Date: Thu, 25 Jan 2018 12:05:32 -0600 Subject: [PATCH] Fix string/var mismatch --- loopy/target/c/c_execution.py | 6 ++++-- loopy/target/execution.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/loopy/target/c/c_execution.py b/loopy/target/c/c_execution.py index bba3a8d56..d8b76d32a 100644 --- a/loopy/target/c/c_execution.py +++ b/loopy/target/c/c_execution.py @@ -109,12 +109,14 @@ class CExecutionWrapperGenerator(ExecutionWrapperGeneratorBase): var("_lpy_expected_strides_%s" % i) for i in range(num_axes)) - gen("(%s,) = %s.strides" % (", ".join(expected_strides), arg.name)) + gen("%s = %s.strides" % (strify(expected_strides), arg.name)) #check strides if not skip_arg_checks: strides_check_expr = self.get_strides_check_expr( - sym_shape, sym_strides, expected_strides) + (strify(s) for s in sym_shape), + (strify(s) for s in sym_strides), + (strify(s) for s in expected_strides)) gen("assert %(strides_check)s, " "'Strides of loopy created array %(name)s, " "do not match expected.'" % diff --git a/loopy/target/execution.py b/loopy/target/execution.py index 0ac82b71d..3a3ea0a70 100644 --- a/loopy/target/execution.py +++ b/loopy/target/execution.py @@ -353,7 +353,7 @@ class ExecutionWrapperGeneratorBase(object): def get_strides_check_expr(self, shape, strides, sym_strides): # Returns an expression suitable for use for checking the strides of an - # argument. + # argument. Arguments should be sequences of strings. return " and ".join( "(%s == 1 or %s == %s)" % elem for elem in zip(shape, strides, sym_strides)) -- GitLab