Jump to conversation
Unresolved conversations (1)
@rouault rouault Jun 6, 2024
If we are not confident about _Float16 being the canonical name that will be universally adopted, then the GFloat16 approach would indeed be better (it would be dangerous for GDAL to define _Float16 as a global identifier starting with underscore is assumed to be reserved. cf https://en.cppreference.com/w/c/language/identifier). But I'm not sure if there will actually be functions in the GDAL C API where GFloat16 will be exposed. This should be mostly an implementation detail
...evelopment/rfc/rfc100_float16_support.rst
eschnett
Resolved conversations (7)
@rouault rouault Jun 6, 2024
newline to make sphinx happy: ```suggestion - https://github.com/OSGeo/gdal/pull/5257: [FEATURE] Add (initial) ```
...evelopment/rfc/rfc100_float16_support.rst
@rouault rouault Jun 6, 2024
```suggestion manner, i.e. it does not break the ABI, and can thus be implemented in ```
Outdated
...evelopment/rfc/rfc100_float16_support.rst
@rouault rouault Jun 6, 2024
I assume you are speaking about the multidimensional API here? Should be precised
Outdated
...evelopment/rfc/rfc100_float16_support.rst
eschnett
@rouault rouault Jun 6, 2024
cf above remark if we really need a type alias.
Outdated
...evelopment/rfc/rfc100_float16_support.rst
eschnett
@rouault rouault Jun 6, 2024
```suggestion - ``GDT_CFloat16`` --> ``std::complex<GFloat16`` / ``_Complex GFloat16`` ```
Outdated
...evelopment/rfc/rfc100_float16_support.rst
@rouault rouault Jun 6, 2024
It should be mentioned here that at least the HDF5, GTiff and Zarr drivers already handle float16, but by exposing it as float32, using software conversion routines in port/cpl_float.h. For HDF5, older version of he HDF5 library, do that conversion internally. Most recent ones, when built with float16 support, directly return the float16 values, and GDAL does the the float16<-->float32 conversion (https://github.com/OSGeo/gdal/pull/10052)
...evelopment/rfc/rfc100_float16_support.rst
eschnett rouault
@rouault rouault Jun 6, 2024
The Gxxxx typedefs are mostly of legacy interest. They were introduced long before C/C++ standardized fixed-size types ([u]int[8/16/32/64] etc), and we hope to get rid of them at some point (cf https://gdal.org/development/rfc/rfc95_standard_int_types.html , which is postponed to an hypothetical GDAL 4.0). So here I would go to just using ``_Float16`` (is that standardized for C ? I saw that C++23 has standardized std::float16, but do all C++ implementations that understand std::float16 understand ``_Float16`` ?)
Outdated
...evelopment/rfc/rfc100_float16_support.rst
eschnett