@@ -274,7 +274,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
274274 return AllocSize;
275275 } else if constexpr (std::is_same_v<T, SurfaceMem>) {
276276 HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
277- UR_CHECK_ERROR (hipArray3DGetDescriptor (&ArrayDescriptor, Mem.Array ));
277+ #if HIP_VERSION_MAJOR >= 5 && HIP_VERSION_MINOR >= 6
278+ UR_CHECK_ERROR (
279+ hipArray3DGetDescriptor (&ArrayDescriptor, Mem.getArray ()));
280+ #else
281+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
282+ #endif
278283 const auto PixelSizeBytes =
279284 GetHipFormatPixelSize (ArrayDescriptor.Format ) *
280285 ArrayDescriptor.NumChannels ;
@@ -535,10 +540,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
535540 UrReturnHelper ReturnValue (propSize, pPropValue, pPropSizeRet);
536541
537542 try {
538-
539543 HIP_ARRAY3D_DESCRIPTOR ArrayInfo;
544+ #if HIP_VERSION_MAJOR >= 5 && HIP_VERSION_MINOR >= 6
540545 UR_CHECK_ERROR (hipArray3DGetDescriptor (
541- &ArrayInfo, std::get<SurfaceMem>(hMemory->Mem ).Array ));
546+ &ArrayInfo, std::get<SurfaceMem>(hMemory->Mem ).getArray ()));
547+ #else
548+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
549+ #endif
542550
543551 const auto hip2urFormat =
544552 [](hipArray_Format HipFormat) -> ur_image_channel_type_t {
0 commit comments