Skip to content

Commit 3c18fc3

Browse files
committed
Bad rebase
1 parent 275efd9 commit 3c18fc3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tools/clang/unittests/HLSLExec/LongVectors.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,10 +890,24 @@ template <typename T, OpType OP> struct TrigonometricValidation {
890890

891891
// Half precision trig functions have a larger tolerance. Note that the D3D spec
892892
// does not mention half precision trig functions.
893-
template <> struct TrigonometricValidation<HLSLHalf_t, OpType::Sin> {
893+
template <OpType OP> struct TrigonometricValidation<HLSLHalf_t, OP> {
894894
ValidationConfig ValidationConfig = ValidationConfig::Epsilon(0.003f);
895895
};
896896

897+
// For the half precision trig functions with an infinite range in either
898+
// direction we use 2 ULPs of tolerance instead.
899+
template <> struct TrigonometricValidation<HLSLHalf_t, OpType::Cosh> {
900+
ValidationConfig ValidationConfig = ValidationConfig::Ulp(2.0f);
901+
};
902+
903+
template <> struct TrigonometricValidation<HLSLHalf_t, OpType::Tan> {
904+
ValidationConfig ValidationConfig = ValidationConfig::Ulp(2.0f);
905+
};
906+
907+
template <> struct TrigonometricValidation<HLSLHalf_t, OpType::Sinh> {
908+
ValidationConfig ValidationConfig = ValidationConfig::Ulp(2.0f);
909+
};
910+
897911
#define TRIG_OP(OP, IMPL) \
898912
template <typename T> struct Op<OP, T, 1> : TrigonometricValidation<T, OP> { \
899913
T operator()(T A) { return IMPL; } \

0 commit comments

Comments
 (0)