@@ -273,8 +273,12 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
273
273
UR_CHECK_ERROR (hipMemGetAddressRange (&BasePtr, &AllocSize, Mem.Ptr ));
274
274
return AllocSize;
275
275
} else if constexpr (std::is_same_v<T, SurfaceMem>) {
276
+ #if HIP_VERSION < 50600000
277
+ throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
278
+ #else
276
279
HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
277
- UR_CHECK_ERROR (hipArray3DGetDescriptor (&ArrayDescriptor, Mem.Array ));
280
+ UR_CHECK_ERROR (
281
+ hipArray3DGetDescriptor (&ArrayDescriptor, Mem.getArray ()));
278
282
const auto PixelSizeBytes =
279
283
GetHipFormatPixelSize (ArrayDescriptor.Format ) *
280
284
ArrayDescriptor.NumChannels ;
@@ -284,6 +288,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
284
288
(ArrayDescriptor.Height ? ArrayDescriptor.Height : 1 ) *
285
289
(ArrayDescriptor.Depth ? ArrayDescriptor.Depth : 1 );
286
290
return ImageSizeBytes;
291
+ #endif
287
292
} else {
288
293
static_assert (ur_always_false_t <T>, " Not exhaustive visitor!" );
289
294
}
@@ -535,10 +540,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
535
540
UrReturnHelper ReturnValue (propSize, pPropValue, pPropSizeRet);
536
541
537
542
try {
538
-
539
543
HIP_ARRAY3D_DESCRIPTOR ArrayInfo;
544
+ #if HIP_VERSION >= 50600000
540
545
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
542
550
543
551
const auto hip2urFormat =
544
552
[](hipArray_Format HipFormat) -> ur_image_channel_type_t {
0 commit comments