/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/is_detected.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/is_detected.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/utility/is_detected.hpp Source File
is_detected.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #pragma once
5 
7 
8 namespace ck {
9 
10 namespace detail {
11 template <class Default, class AlwaysVoid, template <class...> class Op, class... Args>
12 struct detector
13 {
15  using type = Default;
16 };
17 
18 template <class Default, template <class...> class Op, class... Args>
19 struct detector<Default, ck::void_t<Op<Args...>>, Op, Args...>
20 {
22  using type = Op<Args...>;
23 };
24 } // namespace detail
25 
26 struct nonesuch
27 {
28  ~nonesuch() = delete;
29  nonesuch(nonesuch const&) = delete;
30  void operator=(nonesuch const&) = delete;
31 };
32 
33 template <template <class...> class Op, class... Args>
34 using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t;
35 
36 template <typename T>
37 using is_pack2_invocable_t = decltype(ck::declval<T&>().is_pack2_invocable);
38 
39 template <typename T>
40 using is_pack4_invocable_t = decltype(ck::declval<T&>().is_pack4_invocable);
41 
42 template <typename T>
43 using is_pack8_invocable_t = decltype(ck::declval<T&>().is_pack8_invocable);
44 
45 } // namespace ck
Definition: ck.hpp:267
decltype(ck::declval< T & >().is_pack2_invocable) is_pack2_invocable_t
Definition: is_detected.hpp:37
decltype(ck::declval< T & >().is_pack4_invocable) is_pack4_invocable_t
Definition: is_detected.hpp:40
decltype(ck::declval< T & >().is_pack8_invocable) is_pack8_invocable_t
Definition: is_detected.hpp:43
typename detail::detector< nonesuch, void, Op, Args... >::value_t is_detected
Definition: is_detected.hpp:34
Definition: is_detected.hpp:13
Default type
Definition: is_detected.hpp:15
Definition: is_detected.hpp:27
void operator=(nonesuch const &)=delete
~nonesuch()=delete
nonesuch(nonesuch const &)=delete