From 364592f3358697471d0bef46008414a897c876df Mon Sep 17 00:00:00 2001 From: PhilipDeegan Date: Tue, 7 May 2024 13:45:49 +0200 Subject: [PATCH] sync with highfive (#833) --- src/hdf5/detail/h5/h5_file.hpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/hdf5/detail/h5/h5_file.hpp b/src/hdf5/detail/h5/h5_file.hpp index a5cbe1dd1..281c659d1 100644 --- a/src/hdf5/detail/h5/h5_file.hpp +++ b/src/hdf5/detail/h5/h5_file.hpp @@ -10,30 +10,6 @@ namespace PHARE::hdf5::h5 using HiFile = HighFive::File; -/* - Highfive cannot accept a single flat array into >= 2d shaped datasets -*/ -template -NO_DISCARD auto pointer_dim_caster(Data* data) -{ - if constexpr (dim == 1) - return data; - if constexpr (dim == 2) - return reinterpret_cast(data); - if constexpr (dim == 3) - return reinterpret_cast(data); -} -template -NO_DISCARD auto pointer_dim_caster(Data const* const data) -{ - if constexpr (dim == 1) - return data; - if constexpr (dim == 2) - return reinterpret_cast(data); - if constexpr (dim == 3) - return reinterpret_cast(data); -} - template @@ -94,7 +70,7 @@ class HighFiveFile NO_DISCARD auto read_data_set_flat(std::string path) const { std::vector data(H5Easy::getSize(h5file_, path)); - h5file_.getDataSet(path).read_raw(pointer_dim_caster(data.data())); + h5file_.getDataSet(path).read_raw(data.data()); return data; } @@ -117,7 +93,7 @@ class HighFiveFile template auto& write_data_set_flat(std::string path, Data const& data) { - h5file_.getDataSet(path).write(pointer_dim_caster(data)); + h5file_.getDataSet(path).write_raw(data); return *this; }