Skip to content
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

Rework implementation of dpnp.fabs function #1878

Merged
merged 29 commits into from
Jun 15, 2024
Merged

Rework implementation of dpnp.fabs function #1878

merged 29 commits into from
Jun 15, 2024

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Jun 12, 2024

The PR proposes to rework implementation of dpnp.fabs function which is quite limited now.

It assumes to have a separate _ufunc_impl pybind11 extension to aggravate all universal functions which are not provided by dpctl tensor implementation, but requires to be aligned with NumPy.

The new extension is implemented following similar approach as for _vm_impl extension and proposes to reuse existing UnaryElementwiseFunc functionality from dpctl tensor.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you filing the PR as a draft?

Copy link
Contributor

github-actions bot commented Jun 12, 2024

View rendered docs @ https://intelpython.github.io/dpnp/index.html

Base automatically changed from use-local-copy-of-dpctl-ufunc-header to master June 12, 2024 19:26
Copy link
Collaborator

@vtavana vtavana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @antonwolfy!

dpnp/dpnp_iface_mathematical.py Outdated Show resolved Hide resolved
antonwolfy and others added 2 commits June 14, 2024 11:02
Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>
@antonwolfy antonwolfy merged commit 2d50ce1 into master Jun 15, 2024
47 of 56 checks passed
@antonwolfy antonwolfy deleted the add-fabs-impl branch June 15, 2024 17:05
github-actions bot added a commit that referenced this pull request Jun 15, 2024
* Preparation to reuse common dpctl f/w for VM functions

* PoC to decouple abs implementation to separate source file

* Reuse typedef for function poiter from dpctl.tensor

* Define populating vectors by a separate macro

* Move implementation of utility functions from headers to source to resolve link issues

* Separated implementation of acos function

* Separated implementation of acosh function

* Use function to simplify strides from dpctl tensor headers

* PoC to decouple add implementation to separate source file

* Separated implementation of asin function

* Separated implementation of asinh function

* Separated implementation of atan, atan2, atanh functions

* Resolve issue with calling MKL function for undefined types

* Separated implementation of cbrt, ceil, conj, cos and cosh functions

* Separated implementation of div, exp, exp2, expm1, floor and hypot functions

* Separated implementation of ln, log1p, log2 and log10 functions

* Separated implementation of mul, pow, rint, sin and sinh functions

* Separated implementation of sqr, sqrt, sub, tan, tanh and trunc functions

* Removed unused header with types matrix

* Remove unused functions

* Use passing by reference in unary and binary funcs

* Implement dpnp.fabs function

* Create an instance of DPNPUnaryFunc for fabs

* Enable and add relating tests

* Decouple populate logic to a macro

* Resolve compilation failure on Win

* Update dpnp/dpnp_iface_mathematical.py

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>

---------

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com> 2d50ce1
vtavana added a commit that referenced this pull request Jun 16, 2024
* Preparation to reuse common dpctl f/w for VM functions

* PoC to decouple abs implementation to separate source file

* Reuse typedef for function poiter from dpctl.tensor

* Define populating vectors by a separate macro

* Move implementation of utility functions from headers to source to resolve link issues

* Separated implementation of acos function

* Separated implementation of acosh function

* Use function to simplify strides from dpctl tensor headers

* PoC to decouple add implementation to separate source file

* Separated implementation of asin function

* Separated implementation of asinh function

* Separated implementation of atan, atan2, atanh functions

* Resolve issue with calling MKL function for undefined types

* Separated implementation of cbrt, ceil, conj, cos and cosh functions

* Separated implementation of div, exp, exp2, expm1, floor and hypot functions

* Separated implementation of ln, log1p, log2 and log10 functions

* Separated implementation of mul, pow, rint, sin and sinh functions

* Separated implementation of sqr, sqrt, sub, tan, tanh and trunc functions

* Removed unused header with types matrix

* Remove unused functions

* Use passing by reference in unary and binary funcs

* Implement dpnp.fabs function

* Create an instance of DPNPUnaryFunc for fabs

* Enable and add relating tests

* Decouple populate logic to a macro

* Resolve compilation failure on Win

* Update dpnp/dpnp_iface_mathematical.py

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>

---------

Co-authored-by: vtavana <120411540+vtavana@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants