samskalicky edited a comment on pull request #6292:
URL: https://github.com/apache/incubator-tvm/pull/6292#issuecomment-675291030


   This still doesnt fix my problem in #5986. But I think its going in the 
right direction. Now we have a long-lived device object that wont be destroyed. 
But we cannot access it anymore after the `DeviceAPIManager` and its child 
`DeviceAPI` objects have already been deleted in the global scope when 
attempting to access from the NDArray deleter `DefaultDeleter`. In the deleter 
its calling `tvm::runtime::DeviceAPI::Get` to get the DeviceAPI pointer.
   
   Instead, what if we store the DeviceAPI pointer in the NDArray during 
creation (or whenever we set/change the context) and then use that pointer 
inside the deleter? The actual DeviceAPI object on the heap will still be 
around, so that should work. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to