File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,8 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
301
301
ZeInitResult = ZE_RESULT_ERROR_UNINITIALIZED;
302
302
ZesResult = ZE_RESULT_ERROR_UNINITIALIZED;
303
303
304
+ resetRefCount (0 );
305
+
304
306
#ifdef UR_STATIC_LEVEL_ZERO
305
307
// Given static linking of the L0 Loader, we must delay the loader's
306
308
// destruction of its context until after the UR Adapter is destroyed.
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ template <typename getddi> struct handle_base {
233
233
uint32_t incrementRefCount () { return ++Count; }
234
234
uint32_t decrementRefCount () { return --Count; }
235
235
bool decrementAndTest () { return --Count == 0 ; }
236
- void resetRefCount () { Count = 1 ; }
236
+ void resetRefCount (uint32_t value = 1 ) { Count = value ; }
237
237
238
238
private:
239
239
std::atomic_uint32_t Count{1 };
You can’t perform that action at this time.
0 commit comments