diff --git a/include/cutangent/arithmetic/intrinsic.cuh b/include/cutangent/arithmetic/intrinsic.cuh index 2e0ef6d..abd20a8 100644 --- a/include/cutangent/arithmetic/intrinsic.cuh +++ b/include/cutangent/arithmetic/intrinsic.cuh @@ -4,6 +4,11 @@ #include #include +#pragma nv_diagnostic push +// ignore "821: function was referenced but not defined" for e.g. add_down since +// this has to be defined by the type and is only included in an upstream project. +#pragma nv_diag_suppress 821 + namespace cu::intrinsic { // clang-format off @@ -44,8 +49,8 @@ namespace cu::intrinsic template<> inline __device__ tangent fma_down (tangent x, tangent y, tangent z) { return x * y + z; } template<> inline __device__ tangent fma_up (tangent x, tangent y, tangent z) { return x * y + z; } - template<> inline __device__ tangent add_down (tangent x, tangent y) { return x + y; } - template<> inline __device__ tangent add_up (tangent x, tangent y) { return x + y; } + template<> inline __device__ tangent add_down (tangent x, tangent y) { return { add_down(x.v, y.v), add_down(x.d, y.d) }; } + template<> inline __device__ tangent add_up (tangent x, tangent y) { return { add_up(x.v, y.v), add_up(x.d, y.d) }; } template<> inline __device__ tangent sub_down (tangent x, tangent y) { return x - y; } template<> inline __device__ tangent sub_up (tangent x, tangent y) { return x - y; } template<> inline __device__ tangent mul_down (tangent x, tangent y) { return x * y; } @@ -78,4 +83,6 @@ namespace cu::intrinsic // clang-format on } // namespace cu::intrinsic +#pragma nv_diagnostic pop + #endif // CUTANGENT_ARITHMETIC_INTRINSIC_CUH