Skip to content

Commit

Permalink
Fix cuda device host constexpr execute functions declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristin22 authored and vgvassilev committed Oct 30, 2024
1 parent 75d9530 commit 437cdd0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions include/clad/Differentiator/Differentiator.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,9 @@ CUDA_HOST_DEVICE T push(tape<T>& to, ArgsT... val) {
constexpr CladFunctionType getFunctionPtr() const { return m_Function; }

template <typename... Args, class FnType = CladFunctionType>
typename std::enable_if<
!std::is_same<FnType, NoFunction*>::value,
return_type_t<F>>::type constexpr execute(Args&&... args)
CUDA_HOST_DEVICE const {
typename std::enable_if<!std::is_same<FnType, NoFunction*>::value,
return_type_t<F>>::type constexpr CUDA_HOST_DEVICE
execute(Args&&... args) const {
if (!m_Function)
return static_cast<return_type_t<F>>(return_type_t<F>());
if (m_CUDAkernel) {
Expand Down Expand Up @@ -313,10 +312,9 @@ CUDA_HOST_DEVICE T push(tape<T>& to, ArgsT... val) {
/// Error handling is handled in the clad side using clang diagnostics
/// subsystem.
template <typename... Args, class FnType = CladFunctionType>
typename std::enable_if<
std::is_same<FnType, NoFunction*>::value,
return_type_t<F>>::type constexpr execute(Args&&... args)
CUDA_HOST_DEVICE const {
typename std::enable_if<std::is_same<FnType, NoFunction*>::value,
return_type_t<F>>::type constexpr CUDA_HOST_DEVICE
execute(Args&&... args) const {
return static_cast<return_type_t<F>>(0);
}

Expand Down

0 comments on commit 437cdd0

Please sign in to comment.