serge-sans-paille / pythran

Ahead of Time compiler for numeric kernels
https://pythran.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.01k stars 193 forks source link

Detect potential copyto usage and improve numpy.copyto support #2096

Closed serge-sans-paille closed 1 year ago

serge-sans-paille commented 1 year ago

Detect a[:] = expr pattern and use np.copyto(a, expr) instead. Use memcpy when possible (through broadcast_copy improvement). Accept moved reference.