diff --git a/include/clad/Differentiator/Differentiator.h b/include/clad/Differentiator/Differentiator.h index db9b699f2..3a8f35faf 100644 --- a/include/clad/Differentiator/Differentiator.h +++ b/include/clad/Differentiator/Differentiator.h @@ -145,9 +145,9 @@ CUDA_HOST_DEVICE T push(tape& to, ArgsT... val) { if (CUDAkernel) { void* argPtrs[] = {(void*)&args...}; cudaLaunchKernel((void*)f, grid, block, argPtrs, shared_mem, stream); - } else { - return f(static_cast(args)...); + return return_type_t(); } + return f(static_cast(args)...); #else return f(static_cast(args)...); #endif