diff --git a/include/clad/Differentiator/Array.h b/include/clad/Differentiator/Array.h index d5ee05b68..bceab2656 100644 --- a/include/clad/Differentiator/Array.h +++ b/include/clad/Differentiator/Array.h @@ -51,6 +51,12 @@ template class array { CUDA_HOST_DEVICE array(const array& arr) : array(arr.m_arr, arr.m_size) {} + template + CUDA_HOST_DEVICE array(const array& arr) + : m_arr(new T[arr.size()]), m_size(arr.size()) { + (*this) = arr; + } + CUDA_HOST_DEVICE array(std::size_t size, const clad::array& arr) : m_arr(new T[size]), m_size(size) { for (std::size_t i = 0; i < size; ++i)