Skip to content

Clean up dpctl.tensor code#2797

Merged
antonwolfy merged 10 commits intoinclude-dpctl-tensorfrom
remove-unused-code
Mar 5, 2026
Merged

Clean up dpctl.tensor code#2797
antonwolfy merged 10 commits intoinclude-dpctl-tensorfrom
remove-unused-code

Conversation

@antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Mar 4, 2026

This PR adds a small clean up to already porting dpctl.tensor code:

  • remove unused includes
  • add missing includes
  • remove redundant namespace qualifications when calling function from the same namespace
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@antonwolfy antonwolfy self-assigned this Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

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

@antonwolfy antonwolfy marked this pull request as ready for review March 4, 2026 22:29
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Array API standard conformance tests for dpnp=0.20.0dev3=py313h509198e_21 ran successfully.
Passed: 1355
Failed: 2
Skipped: 16

ndgrigorian
ndgrigorian previously approved these changes Mar 4, 2026
Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM, I see no problems in this

with the simplify_iteration_space variants, many of the files use using dpctl::tensor::py_internal::... so we would have to remove those lines too, but we can do it in a follow up

- FullContigFactory is instantiated for all types including complex types
- full_contig_impl<dstTy> uses py::cast<dstTy>:
  dstTy fill_v = py::cast<dstTy>(py_value);
- When dstTy is std::complex<float> or std::complex<double>, pybind11 needs to know how to convert a Python object to that C++ type
- <pybind11/complex.h> registers the type caster for std::complex<T>, enabling py::cast<std::complex<T>>() to work
Copy link
Contributor

@vlad-perevezentsev vlad-perevezentsev left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you @antonwolfy !

@antonwolfy antonwolfy merged commit ecd4991 into include-dpctl-tensor Mar 5, 2026
97 checks passed
@antonwolfy antonwolfy deleted the remove-unused-code branch March 5, 2026 09:42
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