enable_if.hpp 579 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
// SPDX-License-Identifier: MIT
Illia Silin's avatar
Illia Silin committed
2
// Copyright (c) 2018-2023, 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

namespace ck {
7
8
9
10
11
#ifdef __HIPCC_RTC__
template <bool B, class T = void>
struct enable_if
{
};
Chao Liu's avatar
Chao Liu committed
12

13
14
15
16
17
18
19
20
21
22
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
23
24
25
26
27
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;
28
#endif
Chao Liu's avatar
Chao Liu committed
29
} // namespace ck