Add predefined datatype for FP4 format (#6122)

Adds predefined datatype for FP4 data in E2M1 format

Does not add support for any native FP4 types; datatype conversions are performed in software
This commit is contained in:
jhendersonHDF
2025-12-31 11:44:08 -06:00
committed by GitHub
parent 1ba82a0a75
commit d1efeba7be
40 changed files with 1564 additions and 777 deletions
+2 -2
View File
@@ -1219,8 +1219,8 @@ test_create_dataset_predefined_types(void H5_ATTR_UNUSED *params)
H5T_IEEE_F16LE, H5T_IEEE_F16BE, H5T_IEEE_F32LE, H5T_IEEE_F32BE,
H5T_IEEE_F64LE, H5T_IEEE_F64BE, H5T_FLOAT_BFLOAT16LE, H5T_FLOAT_BFLOAT16BE,
H5T_FLOAT_F8E4M3, H5T_FLOAT_F8E5M2, H5T_FLOAT_F6E2M3, H5T_FLOAT_F6E3M2,
H5T_COMPLEX_IEEE_F16BE, H5T_COMPLEX_IEEE_F16LE, H5T_COMPLEX_IEEE_F32BE, H5T_COMPLEX_IEEE_F32LE,
H5T_COMPLEX_IEEE_F64BE, H5T_COMPLEX_IEEE_F64LE};
H5T_FLOAT_F4E2M1, H5T_COMPLEX_IEEE_F16BE, H5T_COMPLEX_IEEE_F16LE, H5T_COMPLEX_IEEE_F32BE,
H5T_COMPLEX_IEEE_F32LE, H5T_COMPLEX_IEEE_F64BE, H5T_COMPLEX_IEEE_F64LE};
TESTING("dataset creation with predefined datatypes");
+4 -1
View File
@@ -44,7 +44,7 @@
/* The number of predefined floating point types in HDF5
*/
#define NUM_PREDEFINED_FLOAT_TYPES 12
#define NUM_PREDEFINED_FLOAT_TYPES 13
/* The number of predefined complex number types in HDF5
*/
@@ -339,6 +339,9 @@ generate_random_datatype_float(H5T_class_t H5_ATTR_UNUSED parent_class, bool H5_
case 11:
type_to_copy = H5T_FLOAT_F6E3M2;
break;
case 12:
type_to_copy = H5T_FLOAT_F4E2M1;
break;
default:
printf(" invalid value for floating point type; should not happen\n");