File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
tools/clang/unittests/HLSLExec Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff 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; } \
You can’t perform that action at this time.
0 commit comments