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

#pragma once
5
6
7
8
9

#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif

10
#ifndef __HIPCC_RTC__
arai713's avatar
arai713 committed
11
#ifndef CK_CODE_GEN_RTC
12
13
#include <ostream>
#endif
14
#endif
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "ck/utility/common_header.hpp"

namespace ck {

enum struct LoopScheduler
{
    Default,
    Interwave,
};

constexpr LoopScheduler make_default_loop_scheduler()
{
#if CK_EXPERIMENTAL_DEFAULT_TO_INTER_WAVE_SCHEDULING
    return LoopScheduler::Interwave;
#else
    return LoopScheduler::Default;
#endif // if CK_EXPERIMENTAL_DEFAULT_TO_INTER_WAVE_SCHEDULING
}

} // namespace ck
36

37
#ifndef __HIPCC_RTC__
arai713's avatar
arai713 committed
38
#ifndef CK_CODE_GEN_RTC
39
40
41
42
43
44
45
46
47
48
inline std::ostream& operator<<(std::ostream& os, const ck::LoopScheduler& s)
{
    switch(s)
    {
    case ck::LoopScheduler::Default: os << "Default"; break;
    case ck::LoopScheduler::Interwave: os << "Interwave"; break;
    default: os << "";
    }
    return os;
}
49
#endif
50
#endif