From 1a315e58b4d7d3687d07eb83cb1efc3a6f7f8d01 Mon Sep 17 00:00:00 2001 From: zachjweiner Date: Sat, 4 May 2019 10:18:26 -0500 Subject: [PATCH] handle_alloc checks whether arg.unvec_strides is non-empty --- loopy/target/c/c_execution.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/loopy/target/c/c_execution.py b/loopy/target/c/c_execution.py index 60947c7f7..daae98755 100644 --- a/loopy/target/c/c_execution.py +++ b/loopy/target/c/c_execution.py @@ -95,7 +95,10 @@ class CExecutionWrapperGenerator(ExecutionWrapperGeneratorBase): for i in range(num_axes)) # find order of array - order = "'C'" if arg.unvec_strides[-1] == 1 else "'F'" + if len(arg.unvec_strides) > 0: + order = "'C'" if arg.unvec_strides[-1] == 1 else "'F'" + else: + order = "'C'" gen("%(name)s = _lpy_np.empty(%(shape)s, " "%(dtype)s, order=%(order)s)" -- GitLab