enable_if.hpp 584 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

namespace ck {

arai713's avatar
arai713 committed
8
#ifndef CK_CODE_GEN_RTC
Chao Liu's avatar
Chao Liu committed
9
10
11
12
13
14
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;

arai713's avatar
arai713 committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#else
template <bool B, class T = void>
struct enable_if
{
};

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;
#endif

Chao Liu's avatar
Chao Liu committed
31
} // namespace ck