Skip to content

Commit

Permalink
Merge branch 'master' into cornu/remove_filedriver_mpiofiledriver
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc authored Feb 9, 2024
2 parents 1128b33 + 4914dce commit 8cbfa98
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 99 deletions.
2 changes: 1 addition & 1 deletion doc/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ When genuinely performing a "raw read", one must replace `read` with
`read_raw`. For example:

```
double x = malloc(2*3 * sizeof(double));
double* x = malloc(2*3 * sizeof(double));
dset.read_raw(x);
```
is correct in `v3`.
Expand Down
10 changes: 0 additions & 10 deletions include/highfive/H5Attribute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ class Attribute: public Object, public PathTraits<Attribute> {
template <typename T>
void read(T& array) const;

/// \brief Read the attribute into a pre-allocated buffer.
/// \deprecated use `read(T&` or `read_raw`.
template <typename T>
void read(T* array, const DataType& mem_datatype) const;

/// \brief Read the attribute into a buffer.
/// \deprecated use `read(T&` or `read_raw`.
template <typename T>
void read(T* array) const;

/// \brief Read the attribute into a pre-allocated buffer.
/// \param array A pointer to the first byte of sufficient pre-allocated memory.
/// \param mem_datatype The DataType of the array.
Expand Down
10 changes: 0 additions & 10 deletions include/highfive/bits/H5Attribute_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ inline void Attribute::read(T& array) const {
}
}

template <typename T>
inline void Attribute::read(T* array, const DataType& mem_datatype) const {
read_raw(array, mem_datatype);
}

template <typename T>
inline void Attribute::read_raw(T* array, const DataType& mem_datatype) const {
static_assert(!std::is_const<T>::value,
Expand All @@ -114,11 +109,6 @@ inline void Attribute::read_raw(T* array, const DataType& mem_datatype) const {
detail::h5a_read(getId(), mem_datatype.getId(), static_cast<void*>(array));
}

template <typename T>
inline void Attribute::read(T* array) const {
read_raw(array);
}

template <typename T>
inline void Attribute::read_raw(T* array) const {
using element_type = typename details::inspector<T>::base_type;
Expand Down
4 changes: 0 additions & 4 deletions include/highfive/bits/H5DataType_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,3 @@ inline DataType create_datatype<bool>() {
}

} // namespace HighFive

#ifdef H5_USE_HALF_FLOAT
#include <highfive/half_float.hpp>
#endif
8 changes: 0 additions & 8 deletions include/highfive/bits/H5Inspector_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,3 @@ struct inspector<T[N]> {

} // namespace details
} // namespace HighFive

#ifdef H5_USE_BOOST
#include <highfive/boost.hpp>
#endif

#ifdef H5_USE_EIGEN
#include <highfive/eigen.hpp>
#endif
30 changes: 0 additions & 30 deletions include/highfive/bits/H5Slice_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,36 +303,6 @@ class SliceTraits {
template <typename T>
void read(T& array, const DataTransferProps& xfer_props = DataTransferProps()) const;

///
/// Read the entire dataset into a raw buffer
///
/// \deprecated Use `read_raw` instead.
///
/// No dimensionality checks will be performed, it is the user's
/// responsibility to ensure that the right amount of space has been
/// allocated.
/// \param array: A buffer containing enough space for the data
/// \param dtype: The datatype of elements of the in memory buffer.
/// \param xfer_props: Data Transfer properties
template <typename T>
void read(T* array,
const DataType& dtype,
const DataTransferProps& xfer_props = DataTransferProps()) const;

///
/// Read the entire dataset into a raw buffer
///
/// \deprecated Use `read_raw` instead.
///
/// Same as `read(T*, const DataType&, const DataTransferProps&)`. However,
/// this overload deduces the HDF5 datatype of the element of `array` from
/// `T`. Note, that the file datatype is already fixed.
///
/// \param array: A buffer containing enough space for the data
/// \param xfer_props: Data Transfer properties
template <typename T>
void read(T* array, const DataTransferProps& xfer_props = DataTransferProps()) const;

///
/// Read the entire dataset into a raw buffer
///
Expand Down
14 changes: 0 additions & 14 deletions include/highfive/bits/H5Slice_traits_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,6 @@ inline void SliceTraits<Derivate>::read(T& array, const DataTransferProps& xfer_
}
}

template <typename Derivate>
template <typename T>
inline void SliceTraits<Derivate>::read(T* array,
const DataType& mem_datatype,
const DataTransferProps& xfer_props) const {
read_raw(array, mem_datatype, xfer_props);
}

template <typename Derivate>
template <typename T>
inline void SliceTraits<Derivate>::read(T* array, const DataTransferProps& xfer_props) const {
read_raw(array, xfer_props);
}


template <typename Derivate>
template <typename T>
Expand Down
5 changes: 0 additions & 5 deletions include/highfive/boost.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#pragma once
#ifdef H5_USE_BOOST

#include "bits/H5Inspector_decl.hpp"
#include "H5Exception.hpp"

#include <boost/multi_array.hpp>
// starting Boost 1.64, serialization header must come before ublas
#include <boost/serialization/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>

namespace HighFive {
Expand Down Expand Up @@ -160,5 +157,3 @@ struct inspector<boost::numeric::ublas::matrix<T>> {

} // namespace details
} // namespace HighFive

#endif
3 changes: 0 additions & 3 deletions include/highfive/eigen.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#ifdef H5_USE_EIGEN

#include "bits/H5Inspector_decl.hpp"
#include "H5Exception.hpp"
Expand Down Expand Up @@ -89,5 +88,3 @@ struct inspector<Eigen::Matrix<T, M, N>> {

} // namespace details
} // namespace HighFive

#endif
4 changes: 1 addition & 3 deletions include/highfive/half_float.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once
#ifdef H5_USE_HALF_FLOAT

#include <half.hpp>

Expand All @@ -16,6 +15,5 @@ inline AtomicType<float16_t>::AtomicType() {
// Floating point exponent bias
detail::h5t_set_ebias(_hid, 15);
}
} // namespace HighFive

#endif
} // namespace HighFive
4 changes: 1 addition & 3 deletions src/examples/boost_multi_array_2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
*/
#include <iostream>

#undef H5_USE_BOOST
#define H5_USE_BOOST

#include <boost/multi_array.hpp>
#include <highfive/highfive.hpp>
#include <highfive/boost.hpp>

using namespace HighFive;

Expand Down
5 changes: 1 addition & 4 deletions src/examples/boost_multiarray_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
#include <algorithm>
#include <complex>

#undef H5_USE_BOOST
#define H5_USE_BOOST

#include <highfive/highfive.hpp>

#include <boost/multi_array.hpp>
#include <highfive/boost.hpp>

typedef std::complex<double> complex_t;

Expand Down
5 changes: 2 additions & 3 deletions src/examples/boost_ublas_double.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
*/
#include <iostream>

#undef H5_USE_BOOST
#define H5_USE_BOOST

#include <highfive/highfive.hpp>

#include <highfive/boost.hpp>

// In some versions of Boost (starting with 1.64), you have to include the serialization header
// before ublas
#include <boost/serialization/vector.hpp>
Expand Down
1 change: 1 addition & 0 deletions src/examples/create_dataset_half_float.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <vector>

#include <highfive/highfive.hpp>
#include <highfive/half_float.hpp>

const std::string FILE_NAME("create_dataset_half_float_example.h5");
const std::string DATASET_NAME("dset");
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ option(HIGHFIVE_TEST_SINGLE_INCLUDES "Enable testing single includes" FALSE)
if(HIGHFIVE_TEST_SINGLE_INCLUDES)
file(GLOB public_headers LIST_DIRECTORIES false RELATIVE ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/highfive/*.hpp)
foreach(PUBLIC_HEADER ${public_headers})
if(PUBLIC_HEADER STREQUAL "highfive/boost.hpp" AND NOT HIGHFIVE_USE_BOOST)
continue()
endif()

if(PUBLIC_HEADER STREQUAL "highfive/half_float.hpp" AND NOT HIGHFIVE_USE_HALF_FLOAT)
continue()
endif()

if(PUBLIC_HEADER STREQUAL "highfive/eigen.hpp" AND NOT HIGHFIVE_USE_EIGEN)
continue()
endif()

get_filename_component(CLASS_NAME ${PUBLIC_HEADER} NAME_WE)
configure_file(tests_import_public_headers.cpp "tests_${CLASS_NAME}.cpp" @ONLY)
add_executable("tests_include_${CLASS_NAME}" "${CMAKE_CURRENT_BINARY_DIR}/tests_${CLASS_NAME}.cpp")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <array>

#ifdef H5_USE_BOOST
#include <boost/multi_array.hpp>
#include <highfive/boost.hpp>
#endif

#include <highfive/bits/H5Inspector_misc.hpp>
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/tests_high_five.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ using base_test_types = std::tuple<int,
fcomplex>;

#ifdef H5_USE_HALF_FLOAT
#include <highfive/half_float.hpp>

using float16_t = half_float::half;
using numerical_test_types =
decltype(std::tuple_cat(std::declval<base_test_types>(), std::tuple<float16_t>()));
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/tests_high_five_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
#include <highfive/highfive.hpp>
#include "tests_high_five.hpp"

#ifdef H5_USE_BOOST
#include <highfive/boost.hpp>
#endif

#ifdef H5_USE_EIGEN
#include <highfive/eigen.hpp>
#endif


using namespace HighFive;
using Catch::Matchers::Equals;

Expand Down
1 change: 1 addition & 0 deletions tests/unit/tests_high_five_multi_dims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#ifdef H5_USE_BOOST
#include <boost/multi_array.hpp>
#include <highfive/boost.hpp>
#endif

#include <catch2/catch_test_macros.hpp>
Expand Down

0 comments on commit 8cbfa98

Please sign in to comment.