File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -866,13 +866,14 @@ static int DPEXRT_sycl_usm_ndarray_from_python(PyObject *obj,
866
866
for (i = 0 ; i < ndim ; ++ i , ++ p )
867
867
* p = shape [i ];
868
868
869
- // DPCTL returns a NULL pointer if the array is contiguous. dpctl stores
870
- // strides as number of elements and Numba stores strides as bytes, for
871
- // that reason we are multiplying stride by itemsize when unboxing the
872
- // external array.
873
-
874
- // FIXME: Stride computation should check order and adjust how strides are
875
- // calculated. Right now strides are assuming that order is C contigous.
869
+ // dpctl returns a NULL pointer for the stride vector if the array has a
870
+ // C-contiguous layout. For all other cases, including strided views and
871
+ // F contiguous layouts, the actual stride values are returned. Also, dpctl
872
+ // stores strides as number of elements and Numba follows NumPy and stores
873
+ // strides as number of bytes. For that reason, we multiply strides by
874
+ // itemsize when unboxing an usm_ndarray if dpctl returned a popualted
875
+ // stride vector. For the default C contiguous case, strides are
876
+ // calculated directly as number of bytes based on itemsize.
876
877
if (strides ) {
877
878
for (i = 0 ; i < ndim ; ++ i , ++ p ) {
878
879
* p = strides [i ] << exp ;
You can’t perform that action at this time.
0 commit comments