Skip to content

Commit 5cde537

Browse files
wenju-hepbalcer
authored andcommitted
ur_unreachable -> ur::unreachable
1 parent d45f09e commit 5cde537

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

source/adapters/cuda/usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ urUSMGetMemAllocInfo(ur_context_handle_t hContext, const void *pMem,
227227
return ReturnValue(UR_USM_TYPE_HOST);
228228
}
229229
// should never get here
230-
ur_unreachable();
230+
ur::unreachable();
231231
}
232232
case UR_USM_ALLOC_INFO_BASE_PTR: {
233233
#if CUDA_VERSION >= 10020

source/adapters/hip/usm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ urUSMGetMemAllocInfo(ur_context_handle_t hContext, const void *pMem,
190190
return ReturnValue(UR_USM_TYPE_HOST);
191191
}
192192
// should never get here
193-
ur_unreachable();
193+
ur::unreachable();
194194
}
195195
case UR_USM_ALLOC_INFO_DEVICE: {
196196
// get device index associated with this pointer

source/adapters/native_cpu/kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
173173
return ReturnValue(0);
174174
}
175175
case UR_KERNEL_SUB_GROUP_INFO_FORCE_UINT32: {
176-
ur_unreachable();
176+
ur::unreachable();
177177
}
178178
}
179179
DIE_NO_IMPLEMENTATION;

source/common/ur_util.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,14 @@ inline ur_result_t exceptionToResult(std::exception_ptr eptr) {
298298

299299
template <class> inline constexpr bool ur_always_false_t = false;
300300

301-
[[noreturn]] inline void ur_unreachable() {
301+
namespace ur {
302+
[[noreturn]] inline void unreachable() {
302303
#ifdef _MSC_VER
303304
__assume(0);
304305
#else
305306
__builtin_unreachable();
306307
#endif
307308
}
309+
} // namespace ur
308310

309311
#endif /* UR_UTIL_H */

tools/urtrace/collector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ std::unique_ptr<TraceWriter> create_writer() {
277277
case OUTPUT_JSON:
278278
return std::make_unique<JsonWriter>();
279279
default:
280-
ur_unreachable();
280+
ur::unreachable();
281281
}
282282
return nullptr;
283283
}

0 commit comments

Comments
 (0)