mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Add predefined datatypes for FP6 formats (#6097)
Adds predefined datatypes for FP6 data in E2M3 and E3M2 formats Does not add support for any native FP6 types; datatype conversions are performed in software
This commit is contained in:
@@ -1129,6 +1129,10 @@ public class HDF5Constants {
|
||||
/** */
|
||||
public static final long H5T_FLOAT_F8E5M2 = H5T_FLOAT_F8E5M2();
|
||||
/** */
|
||||
public static final long H5T_FLOAT_F6E2M3 = H5T_FLOAT_F6E2M3();
|
||||
/** */
|
||||
public static final long H5T_FLOAT_F6E3M2 = H5T_FLOAT_F6E3M2();
|
||||
/** */
|
||||
public static final int H5T_INTEGER = H5T_INTEGER();
|
||||
/** */
|
||||
public static final long H5T_INTEL_B16 = H5T_INTEL_B16();
|
||||
@@ -2648,6 +2652,10 @@ public class HDF5Constants {
|
||||
|
||||
private static native final long H5T_FLOAT_F8E5M2();
|
||||
|
||||
private static native final long H5T_FLOAT_F6E2M3();
|
||||
|
||||
private static native final long H5T_FLOAT_F6E3M2();
|
||||
|
||||
private static native final int H5T_INTEGER();
|
||||
|
||||
private static native final long H5T_INTEL_B16();
|
||||
|
||||
@@ -2756,6 +2756,16 @@ Java_hdf_hdf5lib_HDF5Constants_H5T_1FLOAT_1F8E5M2(JNIEnv *env, jclass cls)
|
||||
{
|
||||
return H5T_FLOAT_F8E5M2;
|
||||
}
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5T_1FLOAT_1F6E2M3(JNIEnv *env, jclass cls)
|
||||
{
|
||||
return H5T_FLOAT_F6E2M3;
|
||||
}
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5T_1FLOAT_1F6E3M2(JNIEnv *env, jclass cls)
|
||||
{
|
||||
return H5T_FLOAT_F6E3M2;
|
||||
}
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5T_1INTEGER(JNIEnv *env, jclass cls)
|
||||
{
|
||||
|
||||
@@ -2171,6 +2171,10 @@ h5str_get_little_endian_type(hid_t tid)
|
||||
p_type = H5Tcopy(H5T_FLOAT_F8E4M3);
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F8E5M2))
|
||||
p_type = H5Tcopy(H5T_FLOAT_F8E5M2);
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F6E2M3))
|
||||
p_type = H5Tcopy(H5T_FLOAT_F6E2M3);
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F6E3M2))
|
||||
p_type = H5Tcopy(H5T_FLOAT_F6E3M2);
|
||||
}
|
||||
else if (size == 2) {
|
||||
if (true == H5Tequal(tid, H5T_IEEE_F16LE) || true == H5Tequal(tid, H5T_IEEE_F16BE))
|
||||
@@ -2294,6 +2298,18 @@ h5str_get_big_endian_type(hid_t tid)
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F8E5M2)) {
|
||||
p_type = H5Tcopy(H5T_FLOAT_F8E5M2);
|
||||
|
||||
/* Though not very useful, set order to BE as expected */
|
||||
H5Tset_order(p_type, H5T_ORDER_BE);
|
||||
}
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F6E2M3)) {
|
||||
p_type = H5Tcopy(H5T_FLOAT_F6E2M3);
|
||||
|
||||
/* Though not very useful, set order to BE as expected */
|
||||
H5Tset_order(p_type, H5T_ORDER_BE);
|
||||
}
|
||||
else if (true == H5Tequal(tid, H5T_FLOAT_F6E3M2)) {
|
||||
p_type = H5Tcopy(H5T_FLOAT_F6E3M2);
|
||||
|
||||
/* Though not very useful, set order to BE as expected */
|
||||
H5Tset_order(p_type, H5T_ORDER_BE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user