From 781c08eb558c756a99c60fdc901279ceda131ea0 Mon Sep 17 00:00:00 2001 From: kchristin Date: Fri, 25 Oct 2024 22:39:28 +0300 Subject: [PATCH] Fix cuda device host constexpr execute functions declarations --- include/clad/Differentiator/Differentiator.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/clad/Differentiator/Differentiator.h b/include/clad/Differentiator/Differentiator.h index d5c54ca40..bf139ae59 100644 --- a/include/clad/Differentiator/Differentiator.h +++ b/include/clad/Differentiator/Differentiator.h @@ -269,10 +269,9 @@ CUDA_HOST_DEVICE T push(tape& to, ArgsT... val) { constexpr CladFunctionType getFunctionPtr() const { return m_Function; } template - typename std::enable_if< - !std::is_same::value, - return_type_t>::type constexpr execute(Args&&... args) - CUDA_HOST_DEVICE const { + typename std::enable_if::value, + return_type_t>::type constexpr CUDA_HOST_DEVICE + execute(Args&&... args) const { if (!m_Function) return static_cast>(return_type_t()); if (m_CUDAkernel) { @@ -313,10 +312,9 @@ CUDA_HOST_DEVICE T push(tape& to, ArgsT... val) { /// Error handling is handled in the clad side using clang diagnostics /// subsystem. template - typename std::enable_if< - std::is_same::value, - return_type_t>::type constexpr execute(Args&&... args) - CUDA_HOST_DEVICE const { + typename std::enable_if::value, + return_type_t>::type constexpr CUDA_HOST_DEVICE + execute(Args&&... args) const { return static_cast>(0); }