Skip to content

Commit b365678

Browse files
aarongreigkbenzie
authored andcommitted
Fix rebase issues
1 parent cca747d commit b365678

File tree

5 files changed

+5
-156
lines changed

5 files changed

+5
-156
lines changed

include/ur_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ typedef enum ur_function_t {
226226
UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP = 226, ///< Enumerator for ::urBindlessImagesImportExternalMemoryExp
227227
UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP = 227, ///< Enumerator for ::urBindlessImagesImportExternalSemaphoreExp
228228
UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP = 228, ///< Enumerator for ::urEnqueueNativeCommandExp
229-
UR_FUNCTION_LOADER_CONFIG_SET_MOCKING_ENABLED = 231, ///< Enumerator for ::urLoaderConfigSetMockingEnabled
229+
UR_FUNCTION_LOADER_CONFIG_SET_MOCKING_ENABLED = 229, ///< Enumerator for ::urLoaderConfigSetMockingEnabled
230230
/// @cond
231231
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
232232
/// @endcond

scripts/core/INTRO.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ For more information about the usage of mentioned environment variables see `Env
259259
Mocking
260260
---------------------
261261
A mock UR adapter can be accessed for test purposes by enabling it via
262-
${x}LoaderConfigSetMockingEnabled.
262+
${x}LoaderConfigSetMockingEnabled.
263263

264264
The default fallback behavior for entry points in the mock adapter is to simply
265265
return ``UR_RESULT_SUCCESS``. For entry points concerning handles, i.e. those

scripts/core/registry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ etors:
594594
value: '228'
595595
- name: LOADER_CONFIG_SET_MOCKING_ENABLED
596596
desc: Enumerator for $xLoaderConfigSetMockingEnabled
597-
value: '231'
597+
value: '229'
598598
---
599599
type: enum
600600
desc: Defines structure types

scripts/templates/ldrddi.cpp.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ namespace ur_loader
271271
del add_local
272272
%>
273273
%for i, item in enumerate(epilogue):
274-
%if 0 == i and not item['release'] and not th.always_wrap_outputs(obj):
274+
%if 0 == i and not item['release'] and not item['retain'] and not th.always_wrap_outputs(obj):
275275
if( ${X}_RESULT_SUCCESS != result )
276276
return result;
277277
@@ -281,7 +281,7 @@ namespace ur_loader
281281
##%if item['release']:
282282
##// release loader handle
283283
##${item['factory']}.release( ${item['name']} );
284-
%if not item['release'] and not '_native_object_' in item['obj'] or th.make_func_name(n, tags, obj) == 'urPlatformCreateWithNativeHandle':
284+
%if not item['release'] and not item['retain'] and not '_native_object_' in item['obj'] or th.make_func_name(n, tags, obj) == 'urPlatformCreateWithNativeHandle':
285285
try
286286
{
287287
%if 'typename' in item:

source/loader/ur_ldrddi.cpp

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,6 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain(
122122
// forward to device-platform
123123
result = pfnAdapterRetain(hAdapter);
124124

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-
137125
return result;
138126
}
139127

@@ -615,18 +603,6 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain(
615603
// forward to device-platform
616604
result = pfnRetain(hDevice);
617605

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-
630606
return result;
631607
}
632608

@@ -904,18 +880,6 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain(
904880
// forward to device-platform
905881
result = pfnRetain(hContext);
906882

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-
919883
return result;
920884
}
921885

@@ -1222,18 +1186,6 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain(
12221186
// forward to device-platform
12231187
result = pfnRetain(hMem);
12241188

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-
12371189
return result;
12381190
}
12391191

@@ -1592,18 +1544,6 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain(
15921544
// forward to device-platform
15931545
result = pfnRetain(hSampler);
15941546

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-
16071547
return result;
16081548
}
16091549

@@ -2039,18 +1979,6 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain(
20391979
// forward to device-platform
20401980
result = pfnPoolRetain(pPool);
20411981

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-
20541982
return result;
20551983
}
20561984

@@ -2438,18 +2366,6 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain(
24382366
// forward to device-platform
24392367
result = pfnRetain(hPhysicalMem);
24402368

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-
24532369
return result;
24542370
}
24552371

@@ -2698,18 +2614,6 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain(
26982614
// forward to device-platform
26992615
result = pfnRetain(hProgram);
27002616

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-
27132617
return result;
27142618
}
27152619

@@ -3300,18 +3204,6 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain(
33003204
// forward to device-platform
33013205
result = pfnRetain(hKernel);
33023206

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-
33153207
return result;
33163208
}
33173209

@@ -3759,18 +3651,6 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain(
37593651
// forward to device-platform
37603652
result = pfnRetain(hQueue);
37613653

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-
37743654
return result;
37753655
}
37763656

@@ -4079,18 +3959,6 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain(
40793959
// forward to device-platform
40803960
result = pfnRetain(hEvent);
40813961

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-
40943962
return result;
40953963
}
40963964

@@ -6756,19 +6624,6 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp(
67566624
// forward to device-platform
67576625
result = pfnRetainExp(hCommandBuffer);
67586626

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-
67726627
return result;
67736628
}
67746629

@@ -7514,12 +7369,6 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
75147369
// forward to device-platform
75157370
result = pfnRetainCommandExp(hCommand);
75167371

7517-
if (UR_RESULT_SUCCESS != result) {
7518-
return result;
7519-
}
7520-
7521-
// TODO: do we need to ref count the loader handles?
7522-
75237372
return result;
75247373
}
75257374

0 commit comments

Comments
 (0)