@@ -122,18 +122,6 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain(
122
122
// forward to device-platform
123
123
result = pfnAdapterRetain (hAdapter);
124
124
125
- if (UR_RESULT_SUCCESS != result) {
126
- return result;
127
- }
128
-
129
- try {
130
- // convert platform handle to loader handle
131
- *hAdapter = reinterpret_cast <ur_adapter_handle_t >(
132
- ur_adapter_factory.getInstance (*hAdapter, dditable));
133
- } catch (std::bad_alloc &) {
134
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
135
- }
136
-
137
125
return result;
138
126
}
139
127
@@ -615,18 +603,6 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain(
615
603
// forward to device-platform
616
604
result = pfnRetain (hDevice);
617
605
618
- if (UR_RESULT_SUCCESS != result) {
619
- return result;
620
- }
621
-
622
- try {
623
- // convert platform handle to loader handle
624
- *hDevice = reinterpret_cast <ur_device_handle_t >(
625
- ur_device_factory.getInstance (*hDevice, dditable));
626
- } catch (std::bad_alloc &) {
627
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
628
- }
629
-
630
606
return result;
631
607
}
632
608
@@ -904,18 +880,6 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain(
904
880
// forward to device-platform
905
881
result = pfnRetain (hContext);
906
882
907
- if (UR_RESULT_SUCCESS != result) {
908
- return result;
909
- }
910
-
911
- try {
912
- // convert platform handle to loader handle
913
- *hContext = reinterpret_cast <ur_context_handle_t >(
914
- ur_context_factory.getInstance (*hContext, dditable));
915
- } catch (std::bad_alloc &) {
916
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
917
- }
918
-
919
883
return result;
920
884
}
921
885
@@ -1222,18 +1186,6 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain(
1222
1186
// forward to device-platform
1223
1187
result = pfnRetain (hMem);
1224
1188
1225
- if (UR_RESULT_SUCCESS != result) {
1226
- return result;
1227
- }
1228
-
1229
- try {
1230
- // convert platform handle to loader handle
1231
- *hMem = reinterpret_cast <ur_mem_handle_t >(
1232
- ur_mem_factory.getInstance (*hMem, dditable));
1233
- } catch (std::bad_alloc &) {
1234
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
1235
- }
1236
-
1237
1189
return result;
1238
1190
}
1239
1191
@@ -1592,18 +1544,6 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain(
1592
1544
// forward to device-platform
1593
1545
result = pfnRetain (hSampler);
1594
1546
1595
- if (UR_RESULT_SUCCESS != result) {
1596
- return result;
1597
- }
1598
-
1599
- try {
1600
- // convert platform handle to loader handle
1601
- *hSampler = reinterpret_cast <ur_sampler_handle_t >(
1602
- ur_sampler_factory.getInstance (*hSampler, dditable));
1603
- } catch (std::bad_alloc &) {
1604
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
1605
- }
1606
-
1607
1547
return result;
1608
1548
}
1609
1549
@@ -2039,18 +1979,6 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain(
2039
1979
// forward to device-platform
2040
1980
result = pfnPoolRetain (pPool);
2041
1981
2042
- if (UR_RESULT_SUCCESS != result) {
2043
- return result;
2044
- }
2045
-
2046
- try {
2047
- // convert platform handle to loader handle
2048
- *pPool = reinterpret_cast <ur_usm_pool_handle_t >(
2049
- ur_usm_pool_factory.getInstance (*pPool, dditable));
2050
- } catch (std::bad_alloc &) {
2051
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
2052
- }
2053
-
2054
1982
return result;
2055
1983
}
2056
1984
@@ -2438,18 +2366,6 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain(
2438
2366
// forward to device-platform
2439
2367
result = pfnRetain (hPhysicalMem);
2440
2368
2441
- if (UR_RESULT_SUCCESS != result) {
2442
- return result;
2443
- }
2444
-
2445
- try {
2446
- // convert platform handle to loader handle
2447
- *hPhysicalMem = reinterpret_cast <ur_physical_mem_handle_t >(
2448
- ur_physical_mem_factory.getInstance (*hPhysicalMem, dditable));
2449
- } catch (std::bad_alloc &) {
2450
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
2451
- }
2452
-
2453
2369
return result;
2454
2370
}
2455
2371
@@ -2698,18 +2614,6 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain(
2698
2614
// forward to device-platform
2699
2615
result = pfnRetain (hProgram);
2700
2616
2701
- if (UR_RESULT_SUCCESS != result) {
2702
- return result;
2703
- }
2704
-
2705
- try {
2706
- // convert platform handle to loader handle
2707
- *hProgram = reinterpret_cast <ur_program_handle_t >(
2708
- ur_program_factory.getInstance (*hProgram, dditable));
2709
- } catch (std::bad_alloc &) {
2710
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
2711
- }
2712
-
2713
2617
return result;
2714
2618
}
2715
2619
@@ -3300,18 +3204,6 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain(
3300
3204
// forward to device-platform
3301
3205
result = pfnRetain (hKernel);
3302
3206
3303
- if (UR_RESULT_SUCCESS != result) {
3304
- return result;
3305
- }
3306
-
3307
- try {
3308
- // convert platform handle to loader handle
3309
- *hKernel = reinterpret_cast <ur_kernel_handle_t >(
3310
- ur_kernel_factory.getInstance (*hKernel, dditable));
3311
- } catch (std::bad_alloc &) {
3312
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
3313
- }
3314
-
3315
3207
return result;
3316
3208
}
3317
3209
@@ -3759,18 +3651,6 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain(
3759
3651
// forward to device-platform
3760
3652
result = pfnRetain (hQueue);
3761
3653
3762
- if (UR_RESULT_SUCCESS != result) {
3763
- return result;
3764
- }
3765
-
3766
- try {
3767
- // convert platform handle to loader handle
3768
- *hQueue = reinterpret_cast <ur_queue_handle_t >(
3769
- ur_queue_factory.getInstance (*hQueue, dditable));
3770
- } catch (std::bad_alloc &) {
3771
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
3772
- }
3773
-
3774
3654
return result;
3775
3655
}
3776
3656
@@ -4079,18 +3959,6 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain(
4079
3959
// forward to device-platform
4080
3960
result = pfnRetain (hEvent);
4081
3961
4082
- if (UR_RESULT_SUCCESS != result) {
4083
- return result;
4084
- }
4085
-
4086
- try {
4087
- // convert platform handle to loader handle
4088
- *hEvent = reinterpret_cast <ur_event_handle_t >(
4089
- ur_event_factory.getInstance (*hEvent, dditable));
4090
- } catch (std::bad_alloc &) {
4091
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
4092
- }
4093
-
4094
3962
return result;
4095
3963
}
4096
3964
@@ -6756,19 +6624,6 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp(
6756
6624
// forward to device-platform
6757
6625
result = pfnRetainExp (hCommandBuffer);
6758
6626
6759
- if (UR_RESULT_SUCCESS != result) {
6760
- return result;
6761
- }
6762
-
6763
- try {
6764
- // convert platform handle to loader handle
6765
- *hCommandBuffer = reinterpret_cast <ur_exp_command_buffer_handle_t >(
6766
- ur_exp_command_buffer_factory.getInstance (*hCommandBuffer,
6767
- dditable));
6768
- } catch (std::bad_alloc &) {
6769
- result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY;
6770
- }
6771
-
6772
6627
return result;
6773
6628
}
6774
6629
@@ -7514,12 +7369,6 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
7514
7369
// forward to device-platform
7515
7370
result = pfnRetainCommandExp (hCommand);
7516
7371
7517
- if (UR_RESULT_SUCCESS != result) {
7518
- return result;
7519
- }
7520
-
7521
- // TODO: do we need to ref count the loader handles?
7522
-
7523
7372
return result;
7524
7373
}
7525
7374
0 commit comments