File tree Expand file tree Collapse file tree 19 files changed +23
-22
lines changed Expand file tree Collapse file tree 19 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -846,7 +846,7 @@ urCommandBufferRetainExp(ur_exp_command_buffer_handle_t CommandBuffer) {
846
846
847
847
ur_result_t
848
848
urCommandBufferReleaseExp (ur_exp_command_buffer_handle_t CommandBuffer) {
849
- if (!CommandBuffer->decrementRefCount () == 0 )
849
+ if (!CommandBuffer->decrementAndTest () )
850
850
return UR_RESULT_SUCCESS;
851
851
852
852
UR_CALL (waitForOngoingExecution (CommandBuffer));
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ ur_device_handle_t ur_context_handle_t_::getRootDevice() const {
251
251
// from the list of tracked contexts.
252
252
ur_result_t ContextReleaseHelper (ur_context_handle_t Context) {
253
253
254
- if (!Context->decrementRefCount () == 0 )
254
+ if (!Context->decrementAndTest () )
255
255
return UR_RESULT_SUCCESS;
256
256
257
257
if (IndirectAccessTrackingEnabled) {
Original file line number Diff line number Diff line change @@ -1674,7 +1674,7 @@ ur_result_t urDeviceRetain(ur_device_handle_t Device) {
1674
1674
ur_result_t urDeviceRelease (ur_device_handle_t Device) {
1675
1675
// Root devices are destroyed during the piTearDown process.
1676
1676
if (Device->isSubDevice ()) {
1677
- if (Device->decrementRefCount () == 0 ) {
1677
+ if (Device->decrementAndTest () ) {
1678
1678
delete Device;
1679
1679
}
1680
1680
}
Original file line number Diff line number Diff line change @@ -1088,7 +1088,7 @@ ur_event_handle_t_::~ur_event_handle_t_() {
1088
1088
1089
1089
ur_result_t urEventReleaseInternal (ur_event_handle_t Event,
1090
1090
bool *isEventDeleted) {
1091
- if (!Event->decrementRefCount () == 0 )
1091
+ if (!Event->decrementAndTest () )
1092
1092
return UR_RESULT_SUCCESS;
1093
1093
1094
1094
if (Event->OriginAllocEvent ) {
Original file line number Diff line number Diff line change @@ -946,7 +946,7 @@ ur_result_t urKernelRetain(
946
946
ur_result_t urKernelRelease (
947
947
// / [in] handle for the Kernel to release
948
948
ur_kernel_handle_t Kernel) {
949
- if (!Kernel->decrementRefCount () == 0 )
949
+ if (!Kernel->decrementAndTest () )
950
950
return UR_RESULT_SUCCESS;
951
951
952
952
auto KernelProgram = Kernel->Program ;
Original file line number Diff line number Diff line change @@ -1642,7 +1642,7 @@ ur_result_t urMemRetain(
1642
1642
ur_result_t urMemRelease (
1643
1643
// / [in] handle of the memory object to release
1644
1644
ur_mem_handle_t Mem) {
1645
- if (!Mem->decrementRefCount () == 0 )
1645
+ if (!Mem->decrementAndTest () )
1646
1646
return UR_RESULT_SUCCESS;
1647
1647
1648
1648
if (Mem->isImage ()) {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ ur_result_t urPhysicalMemRetain(ur_physical_mem_handle_t hPhysicalMem) {
47
47
}
48
48
49
49
ur_result_t urPhysicalMemRelease (ur_physical_mem_handle_t hPhysicalMem) {
50
- if (!hPhysicalMem->decrementRefCount () == 0 )
50
+ if (!hPhysicalMem->decrementAndTest () )
51
51
return UR_RESULT_SUCCESS;
52
52
53
53
if (checkL0LoaderTeardown ()) {
Original file line number Diff line number Diff line change @@ -565,7 +565,7 @@ ur_result_t urProgramRetain(
565
565
ur_result_t urProgramRelease (
566
566
// / [in] handle for the Program to release
567
567
ur_program_handle_t Program) {
568
- if (!Program->decrementRefCount () == 0 )
568
+ if (!Program->decrementAndTest () )
569
569
return UR_RESULT_SUCCESS;
570
570
571
571
delete Program;
@@ -1115,7 +1115,7 @@ void ur_program_handle_t_::ur_release_program_resources(bool deletion) {
1115
1115
// must be destroyed before the Module can be destroyed. So, be sure
1116
1116
// to destroy build log before destroying the module.
1117
1117
if (!deletion) {
1118
- if (!decrementRefCount () == 0 ) {
1118
+ if (!decrementAndTest () ) {
1119
1119
return ;
1120
1120
}
1121
1121
}
Original file line number Diff line number Diff line change @@ -612,7 +612,7 @@ ur_result_t urQueueRelease(
612
612
// internal reference count. When the External Reference count == 0, then
613
613
// cleanup of the queue begins and the final decrement of the internal
614
614
// reference count is completed.
615
- static_cast <void >(Queue->decrementRefCount () == 0 );
615
+ static_cast <void >(Queue->decrementAndTest () );
616
616
return UR_RESULT_SUCCESS;
617
617
}
618
618
@@ -1588,7 +1588,7 @@ void ur_queue_handle_t_::clearEndTimeRecordings() {
1588
1588
}
1589
1589
1590
1590
ur_result_t urQueueReleaseInternal (ur_queue_handle_t Queue) {
1591
- if (!Queue->decrementRefCount () == 0 )
1591
+ if (!Queue->decrementAndTest () )
1592
1592
return UR_RESULT_SUCCESS;
1593
1593
1594
1594
for (auto &Cache : Queue->EventCaches ) {
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ ur_result_t urSamplerRetain(
131
131
ur_result_t urSamplerRelease (
132
132
// / [in] handle of the sampler object to release
133
133
ur_sampler_handle_t Sampler) {
134
- if (!Sampler->decrementRefCount () == 0 )
134
+ if (!Sampler->decrementAndTest () )
135
135
return UR_RESULT_SUCCESS;
136
136
137
137
if (checkL0LoaderTeardown ()) {
You can’t perform that action at this time.
0 commit comments