20 constexpr static bool IsConst = IsConst_;
21 constexpr static bool IsNonConst = !IsConst_;
25 using auto_const_t = std::conditional_t<IsConst, const T, T>;
27 using non_const_enable_t = std::enable_if_t<IsNonConst, T>;
36 int m_kernel_line = -1;
43 if constexpr(muda::RUNTIME_CHECK_ON)
46 m_kernel_name = details::LaunchInfoCache::current_kernel_name();
47 m_kernel_file = details::LaunchInfoCache::current_kernel_file();
48 m_kernel_line = details::LaunchInfoCache::current_kernel_line();
53 MUDA_GENERIC
const char* name()
const MUDA_NOEXCEPT
55 if constexpr(muda::RUNTIME_CHECK_ON)
57 auto n = m_viewer_name.auto_select();
64 MUDA_GENERIC
const char* kernel_name()
const MUDA_NOEXCEPT
66 if constexpr(muda::RUNTIME_CHECK_ON)
68 auto n = m_kernel_name.auto_select();
75 MUDA_GENERIC
const char* kernel_file()
const MUDA_NOEXCEPT
77 if constexpr(muda::RUNTIME_CHECK_ON)
79 auto n = m_kernel_file.auto_select();
86 MUDA_GENERIC
int kernel_line()
const MUDA_NOEXCEPT
88 if constexpr(muda::RUNTIME_CHECK_ON)
95 MUDA_INLINE MUDA_GENERIC
void copy_label(
const ViewerBase& other) MUDA_NOEXCEPT
97 if constexpr(muda::RUNTIME_CHECK_ON)
99 m_viewer_name = other.m_viewer_name;
100 m_kernel_name = other.m_kernel_name;
101 m_kernel_file = other.m_kernel_file;
102 m_kernel_line = other.m_kernel_line;
113 MUDA_INLINE MUDA_HOST
void name(
const char* n) MUDA_NOEXCEPT
115 if constexpr(muda::RUNTIME_CHECK_ON)
117 m_viewer_name = details::LaunchInfoCache::view_name(n);
123 if constexpr(muda::RUNTIME_CHECK_ON)
125 m_viewer_name = pointer;