File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,14 @@ namespace sycl {
1717inline namespace _V1 {
1818namespace detail {
1919
20+ DeviceGlobalUSMMem::~DeviceGlobalUSMMem () {
21+ // removeAssociatedResources is expected to have cleaned up both the pointer
22+ // and the event. When asserts are enabled the values are set, so we check
23+ // these here.
24+ assert (MPtr == nullptr && " MPtr has not been cleaned up." );
25+ assert (MInitEvent == nullptr && " MInitEvent has not been cleaned up." );
26+ }
27+
2028OwnedUrEvent DeviceGlobalUSMMem::getInitEvent (adapter_impl &Adapter) {
2129 std::lock_guard<std::mutex> Lock (MInitEventMutex);
2230 if (MInitEvent == nullptr )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ using EventImplPtr = std::shared_ptr<sycl::detail::event_impl>;
3333
3434struct DeviceGlobalUSMMem {
3535 DeviceGlobalUSMMem (void *Ptr) : MPtr(Ptr) {}
36- ~DeviceGlobalUSMMem () = default ;
36+ ~DeviceGlobalUSMMem ();
3737
3838 void *const &getPtr () const noexcept { return MPtr; }
3939
You can’t perform that action at this time.
0 commit comments