Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImport `using_allocator` in `cupy.cuda` #2951
Conversation
|
depends on #2952 |
|
Why does it depend on #2952? |
|
They share a commit, @jakirkham should make them independent or rebase this one after #2952 is merged |
|
It seems they don't share a commit and I think we can merge this PR and discard the other one. |
|
|
|
PR ( #2952 ) could be backported to |
And the content is different, too. @jakirkham This PR breaks existing code that use |
|
Ok happy to defer |
|
I just got the flow of the two prs |
|
No worries. Sorry for not being clearer. |
|
Might be the sphinx error related to the function being a context manager? |
|
It looks like Travis CI is using Python 3.5.6. Is that needed or can we update to a newer Python version? |
|
My guess is using |
|
That approach should be fine. |
|
Have pushed a few changes. These rewrite |
|
Jenkins, test this please |
|
Successfully created a job for commit 86abf0d: |
|
Jenkins CI test (for commit 86abf0d, target branch master) failed with status FAILURE. |
|
Had missed updating the tests. This seems to fix them except for one test that is checking for a |
0d9282e
to
1f0e295
As wrapping the Cython `using_allocator` with `contextmanager` is problematic for documentation, make room for a Python wrapper that can be a `contextmanager`. Do this by dropping the `contextmanager` bit from the Cython implementation, mark it as private, and finally stop importing it in `cupy.cuda`. Can follow this by wrapping it at the Python level.
Provide a `contextmanager` at the Python level by simply calling the Cython generator in a loop and `yield`ing it's contents. This should only ever be one `yield`, but it does ensure the correct behavior with respect to setup and teardown. As there is no special error handling in the Python function, skip this part. Make a note in the docs that this is a wrapper and why it exists.
1f0e295
to
e12cc54
|
Ok, simplified things a fair bit. Expect this should work better. Could use another run on Jenkins when you have a chance @emcastillo |
|
Should add this worked for me locally as well. |
|
Jenkins, test this please |
|
Successfully created a job for commit e12cc54: |
|
Jenkins CI test (for commit e12cc54, target branch master) failed with status FAILURE. |
|
Jenkins went nuts, lets try it again. |
|
Successfully created a job for commit e12cc54: |
|
No worries. Thanks for the help @emcastillo! |
|
Jenkins CI test (for commit e12cc54, target branch master) succeeded! |
Import `using_allocator` in `cupy.cuda`

jakirkham commentedJan 13, 2020
cc @emcastillo