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,
264
264
265
265
switch (MemInfoType) {
266
266
case UR_MEM_INFO_SIZE: {
267
+ #if HIP_VERSION < 50600000
268
+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
269
+ #else
267
270
try {
268
271
const auto MemVisitor = [](auto &&Mem) -> size_t {
269
272
using T = std::decay_t <decltype (Mem)>;
@@ -274,12 +277,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
274
277
return AllocSize;
275
278
} else if constexpr (std::is_same_v<T, SurfaceMem>) {
276
279
HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
277
- #if HIP_VERSION >= 50600000
278
280
UR_CHECK_ERROR (
279
281
hipArray3DGetDescriptor (&ArrayDescriptor, Mem.getArray ()));
280
- #else
281
- return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
282
- #endif
283
282
const auto PixelSizeBytes =
284
283
GetHipFormatPixelSize (ArrayDescriptor.Format ) *
285
284
ArrayDescriptor.NumChannels ;
@@ -301,6 +300,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
301
300
} catch (...) {
302
301
return UR_RESULT_ERROR_UNKNOWN;
303
302
}
303
+ #endif
304
304
}
305
305
case UR_MEM_INFO_CONTEXT: {
306
306
return ReturnValue (hMemory->getContext ());
You can’t perform that action at this time.
0 commit comments