-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Labels
01 - Enhancement62 - Python APIChanges or additions to the Python API. Mailing list should usually be notified.Changes or additions to the Python API. Mailing list should usually be notified.
Description
Modern CPUs have a builtin popcount instruction that counts the number of 1 bit in an unsigned integer. It would be great if numpy has a routine that exposes this operation.
Both GCC and MSVC have builtin functions for this instruction.
Possible usage:
>>> np.popcount(4)
1
>>> np.popcount(np.arange(5, dtype=np.uint))
array([0, 1, 1, 2, 1])
eric-wieser, TalShor, eriknw, ChayimFriedman2, mathijs727 and 19 more
Metadata
Metadata
Assignees
Labels
01 - Enhancement62 - Python APIChanges or additions to the Python API. Mailing list should usually be notified.Changes or additions to the Python API. Mailing list should usually be notified.