Skip to content

Commit 9b0d328

Browse files
committed
Wrap GpuArray_fix_flags and use it.
1 parent 2a78177 commit 9b0d328

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pygpu/gpuarray.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ cdef extern from "gpuarray/array.h":
149149
ctypedef enum ga_order:
150150
GA_ANY_ORDER, GA_C_ORDER, GA_F_ORDER
151151

152+
void GpuArray_fix_flags(_GpuArray *a)
152153
int GpuArray_empty(_GpuArray *a, gpucontext *ctx,
153154
int typecode, int nd, const size_t *dims, ga_order ord)
154155
int GpuArray_fromdata(_GpuArray *a,

pygpu/gpuarray.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ cdef bint py_CHKFLAGS(GpuArray a, int flags):
234234
cdef bint py_ISONESEGMENT(GpuArray a):
235235
return GpuArray_ISONESEGMENT(&a.ga)
236236

237+
cdef void array_fix_flags(GpuArray a):
238+
GpuArray_fix_flags(&a.ga)
239+
237240
cdef int array_empty(GpuArray a, gpucontext *ctx,
238241
int typecode, unsigned int nd, const size_t *dims,
239242
ga_order ord) except -1:
@@ -1943,6 +1946,7 @@ cdef class GpuArray:
19431946
raise ValueError("new strides are the wrong length")
19441947
for i in range(self.ga.nd):
19451948
self.ga.strides[i] = newstrides[i]
1949+
array_fix_flags(self)
19461950

19471951
property ndim:
19481952
"The number of dimensions in this object"

0 commit comments

Comments
 (0)