@@ -71,12 +71,12 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease(
71
71
}
72
72
}
73
73
74
- ur_result_t result = pfnAdapterRelease (hAdapter);
75
-
76
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
74
+ if (getContext ()->enableLeakChecking ) {
77
75
getContext ()->refCountContext ->decrementRefCount (hAdapter, true );
78
76
}
79
77
78
+ ur_result_t result = pfnAdapterRelease (hAdapter);
79
+
80
80
return result;
81
81
}
82
82
@@ -99,7 +99,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain(
99
99
100
100
ur_result_t result = pfnAdapterRetain (hAdapter);
101
101
102
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
102
+ if (getContext ()->enableLeakChecking ) {
103
103
getContext ()->refCountContext ->incrementRefCount (hAdapter, true );
104
104
}
105
105
@@ -558,7 +558,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain(
558
558
559
559
ur_result_t result = pfnRetain (hDevice);
560
560
561
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
561
+ if (getContext ()->enableLeakChecking ) {
562
562
getContext ()->refCountContext ->incrementRefCount (hDevice, false );
563
563
}
564
564
@@ -583,12 +583,12 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease(
583
583
}
584
584
}
585
585
586
- ur_result_t result = pfnRelease (hDevice);
587
-
588
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
586
+ if (getContext ()->enableLeakChecking ) {
589
587
getContext ()->refCountContext ->decrementRefCount (hDevice, false );
590
588
}
591
589
590
+ ur_result_t result = pfnRelease (hDevice);
591
+
592
592
return result;
593
593
}
594
594
@@ -861,7 +861,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain(
861
861
862
862
ur_result_t result = pfnRetain (hContext);
863
863
864
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
864
+ if (getContext ()->enableLeakChecking ) {
865
865
getContext ()->refCountContext ->incrementRefCount (hContext, false );
866
866
}
867
867
@@ -886,12 +886,12 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease(
886
886
}
887
887
}
888
888
889
- ur_result_t result = pfnRelease (hContext);
890
-
891
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
889
+ if (getContext ()->enableLeakChecking ) {
892
890
getContext ()->refCountContext ->decrementRefCount (hContext, false );
893
891
}
894
892
893
+ ur_result_t result = pfnRelease (hContext);
894
+
895
895
return result;
896
896
}
897
897
@@ -1248,7 +1248,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain(
1248
1248
1249
1249
ur_result_t result = pfnRetain (hMem);
1250
1250
1251
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
1251
+ if (getContext ()->enableLeakChecking ) {
1252
1252
getContext ()->refCountContext ->incrementRefCount (hMem, false );
1253
1253
}
1254
1254
@@ -1273,12 +1273,12 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease(
1273
1273
}
1274
1274
}
1275
1275
1276
- ur_result_t result = pfnRelease (hMem);
1277
-
1278
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
1276
+ if (getContext ()->enableLeakChecking ) {
1279
1277
getContext ()->refCountContext ->decrementRefCount (hMem, false );
1280
1278
}
1281
1279
1280
+ ur_result_t result = pfnRelease (hMem);
1281
+
1282
1282
return result;
1283
1283
}
1284
1284
@@ -1657,7 +1657,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain(
1657
1657
1658
1658
ur_result_t result = pfnRetain (hSampler);
1659
1659
1660
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
1660
+ if (getContext ()->enableLeakChecking ) {
1661
1661
getContext ()->refCountContext ->incrementRefCount (hSampler, false );
1662
1662
}
1663
1663
@@ -1682,12 +1682,12 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease(
1682
1682
}
1683
1683
}
1684
1684
1685
- ur_result_t result = pfnRelease (hSampler);
1686
-
1687
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
1685
+ if (getContext ()->enableLeakChecking ) {
1688
1686
getContext ()->refCountContext ->decrementRefCount (hSampler, false );
1689
1687
}
1690
1688
1689
+ ur_result_t result = pfnRelease (hSampler);
1690
+
1691
1691
return result;
1692
1692
}
1693
1693
@@ -2154,7 +2154,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain(
2154
2154
2155
2155
ur_result_t result = pfnPoolRetain (pPool);
2156
2156
2157
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
2157
+ if (getContext ()->enableLeakChecking ) {
2158
2158
getContext ()->refCountContext ->incrementRefCount (pPool, false );
2159
2159
}
2160
2160
@@ -2178,12 +2178,12 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease(
2178
2178
}
2179
2179
}
2180
2180
2181
- ur_result_t result = pfnPoolRelease (pPool);
2182
-
2183
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
2181
+ if (getContext ()->enableLeakChecking ) {
2184
2182
getContext ()->refCountContext ->decrementRefCount (pPool, false );
2185
2183
}
2186
2184
2185
+ ur_result_t result = pfnPoolRelease (pPool);
2186
+
2187
2187
return result;
2188
2188
}
2189
2189
@@ -2631,7 +2631,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain(
2631
2631
2632
2632
ur_result_t result = pfnRetain (hPhysicalMem);
2633
2633
2634
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
2634
+ if (getContext ()->enableLeakChecking ) {
2635
2635
getContext ()->refCountContext ->incrementRefCount (hPhysicalMem, false );
2636
2636
}
2637
2637
@@ -2656,12 +2656,12 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease(
2656
2656
}
2657
2657
}
2658
2658
2659
- ur_result_t result = pfnRelease (hPhysicalMem);
2660
-
2661
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
2659
+ if (getContext ()->enableLeakChecking ) {
2662
2660
getContext ()->refCountContext ->decrementRefCount (hPhysicalMem, false );
2663
2661
}
2664
2662
2663
+ ur_result_t result = pfnRelease (hPhysicalMem);
2664
+
2665
2665
return result;
2666
2666
}
2667
2667
@@ -2952,7 +2952,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain(
2952
2952
2953
2953
ur_result_t result = pfnRetain (hProgram);
2954
2954
2955
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
2955
+ if (getContext ()->enableLeakChecking ) {
2956
2956
getContext ()->refCountContext ->incrementRefCount (hProgram, false );
2957
2957
}
2958
2958
@@ -2977,12 +2977,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease(
2977
2977
}
2978
2978
}
2979
2979
2980
- ur_result_t result = pfnRelease (hProgram);
2981
-
2982
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
2980
+ if (getContext ()->enableLeakChecking ) {
2983
2981
getContext ()->refCountContext ->decrementRefCount (hProgram, false );
2984
2982
}
2985
2983
2984
+ ur_result_t result = pfnRelease (hProgram);
2985
+
2986
2986
return result;
2987
2987
}
2988
2988
@@ -3618,7 +3618,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain(
3618
3618
3619
3619
ur_result_t result = pfnRetain (hKernel);
3620
3620
3621
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
3621
+ if (getContext ()->enableLeakChecking ) {
3622
3622
getContext ()->refCountContext ->incrementRefCount (hKernel, false );
3623
3623
}
3624
3624
@@ -3643,12 +3643,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease(
3643
3643
}
3644
3644
}
3645
3645
3646
- ur_result_t result = pfnRelease (hKernel);
3647
-
3648
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
3646
+ if (getContext ()->enableLeakChecking ) {
3649
3647
getContext ()->refCountContext ->decrementRefCount (hKernel, false );
3650
3648
}
3651
3649
3650
+ ur_result_t result = pfnRelease (hKernel);
3651
+
3652
3652
return result;
3653
3653
}
3654
3654
@@ -4138,7 +4138,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain(
4138
4138
4139
4139
ur_result_t result = pfnRetain (hQueue);
4140
4140
4141
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
4141
+ if (getContext ()->enableLeakChecking ) {
4142
4142
getContext ()->refCountContext ->incrementRefCount (hQueue, false );
4143
4143
}
4144
4144
@@ -4163,12 +4163,12 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease(
4163
4163
}
4164
4164
}
4165
4165
4166
- ur_result_t result = pfnRelease (hQueue);
4167
-
4168
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
4166
+ if (getContext ()->enableLeakChecking ) {
4169
4167
getContext ()->refCountContext ->decrementRefCount (hQueue, false );
4170
4168
}
4171
4169
4170
+ ur_result_t result = pfnRelease (hQueue);
4171
+
4172
4172
return result;
4173
4173
}
4174
4174
@@ -4454,7 +4454,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain(
4454
4454
4455
4455
ur_result_t result = pfnRetain (hEvent);
4456
4456
4457
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS ) {
4457
+ if (getContext ()->enableLeakChecking ) {
4458
4458
getContext ()->refCountContext ->incrementRefCount (hEvent, false );
4459
4459
}
4460
4460
@@ -4478,12 +4478,12 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease(
4478
4478
}
4479
4479
}
4480
4480
4481
- ur_result_t result = pfnRelease (hEvent);
4482
-
4483
- if (getContext ()->enableLeakChecking && result == UR_RESULT_SUCCESS) {
4481
+ if (getContext ()->enableLeakChecking ) {
4484
4482
getContext ()->refCountContext ->decrementRefCount (hEvent, false );
4485
4483
}
4486
4484
4485
+ ur_result_t result = pfnRelease (hEvent);
4486
+
4487
4487
return result;
4488
4488
}
4489
4489
0 commit comments