diff --git a/extern/assert b/extern/assert index 2cd99e24e..6aabfebae 160000 --- a/extern/assert +++ b/extern/assert @@ -1 +1 @@ -Subproject commit 2cd99e24e834d600d51cf3b8cdc3df6ecfd8e9f1 +Subproject commit 6aabfebae6d4acf996fe711de4e9b444ad88c17d diff --git a/extern/config b/extern/config index fad75493b..088b79a0c 160000 --- a/extern/config +++ b/extern/config @@ -1 +1 @@ -Subproject commit fad75493bd2da03524854976f2d80dd7989c90fb +Subproject commit 088b79a0ca751932010f82d3f95457c8b483fb9b diff --git a/extern/core b/extern/core index ca4893063..f4b3d5dba 160000 --- a/extern/core +++ b/extern/core @@ -1 +1 @@ -Subproject commit ca4893063fa244a690b1f799328f16408b794c77 +Subproject commit f4b3d5dba6f86caaf96e45901655a954b2ff68b4 diff --git a/extern/histogram b/extern/histogram index 7c24d2683..4a10c2c11 160000 --- a/extern/histogram +++ b/extern/histogram @@ -1 +1 @@ -Subproject commit 7c24d2683e6be78cda90dcc0026ceeb7b5131507 +Subproject commit 4a10c2c11b272f435f61233eb9f585604476b2f8 diff --git a/extern/mp11 b/extern/mp11 index 21cace4e5..9d43d1f69 160000 --- a/extern/mp11 +++ b/extern/mp11 @@ -1 +1 @@ -Subproject commit 21cace4e574180ba64d9307a5e4ea9e5e94d3e8d +Subproject commit 9d43d1f69660617266c9168e6e121ab2b0ea2287 diff --git a/extern/throw_exception b/extern/throw_exception index da6f5420f..95e02ea52 160000 --- a/extern/throw_exception +++ b/extern/throw_exception @@ -1 +1 @@ -Subproject commit da6f5420fe7e96f673ee185c2ff37cbaa3f95b84 +Subproject commit 95e02ea52b8525ecf34dbf1e7fae34af09986b8a diff --git a/extern/variant2 b/extern/variant2 index 1ebc29aa0..4153a535a 160000 --- a/extern/variant2 +++ b/extern/variant2 @@ -1 +1 @@ -Subproject commit 1ebc29aa0277cbb284a70327b5af14519f2702bc +Subproject commit 4153a535a0fa8eb4d18abc262fcf2ae834601261 diff --git a/include/bh_python/accumulators/ostream.hpp b/include/bh_python/accumulators/ostream.hpp index 03e251582..2140d5a26 100644 --- a/include/bh_python/accumulators/ostream.hpp +++ b/include/bh_python/accumulators/ostream.hpp @@ -79,7 +79,7 @@ std::basic_ostream& operator<<(std::basic_ostream& template std::basic_ostream& operator<<(std::basic_ostream& os, - const ::boost::histogram::accumulators::thread_safe& x) { + const ::boost::histogram::accumulators::count& x) { os << x.load(); return os; } diff --git a/include/bh_python/histogram.hpp b/include/bh_python/histogram.hpp index 0d26afb0f..80125017f 100644 --- a/include/bh_python/histogram.hpp +++ b/include/bh_python/histogram.hpp @@ -20,8 +20,8 @@ namespace pybind11 { /// The descriptor for atomic_* is the same as the descriptor for *, as long this uses /// standard layout template -struct format_descriptor> : format_descriptor { - static_assert(std::is_standard_layout>::value, ""); +struct format_descriptor> : format_descriptor { + static_assert(std::is_standard_layout>::value, ""); }; } // namespace pybind11 diff --git a/include/bh_python/storage.hpp b/include/bh_python/storage.hpp index bcbdd5bd2..75646e0c0 100644 --- a/include/bh_python/storage.hpp +++ b/include/bh_python/storage.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ namespace storage { // Names match Python names using int64 = bh::dense_storage; -using atomic_int64 = bh::dense_storage>; +using atomic_int64 = bh::dense_storage>; using double_ = bh::dense_storage; using unlimited = bh::unlimited_storage<>; using weight = bh::dense_storage>; @@ -80,8 +80,12 @@ template void save(Archive& ar, const storage::atomic_int64& s, unsigned /* version */) { // We cannot view the memory as a numpy array, because the internal layout of // std::atomic is undefined. So no reinterpret_casts are allowed. - py::array_t a(static_cast(s.size())); - std::copy(s.begin(), s.end(), a.mutable_data()); + py::array_t a(static_cast(s.size())); + + auto in_ptr = s.begin(); + auto out_ptr = a.mutable_data(); + for(; in_ptr != s.end(); ++in_ptr, ++out_ptr) + *out_ptr = in_ptr->value(); ar << a; } @@ -187,7 +191,7 @@ struct type_caster { auto ptr = PyNumber_Long(src.ptr()); if(!ptr) return false; - value.store(PyLong_AsUnsignedLongLong(ptr)); + value = PyLong_AsUnsignedLongLong(ptr); Py_DECREF(ptr); return !PyErr_Occurred(); } @@ -195,7 +199,7 @@ struct type_caster { static handle cast(storage::atomic_int64::value_type src, return_value_policy /* policy */, handle /* parent */) { - return PyLong_FromUnsignedLongLong(src.load()); + return PyLong_FromUnsignedLongLong(src.value()); } }; } // namespace detail