Skip to content

Commit 523878c

Browse files
committed
Fix: Guard C++17 ellint derivatives to fix CI build on older standards
1 parent 2190f7b commit 523878c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/clad/Differentiator/BuiltinDerivatives.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,8 @@ CUDA_HOST_DEVICE void hypot_pullback(T x, T y, U d_z, T* d_x, T* d_y) {
10621062
*d_y += (y / h) * d_z;
10631063
}
10641064

1065+
#if __cplusplus >= 201703L
1066+
10651067
template <typename T, typename dT>
10661068
CUDA_HOST_DEVICE ValueAndPushforward<T, dT> comp_ellint_1_pushforward(T k, dT d_k) {
10671069
T K = ::std::comp_ellint_1(k);
@@ -1111,6 +1113,8 @@ CUDA_HOST_DEVICE ValueAndPushforward<T, dT> comp_ellint_3_pushforward(T k, U nu,
11111113

11121114
return {result, d_result};
11131115
}
1116+
1117+
#endif
11141118
} // namespace std
11151119

11161120
CUDA_HOST_DEVICE inline ValueAndPushforward<float, float>
@@ -1375,9 +1379,11 @@ using std::min_pushforward;
13751379
using std::pow_pullback;
13761380
using std::pow_pushforward;
13771381
using std::sqrt_pushforward;
1382+
#if __cplusplus >= 201703L
13781383
using std::comp_ellint_1_pushforward;
13791384
using std::comp_ellint_2_pushforward;
13801385
using std::comp_ellint_3_pushforward;
1386+
#endif
13811387

13821388
namespace class_functions {
13831389
template <typename T, typename U>

0 commit comments

Comments
 (0)