Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aligned allocator definition for C++20 compiler supports #438

Merged
merged 19 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@

### Bug fixes

* Ensure aligned allocator definition works with C++20 compilers.
[(#438)](https://github.com/PennyLaneAI/pennylane-lightning/pull/438)

* Prevent multiple threads from calling `Kokkos::initialize` or `Kokkos::finalize`.
[(#439)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/439)
[(#439)](https://github.com/PennyLaneAI/pennylane-lightning/pull/439)

### Contributors

This release contains contributions from (in alphabetical order):

Lee J. O'Riordan
Lee J. O'Riordan, Chae-Yeun Park

---

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"""


__version__ = "0.31.0-dev3"
__version__ = "0.31.0-dev4"
2 changes: 1 addition & 1 deletion pennylane_lightning/src/simulator/Observables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ template <class T> struct HamiltonianApplyInPlace<T, true> {
const std::vector<std::shared_ptr<Observable<T>>> &terms,
StateVectorManagedCPU<T> &sv) {
const size_t length = sv.getLength();
const auto allocator = sv.allocator();
auto allocator = sv.allocator();

std::vector<std::complex<T>, decltype(allocator)> sum(
length, std::complex<T>{}, allocator);
Expand Down
2 changes: 0 additions & 2 deletions pennylane_lightning/src/util/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ template <class T> class AlignedAllocator {
*/
[[nodiscard]] inline uint32_t alignment() const { return alignment_; }

template <class U> struct rebind { using other = AlignedAllocator<U>; };

template <typename U>
explicit constexpr AlignedAllocator(
[[maybe_unused]] const AlignedAllocator<U> &rhs) noexcept
Expand Down