Skip to content

Commit

Permalink
Merge pull request QMCPACK#4731 from correaa/correaa-generalize-unini…
Browse files Browse the repository at this point in the history
…tcopy

[AFQMC] Add customized uninitialized_copy for device_pointer
  • Loading branch information
ye-luo committed Sep 15, 2023
2 parents 24a1465 + e3bb789 commit f55c881
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/AFQMC/Memory/device_pointers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ struct device_pointer : base_device_pointer
}
T* impl_;


template<class It>
static auto uninitialized_copy(It Abeg, It Aend, device_pointer B)
{
static_assert(std::is_trivially_copyable_v<T>);
return copy_n(Abeg, std::distance(Abeg, Aend), B);
}

private:
device_pointer(T* impl__) : impl_(impl__) {}
};
Expand Down

0 comments on commit f55c881

Please sign in to comment.