File size: 3,199 Bytes
21f3d42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# Base numeric types and transcendental functions.

licenses(["notice"])

cc_library(
    name = "fast_transcendentals",
    srcs = [
        "fast_transcendentals.cc",
    ],
    hdrs = [
        "fast_transcendentals.h",
    ],
    visibility = [
        "//sparse_matmul:__subpackages__",
    ],
    deps = [":types"],
)

cc_library(
    name = "test_utils",
    testonly = 1,
    hdrs = [
        "test_utils.h",
    ],
    visibility = ["//sparse_matmul:__subpackages__"],
    deps = [
        ":types",
        "@com_google_googletest//:gtest",
    ],
)

cc_library(
    name = "types",
    hdrs = [
        "fixed_types.h",
        "float16_types.h",
        "type_utils.h",
    ],
    visibility = [
        "//sparse_matmul:__subpackages__",
    ],
    deps = [
        "@com_google_glog//:glog",
    ],
)

cc_library(
    name = "fast_transcendentals_cc",
    srcs = ["fast_transcendentals.cc"],
    hdrs = ["fast_transcendentals.h"],
    deps = [":types"],
)

cc_test(
    name = "fasttranscendentals_test",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fasttranscendentals_test_fast",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    copts = ["-DFAST_TRANSCENDENTALS"],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fasttranscendentals_test_fast_accurate",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    copts = [
        "-DFAST_TRANSCENDENTALS",
        "-DACCURATE_TRANSCENDENTAL_APPROX",
    ],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fasttranscendentals_test_fast_accurate_sigmoidastanh",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    copts = [
        "-DFAST_TRANSCENDENTALS",
        "-DACCURATE_TRANSCENDENTAL_APPROX",
        "-DSIGMOID_AS_TANH",
    ],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fasttranscendentals_test_fast_sigmoidastanh",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    copts = [
        "-DFAST_TRANSCENDENTALS",
        "-DSIGMOID_AS_TANH",
    ],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fasttranscendentals_test_faster_sigmoid",
    size = "small",
    srcs = [
        "fasttranscendentals_test.cc",
    ],
    copts = [
        "-DFASTER_TRANSCENDENTALS",
    ],
    deps = [
        ":fast_transcendentals",
        ":test_utils",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "fixed_types_test",
    size = "small",
    srcs = [
        "fixed_types_test.cc",
    ],
    deps = [
        ":test_utils",
        ":types",
        "@com_google_googletest//:gtest_main",
    ],
)