|
5 | 5 | #include "ck/library/reference_tensor_operation/cpu/reference_conv_fwd.hpp" |
6 | 6 | #include "ck/library/utility/device_memory.hpp" |
7 | 7 | #include "ck/library/utility/host_tensor_generator.hpp" |
| 8 | +#include "profiler/common.hpp" |
8 | 9 |
|
9 | 10 | namespace ck { |
10 | 11 | namespace profiler { |
11 | 12 |
|
12 | | -template <typename DataType> |
13 | | -inline constexpr double get_rtol() |
14 | | -{ |
15 | | - if constexpr(std::is_same_v<DataType, float>) |
16 | | - { |
17 | | - return 1e-3; |
18 | | - } |
19 | | - else if constexpr(std::is_same_v<DataType, double>) |
20 | | - { |
21 | | - return 1e-6; |
22 | | - } |
23 | | - else if constexpr(std::is_same_v<DataType, ck::half_t>) |
24 | | - { |
25 | | - return 1e-3; |
26 | | - } |
27 | | - else if constexpr(std::is_same_v<DataType, ck::bhalf_t>) |
28 | | - { |
29 | | - return 5e-2; |
30 | | - } |
31 | | - else if constexpr(std::is_same_v<DataType, int32_t>) |
32 | | - { |
33 | | - return 1e-1; |
34 | | - } |
35 | | - else if constexpr(std::is_same_v<DataType, int8_t>) |
36 | | - { |
37 | | - return 1e-1; |
38 | | - } |
39 | | - else if constexpr(std::is_same_v<DataType, ck::f8_t>) |
40 | | - { |
41 | | - return 1e-1; // 240 and 224 are acceptable |
42 | | - } |
43 | | - else if constexpr(std::is_same_v<DataType, ck::bf8_t>) |
44 | | - { |
45 | | - return 1.5e-1; // 57344 and 49152 are acceptable |
46 | | - } |
47 | | - else |
48 | | - { |
49 | | - return 1e-3; |
50 | | - } |
51 | | -} |
52 | | - |
53 | | -template <typename DataType> |
54 | | -inline constexpr double get_atol() |
55 | | -{ |
56 | | - if constexpr(std::is_same_v<DataType, float>) |
57 | | - { |
58 | | - return 1e-3; |
59 | | - } |
60 | | - else if constexpr(std::is_same_v<DataType, double>) |
61 | | - { |
62 | | - return 1e-6; |
63 | | - } |
64 | | - else if constexpr(std::is_same_v<DataType, ck::half_t>) |
65 | | - { |
66 | | - return 1e-3; |
67 | | - } |
68 | | - else if constexpr(std::is_same_v<DataType, ck::bhalf_t>) |
69 | | - { |
70 | | - return 5e-2; |
71 | | - } |
72 | | - else if constexpr(std::is_same_v<DataType, int32_t>) |
73 | | - { |
74 | | - return 1e-1; |
75 | | - } |
76 | | - else if constexpr(std::is_same_v<DataType, int8_t>) |
77 | | - { |
78 | | - return 1e-1; |
79 | | - } |
80 | | - else if constexpr(std::is_same_v<DataType, ck::f8_t>) |
81 | | - { |
82 | | - return 16.1; // 240 and 224 are acceptable |
83 | | - } |
84 | | - else if constexpr(std::is_same_v<DataType, ck::bf8_t>) |
85 | | - { |
86 | | - return 8192.1; // 57344 and 49152 are acceptable |
87 | | - } |
88 | | - else |
89 | | - { |
90 | | - return 1e-3; |
91 | | - } |
92 | | -} |
93 | | - |
94 | 13 | template <ck::index_t NDimSpatial, |
95 | 14 | typename InLayout, |
96 | 15 | typename WeiLayout, |
|
0 commit comments