Skip to content

Commit 6f15e42

Browse files
committed
[HIP] Fix error code for urContextCreateWithNativeHandle
Mirrors a similar change made to the CUDA adapater in 00761dc.
1 parent a1094cd commit 6f15e42

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

source/adapters/cuda/context.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle(
142142
}
143143

144144
UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
145-
ur_native_handle_t hNativeContext, uint32_t numDevices,
146-
const ur_device_handle_t *phDevices,
147-
const ur_context_native_properties_t *pProperties,
148-
ur_context_handle_t *phContext) {
149-
std::ignore = hNativeContext;
150-
std::ignore = numDevices;
151-
std::ignore = phDevices;
152-
std::ignore = pProperties;
153-
std::ignore = phContext;
154-
145+
[[maybe_unused]] ur_native_handle_t hNativeContext,
146+
[[maybe_unused]] uint32_t numDevices,
147+
[[maybe_unused]] const ur_device_handle_t *phDevices,
148+
[[maybe_unused]] const ur_context_native_properties_t *pProperties,
149+
[[maybe_unused]] ur_context_handle_t *phContext) {
155150
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
156151
}
157152

source/adapters/hip/context.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle(
119119
}
120120

121121
UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
122-
ur_native_handle_t, uint32_t, const ur_device_handle_t *,
123-
const ur_context_native_properties_t *, ur_context_handle_t *) {
124-
return UR_RESULT_ERROR_INVALID_OPERATION;
122+
[[maybe_unused]] ur_native_handle_t hNativeContext,
123+
[[maybe_unused]] uint32_t numDevices,
124+
[[maybe_unused]] const ur_device_handle_t *phDevices,
125+
[[maybe_unused]] const ur_context_native_properties_t *pProperties,
126+
[[maybe_unused]] ur_context_handle_t *phContext) {
127+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
125128
}
126129

127130
UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter(
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
urContextCreateWithNativeHandleTest.Success/AMD_HIP_BACKEND___{{.*}}_
2-
urContextCreateWithNativeHandleTest.SuccessWithOwnedNativeHandle/AMD_HIP_BACKEND___{{.*}}_
3-
urContextCreateWithNativeHandleTest.SuccessWithUnOwnedNativeHandle/AMD_HIP_BACKEND___{{.*}}_

0 commit comments

Comments
 (0)