Skip to content

[cleanup/tensor, part 2] Modularized tests for contiguity, retrieval of PyUSMArrayObject* and removed use of a global variable. #931

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 4 commits into from
Oct 13, 2022

Conversation

oleksandr-pavlyk
Copy link
Contributor

Introduced dpctl::tensor::usm_ndarray::is_c_contiguous and dpctl::tensor::usm_ndarray::is_f_contiguous and used them in tensor_py.cpp.

Modularized common operation of retrieving PyUSMArrayObject * into a private method and used it in methods of dpctl::tensor::usm_ndarray.

Got rid of global variable static dpctl::tensor::detail::usm_ndarray_types array_types in tensor_py.cpp. Since the type implements singleton, call its get() method at each use site.

  • Have you provided a meaningful PR description?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?

@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.0dev0=py310h8c27c75_175 ran successfully.
Passed: 33
Failed: 801
Skipped: 3138

@oleksandr-pavlyk oleksandr-pavlyk changed the title Cleanup tensor step2 [cleanup/tensor, part 2] Modularized tests for contiguity, retrieval of PyUSMArrayObject* and removed use of a global variable. Oct 12, 2022
Use -O1 when compiling tensor_py for now to work around suspected issue
with loading of C-API functions.
…es`.

The class is already singleton. Instead create a local variable at
each use site. This local variable is going to be a constant reference
to the singleton.
@oleksandr-pavlyk oleksandr-pavlyk requested review from diptorupd, npolina4 and ndgrigorian and removed request for npolina4 October 12, 2022 18:16
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.0dev0=py310h8c27c75_175 ran successfully.
Passed: 33
Failed: 801
Skipped: 3138

@oleksandr-pavlyk
Copy link
Contributor Author

@diptorupd ping

Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

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

Overall looks fine to me. I am unable to go into too much detail with the review. As CI is gree, please merge!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 798ecca into cleanup/tensor Oct 13, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the cleanup-tensor-step2 branch October 13, 2022 20:56
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request Oct 17, 2022
3 tasks
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.

2 participants