[Numpy-discussion] [OT] Starving CPUs article featured in IEEE's ComputingNow portal

Pauli Virtanen pav@iki...
Mon Mar 22 14:42:55 CDT 2010


la, 2010-03-20 kello 17:36 -0400, Anne Archibald kirjoitti:
> I was in on that discussion. My recollection of the conclusion was
> that on the one hand they're useful, carefully applied, while on the
> other hand they're very difficult to reliably detect (since you don't
> want to forbid operations on non-overlapping slices of the same
> array).

I think one alternative brought up was

	copy if unsure whether the slices overlap

which would make

	A[whatever] = A[whatever2]

be always identical in functionality to

	A[whatever] = A[whatever2].copy()

which is how things should work. This would permit optimizing simple
cases (at least 1D), and avoids running into NP-completeness (for numpy,
the exponential growth is however limited by NPY_MAXDIMS which is 64,
IIRC).

This would be a change in semantics, but in a very obscure corner that
hopefully nobody relies on.

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list