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

HDF5: add support for libhdf5 >= 1.14.4.2 when built with Float16 #10052

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented May 28, 2024

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 69.136% (+0.002%) from 69.134%
when pulling 16ade82 on rouault:hdf5_float16
into 3757cd2 on OSGeo:master.

@imincik
Copy link

imincik commented May 29, 2024

@rouault , great thanks for this patch. I confirm that GDAL 3.9.0 is building fine (including tests) with HDF5 1.14.4.3 .

for (hsize_t i = 0; i < nAttrElmts; i++)
{
const uint16_t nVal16 = static_cast<uint16_t *>(buf)[i];
const uint32_t nVal32 = CPLHalfToFloat(nVal16);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by CPLHalfToFloat (which doesn't return a float) and the memcpy below (which assumes sizeof float), I know that they are both 32 bits but I am wondering if that assumption is enforced by standard or if is it "assert"ed somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a static_assert(sizeof(float) == 4); in port/cpl_conv.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HDF5 1.14.4.2/3 is breaking GDAL build
4 participants