File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ());
You can’t perform that action at this time.
0 commit comments