diff --git a/loopy/target/c/c_execution.py b/loopy/target/c/c_execution.py index 60947c7f77d09582868304ded121386bbb3aab68..daae98755a22bf076ab9fb3f3c472474d1e9517a 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)"