-
Notifications
You must be signed in to change notification settings - Fork 30
Cleanup tensor_py #923
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
Closed
Closed
Cleanup tensor_py #923
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
…efinition of' compilation error messages
…into a separate translation unit
Use -O1 when compiling tensor_py for now to work around suspected issue with loading of C-API functions.
dpctl_capi is using `new` to dynamically create instance of the class which imports dpctl and populates global variables used by Cython to export its API.
dpctl::tensor::detail::usm_ndarray_types is no longer a singleton, since it uses dpctl::detail::dpctl_capi to access type constants. Consequentially, many methods associated with making it singleton are removed, including method get(). It is now default constructed at use sites like an ordinary C++ class.
View rendered docs @ https://intelpython.github.io/dpctl/pulls/923/index.html |
This was referenced Oct 7, 2022
Array API standard conformance tests failed to run for dpctl=0.14.0dev0=py310h8c27c75_160. |
I am going to close this PR, and open smaller PRs for review. |
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This housekeeping PR breaks down the monolithic, single-translation-unit
tensor_py.cpp
into bunch of individual.cpp
files implementing individual Python binding functions.This separation should improve incremental rebuilding, make it easier to add more functions in separate
.hpp
and.cpp
files.It also factors out kernel implementations into stand-alone header files which can potentially be reused.
While refactoring, several problems were fixed:
api
keyword in_memory.pxd
forPyMemoryUSMDevice
class_tensor_imp.default_device_fp_type
, et. al. functions.