-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of missing arguments in dpnp.count_nonzero
#1615
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
b76184a
to
5683f98
Compare
5683f98
to
28aedbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, could we add all data types to tests/test_counting.py::test_count_nonzero
?
Done. Thank you for catching that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @antonwolfy
The PR is about to fully get rid of fallback on numpy in
dpnp.count_nonzero
function. It requires to implement support of remaining arguments there.Another added improvement here is to calculate the result using kernel submitting to a device rather than copying input data to shared USM memory and performing computing on the host.
The implementation is done through
dpnp.sum
call for an input array casted to bool type.It is enough to demonstrate a huge performance improvements for the
dpnp.count_nonzero
call time. Meanwhile there is possible future improvement by implementation a SYCL extension with separate kernel specific tocount_nonzero
operation.