Skip to content

Commit f6c476d

Browse files
author
Hugh Delaney
committed
Throw from std::visit
1 parent 1c85750 commit f6c476d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

source/adapters/hip/memory.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,6 @@ 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-
if constexpr (std::is_same_v<T, SurfaceMem>) {
269-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
270-
}
271-
#endif
272267
try {
273268
const auto MemVisitor = [](auto &&Mem) -> size_t {
274269
using T = std::decay_t<decltype(Mem)>;
@@ -279,7 +274,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
279274
return AllocSize;
280275
} else if constexpr (std::is_same_v<T, SurfaceMem>) {
281276
#if HIP_VERSION < 50600000
282-
return 0;
277+
throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
283278
#else
284279
HIP_ARRAY3D_DESCRIPTOR ArrayDescriptor;
285280
UR_CHECK_ERROR(

0 commit comments

Comments
 (0)