Skip to content

Commit 79457b2

Browse files
author
Hugh Delaney
committed
Make unsupported top level return
1 parent 686b3d7 commit 79457b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/adapters/hip/memory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
264264

265265
switch (MemInfoType) {
266266
case UR_MEM_INFO_SIZE: {
267+
#if HIP_VERSION < 50600000
268+
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
269+
#else
267270
try {
268271
const auto MemVisitor = [](auto &&Mem) -> size_t {
269272
using T = std::decay_t<decltype(Mem)>;
@@ -274,12 +277,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
274277
return AllocSize;
275278
} else if constexpr (std::is_same_v<T, SurfaceMem>) {
276279
HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
277-
#if HIP_VERSION >= 50600000
278280
UR_CHECK_ERROR(
279281
hipArray3DGetDescriptor(&ArrayDescriptor, Mem.getArray()));
280-
#else
281-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
282-
#endif
283282
const auto PixelSizeBytes =
284283
GetHipFormatPixelSize(ArrayDescriptor.Format) *
285284
ArrayDescriptor.NumChannels;
@@ -301,6 +300,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
301300
} catch (...) {
302301
return UR_RESULT_ERROR_UNKNOWN;
303302
}
303+
#endif
304304
}
305305
case UR_MEM_INFO_CONTEXT: {
306306
return ReturnValue(hMemory->getContext());

0 commit comments

Comments
 (0)