Skip to content

Add dpnp.linalg.solve() function #1598

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

Merged
merged 73 commits into from
Dec 13, 2023
Merged

Add dpnp.linalg.solve() function #1598

merged 73 commits into from
Dec 13, 2023

Conversation

vlad-perevezentsev
Copy link
Collaborator

This PR adds a missing dpnp.linalg.solve() function to calculate the solution to the system of linear equations with a square coefficient matrix A and multiple right-hand sides using oneapi::mkl::lapack::gesv
The implementation is written as a pybind11 extension above required LAPACK functions.

import dpnp

a = dpnp.array([[1, 2], [3, 5]])
b = dpnp.array([1,2])

dpnp.linalg.solve(a,b)
# array([-1.,  1.])
  • 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?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

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

Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

I have a minor comment only, which can be addressed later.
Overall LGTM! Thank you @vlad-perevezentsev

@vlad-perevezentsev vlad-perevezentsev merged commit 74609d6 into master Dec 13, 2023
@vlad-perevezentsev vlad-perevezentsev deleted the impl_solve_1 branch December 13, 2023 17:28
github-actions bot added a commit that referenced this pull request Dec 13, 2023
* Add dpnp.linalg.solve() function
* Add cupy tests for dpnp.linalg.solve()
* Register a LinAlgError in dpnp.linalg submodule
* Implementation of dtype dispatching with _common_type for dpnp.linalg.solve
* Add a common_helpers.hpp file
* Add validation functions for array types and dimensions for linalg funcs
* Skip test_solve_singular_empty

---------

Co-authored-by: Anton <[email protected]> 74609d6
github-actions bot added a commit to antonwolfy/dpnp that referenced this pull request Dec 15, 2023
* Add dpnp.linalg.solve() function
* Add cupy tests for dpnp.linalg.solve()
* Register a LinAlgError in dpnp.linalg submodule
* Implementation of dtype dispatching with _common_type for dpnp.linalg.solve
* Add a common_helpers.hpp file
* Add validation functions for array types and dimensions for linalg funcs
* Skip test_solve_singular_empty

---------

Co-authored-by: Anton <[email protected]> 74609d6
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.

3 participants