Skip to content

Commit 70c63de

Browse files
simplify
1 parent 69ca9f8 commit 70c63de

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

numba_cuda/numba/cuda/target.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import warnings
99
import importlib.util
1010
import numpy as np
11+
1112
from numba.cuda import types
1213
from numba.cuda import HAS_NUMBA
1314
from numba.cuda.core.compiler_lock import global_compiler_lock
@@ -283,10 +284,8 @@ def make_constant_array(self, builder, aryty, arr):
283284
# Ensure we have a contiguous buffer with non-negative strides. views with
284285
# negative strides must be materialized so that the
285286
# constant bytes and the data pointer/strides are consistent.
286-
if (
287-
not getattr(arr, "flags", None)
288-
or (not arr.flags.c_contiguous)
289-
or any(s < 0 for s in arr.strides)
287+
if any(s < 0 for s in arr.strides) or not (
288+
arr.flags.c_contiguous or arr.flags.f_contiguous
290289
):
291290
arr = np.ascontiguousarray(arr)
292291

0 commit comments

Comments
 (0)