enable_if.hpp 660 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
// SPDX-License-Identifier: MIT
arai713's avatar
arai713 committed
2
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.
Chao Liu's avatar
Chao Liu committed
3

4
#pragma once
Chao Liu's avatar
Chao Liu committed
5

6
7
8
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
Chao Liu's avatar
Chao Liu committed
9
10

namespace ck {
11
#ifdef __HIPCC_RTC__
12
#ifdef CK_CODE_GEN_RTC
13
14
15
16
template <bool B, class T = void>
struct enable_if
{
};
Chao Liu's avatar
Chao Liu committed
17

18
19
20
21
22
23
24
25
26
27
template <class T>
struct enable_if<true, T>
{
    using type = T;
};

template <bool B, class T = void>
using enable_if_t = typename enable_if<B, T>::type;

#else
Chao Liu's avatar
Chao Liu committed
28
29
30
31
32
template <bool B, typename T = void>
using enable_if = std::enable_if<B, T>;

template <bool B, typename T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
33
#endif
34
#endif
Chao Liu's avatar
Chao Liu committed
35
} // namespace ck