reduction_common.hpp 690 Bytes
Newer Older
Umang Yadav's avatar
Umang Yadav committed
1
2
3

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
Chao Liu's avatar
Chao Liu committed
4
// SPDX-License-Identifier: MIT
Illia Silin's avatar
Illia Silin committed
5
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
Chao Liu's avatar
Chao Liu committed
6

Chao Liu's avatar
Chao Liu committed
7
#pragma once
8

Chao Liu's avatar
Chao Liu committed
9
#include "ck/utility/reduction_enums.hpp"
10

11
namespace ck {
12
13
14
15

struct float_equal_one
{
    template <class T>
16
    __host__ __device__ inline bool operator()(T x)
17
    {
18
        return x <= static_cast<T>(1.0f) and x >= static_cast<T>(1.0f);
19
20
21
22
23
24
    };
};

struct float_equal_zero
{
    template <class T>
25
    __host__ __device__ inline bool operator()(T x)
26
    {
27
        return x <= static_cast<T>(0.0f) and x >= static_cast<T>(0.0f);
28
29
30
    };
};

Chao Liu's avatar
Chao Liu committed
31
} // namespace ck
Umang Yadav's avatar
Umang Yadav committed
32
33

#pragma clang diagnostic pop