[Numpy-svn] r5141 - branches/1.1.x/numpy/core/blasdot

numpy-svn at scipy.org numpy-svn at scipy.org
Wed May 7 16:25:42 EDT 2008


Author: oliphant
Date: 2008-05-07 15:25:42 -0500 (Wed, 07 May 2008)
New Revision: 5141

Modified:
   branches/1.1.x/numpy/core/blasdot/_dotblas.c
Log:
Fix ticket #551 in 1.1.x branch.

Modified: branches/1.1.x/numpy/core/blasdot/_dotblas.c
===================================================================
--- branches/1.1.x/numpy/core/blasdot/_dotblas.c	2008-05-07 20:24:34 UTC (rev 5140)
+++ branches/1.1.x/numpy/core/blasdot/_dotblas.c	2008-05-07 20:25:42 UTC (rev 5141)
@@ -176,6 +176,9 @@
 }
 
 
+/* This also makes sure that the data segment is aligned with
+   an itemsize address as well by returning one if not true. 
+*/
 static int
 _bad_strides(PyArrayObject *ap)
 {
@@ -183,6 +186,8 @@
     register int i, N=PyArray_NDIM(ap);
     register intp *strides = PyArray_STRIDES(ap);
 
+    if (((intp)(ap->data) % itemsize) != 0)
+	return 1;
     for (i=0; i<N; i++) {
 	if ((strides[i] < 0) || (strides[i] % itemsize) != 0) 
 	    return 1;




More information about the Numpy-svn mailing list