diff --git a/loopy/target/c/c_execution.py b/loopy/target/c/c_execution.py index bba3a8d56726226174af499c20a9354f62f1a026..d8b76d32afa64d308648420904f4f4bf8e2e2316 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 0ac82b71d9ed712713dbcc773ab8074afdbbfbdf..3a3ea0a70fe9a9229aa3499ad0bdbfeb87f751ed 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))