-
Notifications
You must be signed in to change notification settings - Fork 1k
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
running destructors before completion of a primitive #1814
Comments
Hi @rscohn2, thanks for bringing this one. |
It does not fail with logging:
It fails in host_ptr:
Source files are in the attached zip |
For the engine kind CPU and CPU runtime SYCL the memory objects are currently required to stay alive until the primitive is complete. |
The non-blocking execution model is typically used and beneficial for GPU, is there any reason why you want to use it for CPU? |
I was looking at making the CPU async to overlap framework time with kernel time. This was a suggestion from @ddkalamk. I am trying to do a prototype to see if it helps. I guess there is some reference counting for the memory object? I am passing in a copy in the |
Storing the memory objects associated with pending operations in a |
Actually, there isn't but there should be. For the GPU kind we don't need it because the memory objects themselves are not used by the GPU kernels so the user only needs to keep the underlying buffer alive if it's USM and doesn't have to do anything if it's SYCL buffer. For the CPU kind, we re-use the classic CPU kernels written in C++ or JIT Assembly, which additionally requires the memory objects to stay alive. We plan to add the reference count mechanism in the future though the interest in SYCL CPU is quite low and therefore the task is not a high priority at this point. |
I want to launch a primitive in a function and return immediately. I am getting a segv that looks like a memory corruption. If I wait for completion before returning, it works. I think the problem is that destructors cannot run before completion. In the code below what instances cannot be destroyed before the primitive completes?
The text was updated successfully, but these errors were encountered: