Skip to content

Commit ea2cc1a

Browse files
committed
restoring asserts
Signed-off-by: Chris Perkins <[email protected]>
1 parent 5c30cf5 commit ea2cc1a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sycl/source/detail/device_global_map_entry.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ namespace sycl {
1717
inline namespace _V1 {
1818
namespace 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+
2028
OwnedUrEvent DeviceGlobalUSMMem::getInitEvent(adapter_impl &Adapter) {
2129
std::lock_guard<std::mutex> Lock(MInitEventMutex);
2230
if (MInitEvent == nullptr)

sycl/source/detail/device_global_map_entry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using EventImplPtr = std::shared_ptr<sycl::detail::event_impl>;
3333

3434
struct DeviceGlobalUSMMem {
3535
DeviceGlobalUSMMem(void *Ptr) : MPtr(Ptr) {}
36-
~DeviceGlobalUSMMem() = default;
36+
~DeviceGlobalUSMMem();
3737

3838
void *const &getPtr() const noexcept { return MPtr; }
3939

0 commit comments

Comments
 (0)