summaryrefslogtreecommitdiffstats
path: root/library/cpp/dot_product/common.h
blob: bd72a6ed3dfb84bac962cf891ef0d738f25cd0f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

template <typename T>
struct TTriWayDotProduct {
    T LL = 1;
    T LR = 0;
    T RR = 1;
};

enum class ETriWayDotProductComputeMask: unsigned {
    // basic
    LL = 0b100,
    LR = 0b010,
    RR = 0b001,

    // useful combinations
    All = 0b111,
    Left = 0b110, // skip computation of R·R
    Right = 0b011, // skip computation of L·L
};

struct TTriWayDotProductFloatI8 {
    float LL = 0;
    float LR = 0;
    float RR = 0;
};