Skip to content

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

Merged
oleksandr-pavlyk merged 4 commits intocleanup/tensorfrom
cleanup-tensor-step2
Oct 13, 2022
Merged

[cleanup/tensor, part 2] Modularized tests for contiguity, retrieval of PyUSMArrayObject* and removed use of a global variable.#931
oleksandr-pavlyk merged 4 commits intocleanup/tensorfrom
cleanup-tensor-step2

Conversation

@oleksandr-pavlyk
Copy link
Copy Markdown
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
Copy Markdown

@github-actions
Copy link
Copy Markdown

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, ndgrigorian and npolina4 and removed request for npolina4 October 12, 2022 18:16
@github-actions
Copy link
Copy Markdown

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

@oleksandr-pavlyk
Copy link
Copy Markdown
Contributor Author

@diptorupd ping

Copy link
Copy Markdown
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
Copy Markdown

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