-
Notifications
You must be signed in to change notification settings - Fork 246
SVM bind_to_queue
and unbind_queue
cannot be safely used
#645
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
Comments
Is Also would you be able to clarify this question a little bit more? I'm struggling to understand what exactly the issue is and what a "holder" object is. |
Yes.
Sure. Take a look at the OpenCL documentation for
Which queues will need to be waited on before deallocation? |
Thank you for the clarification, I'm starting to understand it better now.
So the queues that will need to be waited on before deallocation would be the ones that still have pending SVM tasks to do otherwise we would be releasing the memory of the overlying queue while not doing the same to the underlying one, right? And if I'm understanding this right then for our example In order to fix this we would need a stack-like structure, so that when we call the command |
There's no practical way to detect which queues those are.
Not sure what you mean, please define.
Lines 3869 to 3877 in ca1de86
But that's insufficient, since more work could be enqueued on So, in summary, |
Oh okay thank you for correcting me! Over the past days I have been tinkering with the code a little to get a hold of what the functions do and to overall just understand pyopencl better. However, I still find it a little difficult to fully understand the codebase (as this is my first time diving deep into one like this). At first it was a little overwhelming to navigate through all the files and try to understand what each piece was doing, but it got a little better the more time I spent on it. Would you be able to guide me on how to better understand the source code so that I can try fixing this issue better? I am always eager to learn more and can pick things up quick and do not plan on giving up on fixing this issue! |
Since they modify the allocation in place, they're unusable e.g. in the array. Consider the expression
ary2 = ary.with_queue(None)
, which one might think should unbind underlying SVM from the queue. Butary
is still ailve, and bothary
andary2
refer to the same allocation.Instead, we need some sort of "holder" object that inserts a queue into a list of queues that need to be synchronized with when freeing the SVM.
cc @matthiasdiener
The text was updated successfully, but these errors were encountered: