cunumpy 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cunumpy-0.7.0/src/cunumpy.egg-info → cunumpy-0.7.1}/PKG-INFO +1 -1
- {cunumpy-0.7.0 → cunumpy-0.7.1}/pyproject.toml +1 -1
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_algorithms.py +18 -1
- {cunumpy-0.7.0 → cunumpy-0.7.1/src/cunumpy.egg-info}/PKG-INFO +1 -1
- {cunumpy-0.7.0 → cunumpy-0.7.1}/LICENSE.txt +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/README.md +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/setup.cfg +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/LLM_GUIDE.md +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/__init__.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/__init__.pyi +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_cuda_kernel.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_device.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_dispatch.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_emulation.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_fake_cupy.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_fake_cupy_impl.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_fake_cupyx.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_fusion.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_host.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_kernel.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_linalg.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_metal_kernel.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_mirror.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_morton.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_mpi.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_optimize.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_philox.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_profiling.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_pyccel_cache.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_random_streams.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_scipy_backend.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_scipy_host.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_staging.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_streams.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/_transfers.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/algorithms.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/arguments.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/__init__.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/array_view.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/atomic.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/index.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/morton.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/random.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/reduce.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/cuda/include/cunumpy/scan.cuh +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/integrate.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/kernel_testing.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/kernels.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/memory.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/mpi.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/optimize.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/petsc.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/profiling.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/py.typed +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/rng.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy/xp.py +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy.egg-info/SOURCES.txt +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy.egg-info/dependency_links.txt +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy.egg-info/requires.txt +0 -0
- {cunumpy-0.7.0 → cunumpy-0.7.1}/src/cunumpy.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ requires = [ "setuptools", "wheel" ]
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "cunumpy"
|
|
8
|
-
version = "0.7.
|
|
8
|
+
version = "0.7.1"
|
|
9
9
|
description = "Simple wrapper for numpy and cupy. Replace `import numpy as np` with `import cunumpy as xp`."
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
keywords = [ "python" ]
|
|
@@ -380,6 +380,8 @@ def sort_by_key(keys: Any, *arrays: Any, axis: int = 0) -> tuple[Any, ...]:
|
|
|
380
380
|
radix sort; on NumPy, integer keys of more than 4096 entries get an LSD
|
|
381
381
|
radix sort too (one stable ``uint16`` argsort per 16-bit digit the key range
|
|
382
382
|
needs), about ten times faster than NumPy's stable sort of 64-bit integers.
|
|
383
|
+
On NumPy, a 2-D array sorted along its last axis (component-major markers) is
|
|
384
|
+
gathered row by row, about twice as fast as ``take`` along that axis.
|
|
383
385
|
|
|
384
386
|
Parameters
|
|
385
387
|
----------
|
|
@@ -437,12 +439,27 @@ def sort_by_key(keys: Any, *arrays: Any, axis: int = 0) -> tuple[Any, ...]:
|
|
|
437
439
|
keys[order],
|
|
438
440
|
order,
|
|
439
441
|
*(
|
|
440
|
-
xpm
|
|
442
|
+
_take_along_axis(xpm, array, order, array_axis)
|
|
441
443
|
for array, array_axis in zip(arrays, axes, strict=True)
|
|
442
444
|
),
|
|
443
445
|
)
|
|
444
446
|
|
|
445
447
|
|
|
448
|
+
def _take_along_axis(xpm: Any, array: Any, order: Any, axis: int) -> Any:
|
|
449
|
+
"""Return `array` taken at `order` along `axis`, as a new C-contiguous array.
|
|
450
|
+
|
|
451
|
+
A component-major ``(ncomp, n)`` NumPy array is gathered one contiguous row at a
|
|
452
|
+
time, which is about twice as fast as ``take`` along its last axis; everything
|
|
453
|
+
else, and CuPy, goes through ``take``.
|
|
454
|
+
"""
|
|
455
|
+
if xpm is np and array.ndim == 2 and axis == 1:
|
|
456
|
+
gathered = np.empty((array.shape[0], order.shape[0]), dtype=array.dtype)
|
|
457
|
+
for row in range(array.shape[0]):
|
|
458
|
+
gathered[row] = array[row][order]
|
|
459
|
+
return gathered
|
|
460
|
+
return xpm.take(array, order, axis=axis)
|
|
461
|
+
|
|
462
|
+
|
|
446
463
|
def compact_by_mask(mask: Any, *arrays: Any, axis: int = 0) -> int:
|
|
447
464
|
"""Move the entries where `mask` is True to the front of every array, in place.
|
|
448
465
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|