Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions c++/src/H5PredType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ PredType *PredType::IEEE_F64LE_;

PredType *PredType::FLOAT_BFLOAT16BE_;
PredType *PredType::FLOAT_BFLOAT16LE_;
PredType *PredType::FLOAT_F8E4M3_;
PredType *PredType::FLOAT_F8E5M2_;

PredType *PredType::UNIX_D32BE_;
PredType *PredType::UNIX_D32LE_;
Expand Down Expand Up @@ -344,6 +346,8 @@ PredType::makePredTypes()

FLOAT_BFLOAT16BE_ = new PredType(H5T_FLOAT_BFLOAT16BE);
FLOAT_BFLOAT16LE_ = new PredType(H5T_FLOAT_BFLOAT16LE);
FLOAT_F8E4M3_ = new PredType(H5T_FLOAT_F8E4M3);
FLOAT_F8E5M2_ = new PredType(H5T_FLOAT_F8E5M2);

UNIX_D32BE_ = new PredType(H5T_UNIX_D32BE);
UNIX_D32LE_ = new PredType(H5T_UNIX_D32LE);
Expand Down Expand Up @@ -500,6 +504,8 @@ PredType::deleteConstants()

delete FLOAT_BFLOAT16BE_;
delete FLOAT_BFLOAT16LE_;
delete FLOAT_F8E4M3_;
delete FLOAT_F8E5M2_;

delete UNIX_D32BE_;
delete UNIX_D32LE_;
Expand Down Expand Up @@ -660,6 +666,8 @@ const PredType &PredType::IEEE_F64LE = *IEEE_F64LE_;

const PredType &PredType::FLOAT_BFLOAT16BE = *FLOAT_BFLOAT16BE_;
const PredType &PredType::FLOAT_BFLOAT16LE = *FLOAT_BFLOAT16LE_;
const PredType &PredType::FLOAT_F8E4M3 = *FLOAT_F8E4M3_;
const PredType &PredType::FLOAT_F8E5M2 = *FLOAT_F8E5M2_;

const PredType &PredType::UNIX_D32BE = *UNIX_D32BE_;
const PredType &PredType::UNIX_D32LE = *UNIX_D32LE_;
Expand Down
4 changes: 4 additions & 0 deletions c++/src/H5PredType.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class H5CPP_DLL PredType : public AtomType {

static const PredType &FLOAT_BFLOAT16BE;
static const PredType &FLOAT_BFLOAT16LE;
static const PredType &FLOAT_F8E4M3;
static const PredType &FLOAT_F8E5M2;

static const PredType &UNIX_D32BE;
static const PredType &UNIX_D32LE;
Expand Down Expand Up @@ -267,6 +269,8 @@ class H5CPP_DLL PredType : public AtomType {

static PredType *FLOAT_BFLOAT16BE_;
static PredType *FLOAT_BFLOAT16LE_;
static PredType *FLOAT_F8E4M3_;
static PredType *FLOAT_F8E5M2_;

static PredType *UNIX_D32BE_;
static PredType *UNIX_D32LE_;
Expand Down
1 change: 1 addition & 0 deletions doxygen/dox/DDLBNF200.dox
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ This section contains a brief explanation of the symbols used in the DDL.
H5T_IEEE_F32BE | H5T_IEEE_F32LE |
H5T_IEEE_F64BE | H5T_IEEE_F64LE |
H5T_FLOAT_BFLOAT16BE | H5T_FLOAT_BFLOAT16LE |
H5T_FLOAT_F8E4M3 | H5T_FLOAT_F8E5M2 |
H5T_NATIVE_FLOAT16 | H5T_NATIVE_FLOAT |
H5T_NATIVE_DOUBLE | H5T_NATIVE_LDOUBLE

Expand Down
8 changes: 8 additions & 0 deletions doxygen/examples/tables/predefinedDatatypes.dox
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
<td>#H5T_FLOAT_BFLOAT16LE</td>
<td>16-bit little-endian bfloat16 floating point</td>
</tr>
<tr>
<td>#H5T_FLOAT_F8E4M3</td>
<td>8-bit FP8 E4M3 (4 exponent bits, 3 mantissa bits) floating point</td>
</tr>
<tr>
<td>#H5T_FLOAT_F8E5M2</td>
<td>8-bit FP8 E5M2 (5 exponent bits, 2 mantissa bits) floating point</td>
</tr>
</table>
//! [predefined_alt_float_datatypes_table]
*
Expand Down
4 changes: 4 additions & 0 deletions fortran/src/H5_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes)
return ret_value;
if ((floatingtypes[7] = (hid_t_f)H5Tcopy(H5T_FLOAT_BFLOAT16LE)) < 0)
return ret_value;
if ((floatingtypes[8] = (hid_t_f)H5Tcopy(H5T_FLOAT_F8E4M3)) < 0)
return ret_value;
if ((floatingtypes[9] = (hid_t_f)H5Tcopy(H5T_FLOAT_F8E5M2)) < 0)
return ret_value;

if ((integertypes[0] = (hid_t_f)H5Tcopy(H5T_STD_I8BE)) < 0)
return ret_value;
Expand Down
2 changes: 2 additions & 0 deletions fortran/src/H5_ff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ END FUNCTION h5init1_flags_c
H5T_IEEE_F16LE = floating_types(6)
H5T_FLOAT_BFLOAT16BE = floating_types(7)
H5T_FLOAT_BFLOAT16LE = floating_types(8)
H5T_FLOAT_F8E4M3 = floating_types(9)
H5T_FLOAT_F8E5M2 = floating_types(10)

H5T_STD_I8BE = integer_types(1)
H5T_STD_I8LE = integer_types(2)
Expand Down
6 changes: 5 additions & 1 deletion fortran/src/H5f90global.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ MODULE H5GLOBAL
! Do not forget to change these values when new predefined
! datatypes are added
INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19
INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 8
INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 10
INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 28

! These arrays need to be global because they are used in
Expand Down Expand Up @@ -91,6 +91,8 @@ MODULE H5GLOBAL
!DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F16LE
!DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_BFLOAT16BE
!DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_BFLOAT16LE
!DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F8E4M3
!DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F8E5M2
!DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE
!DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE
!DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE
Expand Down Expand Up @@ -145,6 +147,8 @@ MODULE H5GLOBAL
INTEGER(HID_T) :: H5T_IEEE_F16LE !< H5T_IEEE_F16LE
INTEGER(HID_T) :: H5T_FLOAT_BFLOAT16BE !< H5T_FLOAT_BFLOAT16BE
INTEGER(HID_T) :: H5T_FLOAT_BFLOAT16LE !< H5T_FLOAT_BFLOAT16LE
INTEGER(HID_T) :: H5T_FLOAT_F8E4M3 !< H5T_FLOAT_F8E4M3
INTEGER(HID_T) :: H5T_FLOAT_F8E5M2 !< H5T_FLOAT_F8E5M2
INTEGER(HID_T) :: H5T_STD_I8BE !< H5T_STD_I8BE
INTEGER(HID_T) :: H5T_STD_I8LE !< H5T_STD_I8LE
INTEGER(HID_T) :: H5T_STD_I16BE !< H5T_STD_I16BE
Expand Down
6 changes: 6 additions & 0 deletions hl/src/H5LT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,12 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, bo
else if (H5Tequal(dtype, H5T_FLOAT_BFLOAT16LE)) {
snprintf(dt_str, *slen, "H5T_FLOAT_BFLOAT16LE");
}
else if (H5Tequal(dtype, H5T_FLOAT_F8E4M3)) {
snprintf(dt_str, *slen, "H5T_FLOAT_F8E4M3");
}
else if (H5Tequal(dtype, H5T_FLOAT_F8E5M2)) {
snprintf(dt_str, *slen, "H5T_FLOAT_F8E5M2");
}
#ifdef H5_HAVE__FLOAT16
else if (H5Tequal(dtype, H5T_NATIVE_FLOAT16)) {
snprintf(dt_str, *slen, "H5T_NATIVE_FLOAT16");
Expand Down
Loading
Loading