Skip to content

Commit 7928a9b

Browse files
veselypetakbenzie
authored andcommitted
[HIP] Define all UR entry points
1 parent 192e940 commit 7928a9b

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

source/adapters/hip/kernel.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelCreateWithNativeHandle(
321321
const ur_kernel_native_properties_t *, ur_kernel_handle_t *) {
322322
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
323323
}
324+
325+
UR_APIEXPORT ur_result_t UR_APICALL urKernelSetSpecializationConstants(
326+
[[maybe_unused]] ur_kernel_handle_t hKernel,
327+
[[maybe_unused]] uint32_t count,
328+
[[maybe_unused]] const ur_specialization_constant_info_t *pSpecConstants) {
329+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
330+
}

source/adapters/hip/sampler.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@ ur_result_t urSamplerRelease(ur_sampler_handle_t hSampler) {
8080

8181
return UR_RESULT_SUCCESS;
8282
}
83+
84+
UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
85+
[[maybe_unused]] ur_native_handle_t hNativeSampler,
86+
[[maybe_unused]] ur_context_handle_t hContext,
87+
[[maybe_unused]] const ur_sampler_native_properties_t *pProperties,
88+
[[maybe_unused]] ur_sampler_handle_t *phSampler) {
89+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
90+
}
91+
92+
UR_APIEXPORT ur_result_t UR_APICALL
93+
urSamplerGetNativeHandle([[maybe_unused]] ur_sampler_handle_t hSampler,
94+
[[maybe_unused]] ur_native_handle_t *phNativeSampler) {
95+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
96+
}

source/adapters/hip/ur_interface_loader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable(
3838
if (UR_RESULT_SUCCESS != result) {
3939
return result;
4040
}
41-
pDdiTable->pfnCreateWithNativeHandle = nullptr;
41+
pDdiTable->pfnCreateWithNativeHandle = urPlatformCreateWithNativeHandle;
4242
pDdiTable->pfnGet = urPlatformGet;
4343
pDdiTable->pfnGetApiVersion = urPlatformGetApiVersion;
4444
pDdiTable->pfnGetInfo = urPlatformGetInfo;
45-
pDdiTable->pfnGetNativeHandle = nullptr;
45+
pDdiTable->pfnGetNativeHandle = urPlatformGetNativeHandle;
4646
pDdiTable->pfnGetBackendOption = urPlatformGetBackendOption;
4747
return UR_RESULT_SUCCESS;
4848
}
@@ -123,7 +123,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelProcAddrTable(
123123
pDdiTable->pfnSetArgSampler = urKernelSetArgSampler;
124124
pDdiTable->pfnSetArgValue = urKernelSetArgValue;
125125
pDdiTable->pfnSetExecInfo = urKernelSetExecInfo;
126-
pDdiTable->pfnSetSpecializationConstants = nullptr;
126+
pDdiTable->pfnSetSpecializationConstants = urKernelSetSpecializationConstants;
127127
return UR_RESULT_SUCCESS;
128128
}
129129

@@ -134,9 +134,9 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetSamplerProcAddrTable(
134134
return result;
135135
}
136136
pDdiTable->pfnCreate = urSamplerCreate;
137-
pDdiTable->pfnCreateWithNativeHandle = nullptr;
137+
pDdiTable->pfnCreateWithNativeHandle = urSamplerCreateWithNativeHandle;
138138
pDdiTable->pfnGetInfo = urSamplerGetInfo;
139-
pDdiTable->pfnGetNativeHandle = nullptr;
139+
pDdiTable->pfnGetNativeHandle = urSamplerGetNativeHandle;
140140
pDdiTable->pfnRelease = urSamplerRelease;
141141
pDdiTable->pfnRetain = urSamplerRetain;
142142
return UR_RESULT_SUCCESS;
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
urPlatformGetTest.InvalidNumEntries
2-
urPlatformGetNativeHandleTest.Success
3-
urPlatformGetNativeHandleTest.InvalidNullHandlePlatform
4-
urPlatformGetNativeHandleTest.InvalidNullPointerNativePlatform
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
urSamplerGetNativeHandleTest.Success/AMD_HIP_BACKEND___{{.*}}_
2-
urSamplerGetNativeHandleTest.InvalidNullHandleSampler/AMD_HIP_BACKEND___{{.*}}_
3-
urSamplerGetNativeHandleTest.InvalidNullPointerNativeHandle/AMD_HIP_BACKEND___{{.*}}_

0 commit comments

Comments
 (0)