diff --git a/include/clad/Differentiator/Differentiator.h b/include/clad/Differentiator/Differentiator.h index bf139ae59..fd917b365 100644 --- a/include/clad/Differentiator/Differentiator.h +++ b/include/clad/Differentiator/Differentiator.h @@ -126,9 +126,8 @@ CUDA_HOST_DEVICE T push(tape& to, ArgsT... val) { #if defined(__CUDACC__) && !defined(__CUDA_ARCH__) if (CUDAkernel) { constexpr size_t totalArgs = sizeof...(args) + sizeof...(Rest); - std::vector argPtrs; - argPtrs.reserve(totalArgs); - (argPtrs.push_back(static_cast(&args)), ...); + std::array argPtrs = {static_cast(&args)..., + static_cast(nullptr)...}; void* null_param = nullptr; for (size_t i = sizeof...(args); i < totalArgs; ++i)