opal/datatype: Support short float
The type `short float` is proposed for the C language in ISO/IEC JTC 1/SC 22 WG 14 (C WG) for mainly IEEE 754-2008 binary16, a.k.a. half-precision floating point or FP16. By this commit, `short float` and `short float _Complex` are detected in `configure` and used in Open MPI internal code. `MPI_SHORT_FLOAT` and its complex number version are not added yet. This commit changes values of existing `OPAL_DATATYPE_*` macros. This change does not affect ABI compatibility of `libmpi.so` and the like because these values are only used in OPAL and OMPI internal code. Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
Этот коммит содержится в:
родитель
2cf6944e70
Коммит
f6b39452f6
15
configure.ac
15
configure.ac
@ -25,6 +25,7 @@
|
||||
# Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
|
||||
# Copyright (c) 2018 Amazon.com, Inc. or its affiliates.
|
||||
# All Rights reserved.
|
||||
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -387,10 +388,12 @@ AC_CHECK_TYPES(uint128_t)
|
||||
AC_CHECK_TYPES(long long)
|
||||
|
||||
AC_CHECK_TYPES(__float128)
|
||||
AC_CHECK_TYPES(short float)
|
||||
AC_CHECK_TYPES(long double)
|
||||
# We only need these types if we're building the OMPI project, but
|
||||
# OPAL currently doesn't protect for their lack of presence well.
|
||||
AC_CHECK_HEADERS(complex.h)
|
||||
AC_CHECK_TYPES(short float _Complex)
|
||||
AC_CHECK_TYPES(float _Complex)
|
||||
AC_CHECK_TYPES(double _Complex)
|
||||
AC_CHECK_TYPES(long double _Complex)
|
||||
@ -411,6 +414,9 @@ AC_CHECK_SIZEOF(short)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
if test "$ac_cv_type_short_float" = yes; then
|
||||
AC_CHECK_SIZEOF(short float)
|
||||
fi
|
||||
AC_CHECK_SIZEOF(float)
|
||||
AC_CHECK_SIZEOF(double)
|
||||
AC_CHECK_SIZEOF(long double)
|
||||
@ -419,6 +425,9 @@ if test "$ac_cv_type___float128" = yes; then
|
||||
fi
|
||||
# We only need these types if we're building the OMPI project, but
|
||||
# OPAL currently doesn't protect for their lack of presence well.
|
||||
if test "$ac_cv_type_short_float__Complex" = yes; then
|
||||
AC_CHECK_SIZEOF(short float _Complex)
|
||||
fi
|
||||
AC_CHECK_SIZEOF(float _Complex)
|
||||
AC_CHECK_SIZEOF(double _Complex)
|
||||
AC_CHECK_SIZEOF(long double _Complex)
|
||||
@ -461,6 +470,9 @@ OPAL_C_GET_ALIGNMENT(wchar_t, OPAL_ALIGNMENT_WCHAR)
|
||||
OPAL_C_GET_ALIGNMENT(int, OPAL_ALIGNMENT_INT)
|
||||
OPAL_C_GET_ALIGNMENT(long, OPAL_ALIGNMENT_LONG)
|
||||
OPAL_C_GET_ALIGNMENT(long long, OPAL_ALIGNMENT_LONG_LONG)
|
||||
if test "$ac_cv_type_short_float" = yes; then
|
||||
OPAL_C_GET_ALIGNMENT(short float, OPAL_ALIGNMENT_SHORT_FLOAT)
|
||||
fi
|
||||
OPAL_C_GET_ALIGNMENT(float, OPAL_ALIGNMENT_FLOAT)
|
||||
OPAL_C_GET_ALIGNMENT(double, OPAL_ALIGNMENT_DOUBLE)
|
||||
OPAL_C_GET_ALIGNMENT(long double, OPAL_ALIGNMENT_LONG_DOUBLE)
|
||||
@ -471,6 +483,9 @@ fi
|
||||
|
||||
# We only need these types if we're building the OMPI project, but
|
||||
# OPAL currently doesn't protect for their lack of presence well.
|
||||
if test "$ac_cv_type_short_float__Complex" = yes; then
|
||||
OPAL_C_GET_ALIGNMENT(short float _Complex, OPAL_ALIGNMENT_SHORT_FLOAT_COMPLEX)
|
||||
fi
|
||||
OPAL_C_GET_ALIGNMENT(float _Complex, OPAL_ALIGNMENT_FLOAT_COMPLEX)
|
||||
OPAL_C_GET_ALIGNMENT(double _Complex, OPAL_ALIGNMENT_DOUBLE_COMPLEX)
|
||||
OPAL_C_GET_ALIGNMENT(long double _Complex, OPAL_ALIGNMENT_LONG_DOUBLE_COMPLEX)
|
||||
|
@ -27,8 +27,9 @@ extern mca_coll_hcoll_dtype_t zero_dte_mapping;
|
||||
#define OPAL_DATATYPE_FLOAT8 16
|
||||
#define OPAL_DATATYPE_FLOAT12 17
|
||||
#define OPAL_DATATYPE_FLOAT16 18
|
||||
#define OPAL_DATATYPE_FLOAT_COMPLEX 19
|
||||
#define OPAL_DATATYPE_DOUBLE_COMPLEX 20
|
||||
#define OPAL_DATATYPE_SHORT_FLOAT_COMPLEX 19
|
||||
#define OPAL_DATATYPE_FLOAT_COMPLEX 20
|
||||
#define OPAL_DATATYPE_DOUBLE_COMPLEX 21
|
||||
|
||||
total 15 types
|
||||
*/
|
||||
@ -61,32 +62,33 @@ static dte_data_representation_t* ompi_datatype_2_dte_data_rep[OMPI_DATATYPE_MAX
|
||||
&DTE_FLOAT64, /*OPAL_DATATYPE_FLOAT8 16 */
|
||||
&DTE_FLOAT96, /*OPAL_DATATYPE_FLOAT12 17 */
|
||||
&DTE_FLOAT128, /*OPAL_DATATYPE_FLOAT16 18 */
|
||||
&DTE_ZERO, /*OPAL_DATATYPE_SHORT_FLOAT_COMPLEX 19 */
|
||||
#if defined(DTE_FLOAT32_COMPLEX)
|
||||
&DTE_FLOAT32_COMPLEX, /*OPAL_DATATYPE_COMPLEX8 19 */
|
||||
&DTE_FLOAT32_COMPLEX, /*OPAL_DATATYPE_FLOAT_COMPLEX 20 */
|
||||
#else
|
||||
&DTE_ZERO,
|
||||
#endif
|
||||
#if defined(DTE_FLOAT64_COMPLEX)
|
||||
&DTE_FLOAT64_COMPLEX, /*OPAL_DATATYPE_COMPLEX32 20 */
|
||||
&DTE_FLOAT64_COMPLEX, /*OPAL_DATATYPE_DOUBLE_COMPLEX 21 */
|
||||
#else
|
||||
&DTE_ZERO,
|
||||
#endif
|
||||
#if defined(DTE_FLOAT128_COMPLEX)
|
||||
&DTE_FLOAT128_COMPLEX, /*OPAL_DATATYPE_COMPLEX64 21 */
|
||||
&DTE_FLOAT128_COMPLEX, /*OPAL_DATATYPE_LONG_DOUBLE_COMPLEX 22 */
|
||||
#else
|
||||
&DTE_ZERO,
|
||||
#endif
|
||||
#if defined(DTE_BOOL)
|
||||
&DTE_BOOL, /*OPAL_DATATYPE_BOOL 22 */
|
||||
&DTE_BOOL, /*OPAL_DATATYPE_BOOL 23 */
|
||||
#else
|
||||
&DTE_ZERO,
|
||||
#endif
|
||||
#if defined(DTE_WCHAR)
|
||||
&DTE_WCHAR, /*OPAL_DATATYPE_WCHAR 23 */
|
||||
&DTE_WCHAR, /*OPAL_DATATYPE_WCHAR 24 */
|
||||
#else
|
||||
&DTE_ZERO,
|
||||
#endif
|
||||
&DTE_ZERO /*OPAL_DATATYPE_UNAVAILABLE 24 */
|
||||
&DTE_ZERO /*OPAL_DATATYPE_UNAVAILABLE 25 */
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -15,6 +15,7 @@
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved
|
||||
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -372,8 +373,12 @@ void ompi_info_do_config(bool want_all)
|
||||
opal_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short));
|
||||
opal_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int));
|
||||
opal_info_out_int("C long size", "compiler:c:sizeof:long", sizeof(long));
|
||||
#if defined(HAVE_SHORT_FLOAT)
|
||||
opal_info_out_int("C short float size", "compiler:c:sizeof:short_float", sizeof(short float));
|
||||
#endif
|
||||
opal_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float));
|
||||
opal_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double));
|
||||
opal_info_out_int("C long double size", "compiler:c:sizeof:long_double", sizeof(long double));
|
||||
opal_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *));
|
||||
opal_info_out_int("C char align", "compiler:c:align:char", OPAL_ALIGNMENT_CHAR);
|
||||
#if OMPI_BUILD_CXX_BINDINGS
|
||||
@ -385,8 +390,12 @@ void ompi_info_do_config(bool want_all)
|
||||
opal_info_out("C bool align", "compiler:c:align:bool", "skipped");
|
||||
#endif
|
||||
opal_info_out_int("C int align", "compiler:c:align:int", OPAL_ALIGNMENT_INT);
|
||||
#if defined(HAVE_SHORT_FLOAT)
|
||||
opal_info_out_int("C short float align", "compiler:c:align:short_float", OPAL_ALIGNMENT_SHORT_FLOAT);
|
||||
#endif
|
||||
opal_info_out_int("C float align", "compiler:c:align:float", OPAL_ALIGNMENT_FLOAT);
|
||||
opal_info_out_int("C double align", "compiler:c:align:double", OPAL_ALIGNMENT_DOUBLE);
|
||||
opal_info_out_int("C long double align", "compiler:c:align:long_double", OPAL_ALIGNMENT_LONG_DOUBLE);
|
||||
}
|
||||
|
||||
opal_info_out("C++ compiler", "compiler:cxx:command", OMPI_CXX);
|
||||
|
@ -7,6 +7,7 @@
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -149,7 +150,9 @@ COPY_CONTIGUOUS_BYTES( bytes, 8 )
|
||||
COPY_CONTIGUOUS_BYTES( bytes, 16 )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 2
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 2
|
||||
COPY_TYPE( float_2, short float, 1 )
|
||||
#elif SIZEOF_FLOAT == 2
|
||||
COPY_TYPE( float_2, float, 1 )
|
||||
#elif SIZEOF_DOUBLE == 2
|
||||
COPY_TYPE( float_2, double, 1 )
|
||||
@ -160,7 +163,9 @@ COPY_TYPE( float_2, long double, 1 )
|
||||
#define copy_float_2 NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 4
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 4
|
||||
COPY_TYPE( float_4, short float, 1 )
|
||||
#elif SIZEOF_FLOAT == 4
|
||||
COPY_TYPE( float_4, float, 1 )
|
||||
#elif SIZEOF_DOUBLE == 4
|
||||
COPY_TYPE( float_4, double, 1 )
|
||||
@ -170,7 +175,9 @@ COPY_TYPE( float_4, long double, 1 )
|
||||
#error No basic type for copy function for opal_datatype_float4 found
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 8
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 8
|
||||
COPY_TYPE( float_8, short float, 1 )
|
||||
#elif SIZEOF_FLOAT == 8
|
||||
COPY_TYPE( float_8, float, 1 )
|
||||
#elif SIZEOF_DOUBLE == 8
|
||||
COPY_TYPE( float_8, double, 1 )
|
||||
@ -180,7 +187,9 @@ COPY_TYPE( float_8, long double, 1 )
|
||||
#error No basic type for copy function for opal_datatype_float8 found
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 12
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 12
|
||||
COPY_TYPE( float_12, short float, 1 )
|
||||
#elif SIZEOF_FLOAT == 12
|
||||
COPY_TYPE( float_12, float, 1 )
|
||||
#elif SIZEOF_DOUBLE == 12
|
||||
COPY_TYPE( float_12, double, 1 )
|
||||
@ -191,7 +200,9 @@ COPY_TYPE( float_12, long double, 1 )
|
||||
#define copy_float_12 NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 16
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 16
|
||||
COPY_TYPE( float_16, short float, 1 )
|
||||
#elif SIZEOF_FLOAT == 16
|
||||
COPY_TYPE( float_16, float, 1 )
|
||||
#elif SIZEOF_DOUBLE == 16
|
||||
COPY_TYPE( float_16, double, 1 )
|
||||
@ -202,6 +213,13 @@ COPY_TYPE( float_16, long double, 1 )
|
||||
#define copy_float_16 NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SHORT_FLOAT__COMPLEX)
|
||||
COPY_TYPE ( short_float_complex, short float _Complex, 1)
|
||||
#else
|
||||
/* #error No basic type for copy function for opal_datatype_short_float_complex found */
|
||||
#define copy_short_float_complex NULL
|
||||
#endif
|
||||
|
||||
COPY_TYPE ( float_complex, float _Complex, 1)
|
||||
|
||||
COPY_TYPE ( double_complex, double _Complex, 1)
|
||||
@ -245,6 +263,7 @@ conversion_fct_t opal_datatype_copy_functions[OPAL_DATATYPE_MAX_PREDEFINED] = {
|
||||
(conversion_fct_t)copy_float_8, /* OPAL_DATATYPE_FLOAT8 */
|
||||
(conversion_fct_t)copy_float_12, /* OPAL_DATATYPE_FLOAT12 */
|
||||
(conversion_fct_t)copy_float_16, /* OPAL_DATATYPE_FLOAT16 */
|
||||
(conversion_fct_t)copy_short_float_complex, /* OPAL_DATATYPE_SHORT_FLOAT_COMPLEX */
|
||||
(conversion_fct_t)copy_float_complex, /* OPAL_DATATYPE_FLOAT_COMPLEX */
|
||||
(conversion_fct_t)copy_double_complex, /* OPAL_DATATYPE_DOUBLE_COMPLEX */
|
||||
(conversion_fct_t)copy_long_double_complex, /* OPAL_DATATYPE_LONG_DOUBLE_COMPLEX */
|
||||
|
@ -6,6 +6,7 @@
|
||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -366,7 +367,9 @@ COPY_TYPE_HETEROGENEOUS(int16, int128_t)
|
||||
#endif
|
||||
|
||||
|
||||
#if SIZEOF_FLOAT == 2
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 2
|
||||
COPY_TYPE_HETEROGENEOUS( float2, short float )
|
||||
#elif SIZEOF_FLOAT == 2
|
||||
COPY_TYPE_HETEROGENEOUS( float2, float )
|
||||
#elif SIZEOF_DOUBLE == 2
|
||||
COPY_TYPE_HETEROGENEOUS( float2, double )
|
||||
@ -377,7 +380,9 @@ COPY_TYPE_HETEROGENEOUS( float2, long double )
|
||||
#define copy_float2_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 4
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 4
|
||||
COPY_TYPE_HETEROGENEOUS( float4, short float )
|
||||
#elif SIZEOF_FLOAT == 4
|
||||
COPY_TYPE_HETEROGENEOUS( float4, float )
|
||||
#elif SIZEOF_DOUBLE == 4
|
||||
COPY_TYPE_HETEROGENEOUS( float4, double )
|
||||
@ -388,7 +393,9 @@ COPY_TYPE_HETEROGENEOUS( float4, long double )
|
||||
#define copy_float4_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 8
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 8
|
||||
COPY_TYPE_HETEROGENEOUS( float8, short float )
|
||||
#elif SIZEOF_FLOAT == 8
|
||||
COPY_TYPE_HETEROGENEOUS( float8, float )
|
||||
#elif SIZEOF_DOUBLE == 8
|
||||
COPY_TYPE_HETEROGENEOUS( float8, double )
|
||||
@ -399,7 +406,9 @@ COPY_TYPE_HETEROGENEOUS( float8, long double )
|
||||
#define copy_float8_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 12
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 12
|
||||
COPY_TYPE_HETEROGENEOUS( float12, short float )
|
||||
#elif SIZEOF_FLOAT == 12
|
||||
COPY_TYPE_HETEROGENEOUS( float12, float )
|
||||
#elif SIZEOF_DOUBLE == 12
|
||||
COPY_TYPE_HETEROGENEOUS( float12, double )
|
||||
@ -410,7 +419,9 @@ COPY_TYPE_HETEROGENEOUS( float12, long double )
|
||||
#define copy_float12_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 16
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 16
|
||||
COPY_TYPE_HETEROGENEOUS( float16, short float )
|
||||
#elif SIZEOF_FLOAT == 16
|
||||
COPY_TYPE_HETEROGENEOUS( float16, float )
|
||||
#elif SIZEOF_DOUBLE == 16
|
||||
COPY_TYPE_HETEROGENEOUS( float16, double )
|
||||
@ -421,6 +432,13 @@ COPY_TYPE_HETEROGENEOUS_INTERNAL( float16, long double, 1)
|
||||
#define copy_float16_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SHORT_FLOAT__COMPLEX)
|
||||
COPY_2SAMETYPE_HETEROGENEOUS( short_float_complex, short float _Complex )
|
||||
#else
|
||||
/* #error No basic type for copy function for opal_datatype_short_float_complex found */
|
||||
#define copy_short_float_complex_heterogeneous NULL
|
||||
#endif
|
||||
|
||||
COPY_2SAMETYPE_HETEROGENEOUS( float_complex, float )
|
||||
|
||||
COPY_2SAMETYPE_HETEROGENEOUS( double_complex, double )
|
||||
@ -450,6 +468,7 @@ conversion_fct_t opal_datatype_heterogeneous_copy_functions[OPAL_DATATYPE_MAX_PR
|
||||
[OPAL_DATATYPE_FLOAT8] = (conversion_fct_t) copy_float8_heterogeneous,
|
||||
[OPAL_DATATYPE_FLOAT12] = (conversion_fct_t) copy_float12_heterogeneous,
|
||||
[OPAL_DATATYPE_FLOAT16] = (conversion_fct_t) copy_float16_heterogeneous,
|
||||
[OPAL_DATATYPE_SHORT_FLOAT_COMPLEX] = (conversion_fct_t) copy_short_float_complex_heterogeneous,
|
||||
[OPAL_DATATYPE_FLOAT_COMPLEX] = (conversion_fct_t) copy_float_complex_heterogeneous,
|
||||
[OPAL_DATATYPE_DOUBLE_COMPLEX] = (conversion_fct_t) copy_double_complex_heterogeneous,
|
||||
[OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = (conversion_fct_t) copy_long_double_complex_heterogeneous,
|
||||
|
@ -18,6 +18,7 @@
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 Triad National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -51,7 +52,7 @@ BEGIN_C_DECLS
|
||||
* This must match the same definition as in opal_datatype_internal.h
|
||||
*/
|
||||
#if !defined(OPAL_DATATYPE_MAX_PREDEFINED)
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED 25
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED 26
|
||||
#endif
|
||||
/*
|
||||
* No more than this number of _Basic_ datatypes in C/CPP or Fortran
|
||||
@ -170,6 +171,7 @@ OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float4; /* in bytes
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float8; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float12; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float16; /* in bytes */
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_short_float_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_float_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_double_complex;
|
||||
OPAL_DECLSPEC extern const opal_datatype_t opal_datatype_long_double_complex;
|
||||
|
@ -16,6 +16,7 @@
|
||||
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2017 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -120,12 +121,13 @@ static inline void DUMP( char* fmt __opal_attribute_unused_tmp__, ... )
|
||||
#define OPAL_DATATYPE_FLOAT8 16
|
||||
#define OPAL_DATATYPE_FLOAT12 17
|
||||
#define OPAL_DATATYPE_FLOAT16 18
|
||||
#define OPAL_DATATYPE_FLOAT_COMPLEX 19
|
||||
#define OPAL_DATATYPE_DOUBLE_COMPLEX 20
|
||||
#define OPAL_DATATYPE_LONG_DOUBLE_COMPLEX 21
|
||||
#define OPAL_DATATYPE_BOOL 22
|
||||
#define OPAL_DATATYPE_WCHAR 23
|
||||
#define OPAL_DATATYPE_UNAVAILABLE 24
|
||||
#define OPAL_DATATYPE_SHORT_FLOAT_COMPLEX 19
|
||||
#define OPAL_DATATYPE_FLOAT_COMPLEX 20
|
||||
#define OPAL_DATATYPE_DOUBLE_COMPLEX 21
|
||||
#define OPAL_DATATYPE_LONG_DOUBLE_COMPLEX 22
|
||||
#define OPAL_DATATYPE_BOOL 23
|
||||
#define OPAL_DATATYPE_WCHAR 24
|
||||
#define OPAL_DATATYPE_UNAVAILABLE 25
|
||||
|
||||
#ifndef OPAL_DATATYPE_MAX_PREDEFINED
|
||||
#define OPAL_DATATYPE_MAX_PREDEFINED (OPAL_DATATYPE_UNAVAILABLE+1)
|
||||
@ -351,7 +353,9 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_UINT16(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( INT16, FLAGS )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 2
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 2
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT2(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float, OPAL_ALIGNMENT_SHORT_FLOAT, FLOAT2, FLAGS )
|
||||
#elif SIZEOF_FLOAT == 2
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT2(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float, OPAL_ALIGNMENT_FLOAT, FLOAT2, FLAGS )
|
||||
#elif SIZEOF_DOUBLE == 2
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT2(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double, OPAL_ALIGNMENT_DOUBLE, FLOAT2, FLAGS )
|
||||
@ -361,7 +365,9 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT2(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT2, FLAGS )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 4
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 4
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT4(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float, OPAL_ALIGNMENT_SHORT_FLOAT, FLOAT4, FLAGS )
|
||||
#elif SIZEOF_FLOAT == 4
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT4(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float, OPAL_ALIGNMENT_FLOAT, FLOAT4, FLAGS )
|
||||
#elif SIZEOF_DOUBLE == 4
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT4(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double, OPAL_ALIGNMENT_DOUBLE, FLOAT4, FLAGS )
|
||||
@ -371,7 +377,9 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT4(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT4, FLAGS )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 8
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 8
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT8(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float, OPAL_ALIGNMENT_SHORT_FLOAT, FLOAT8, FLAGS )
|
||||
#elif SIZEOF_FLOAT == 8
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT8(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float, OPAL_ALIGNMENT_FLOAT, FLOAT8, FLAGS )
|
||||
#elif SIZEOF_DOUBLE == 8
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT8(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double, OPAL_ALIGNMENT_DOUBLE, FLOAT8, FLAGS )
|
||||
@ -381,7 +389,9 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT8(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT8, FLAGS )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 12
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 12
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT12(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float, OPAL_ALIGNMENT_SHORT_FLOAT, FLOAT12, FLAGS )
|
||||
#elif SIZEOF_FLOAT == 12
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT12(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float, OPAL_ALIGNMENT_FLOAT, FLOAT12, FLAGS )
|
||||
#elif SIZEOF_DOUBLE == 12
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT12(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double, OPAL_ALIGNMENT_DOUBLE, FLOAT12, FLAGS )
|
||||
@ -391,7 +401,9 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT12(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT12, FLAGS )
|
||||
#endif
|
||||
|
||||
#if SIZEOF_FLOAT == 16
|
||||
#if defined(HAVE_SHORT_FLOAT) && SIZEOF_SHORT_FLOAT == 16
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT16(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float, OPAL_ALIGNMENT_SHORT_FLOAT, FLOAT16, FLAGS )
|
||||
#elif SIZEOF_FLOAT == 16
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT16(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float, OPAL_ALIGNMENT_FLOAT, FLOAT16, FLAGS )
|
||||
#elif SIZEOF_DOUBLE == 16
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT16(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double, OPAL_ALIGNMENT_DOUBLE, FLOAT16, FLAGS )
|
||||
@ -401,6 +413,12 @@ struct opal_datatype_t;
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT16(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( FLOAT16, FLAGS )
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SHORT_FLOAT__COMPLEX)
|
||||
#define OPAL_DATATYPE_INITIALIZER_SHORT_FLOAT_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( short float _Complex, OPAL_ALIGNMENT_SHORT_FLOAT_COMPLEX, SHORT_FLOAT_COMPLEX, FLAGS )
|
||||
#else
|
||||
#define OPAL_DATATYPE_INITIALIZER_SHORT_FLOAT_COMPLEX(FLAGS) OPAL_DATATYPE_INITIALIZER_UNAVAILABLE_NAMED( SHORT_FLOAT_COMPLEX, FLAGS)
|
||||
#endif
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( float _Complex, OPAL_ALIGNMENT_FLOAT_COMPLEX, FLOAT_COMPLEX, FLAGS )
|
||||
|
||||
#define OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX(FLAGS) OPAL_DATATYPE_INIT_BASIC_DATATYPE( double _Complex, OPAL_ALIGNMENT_DOUBLE_COMPLEX, DOUBLE_COMPLEX, FLAGS )
|
||||
|
@ -19,6 +19,7 @@
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2018 Triad National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -75,6 +76,7 @@ OPAL_DECLSPEC const opal_datatype_t opal_datatype_float4 = OPAL_DATATYPE_IN
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float8 = OPAL_DATATYPE_INITIALIZER_FLOAT8(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float12 = OPAL_DATATYPE_INITIALIZER_FLOAT12(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float16 = OPAL_DATATYPE_INITIALIZER_FLOAT16(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_short_float_complex = OPAL_DATATYPE_INITIALIZER_SHORT_FLOAT_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_float_complex = OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_double_complex = OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX(0);
|
||||
OPAL_DECLSPEC const opal_datatype_t opal_datatype_long_double_complex = OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX(0);
|
||||
@ -105,6 +107,11 @@ OPAL_DECLSPEC const size_t opal_datatype_local_sizes[OPAL_DATATYPE_MAX_PREDEFINE
|
||||
[OPAL_DATATYPE_FLOAT8] = 8, /* sizeof (float8) */
|
||||
[OPAL_DATATYPE_FLOAT12] = 12, /* sizeof (float12) */
|
||||
[OPAL_DATATYPE_FLOAT16] = 16, /* sizeof (float16) */
|
||||
#if defined(HAVE_SHORT_FLOAT__COMPLEX)
|
||||
[OPAL_DATATYPE_SHORT_FLOAT_COMPLEX] = sizeof(short float _Complex),
|
||||
#else
|
||||
[OPAL_DATATYPE_SHORT_FLOAT_COMPLEX] = 4, /* typical sizeof(short float _Complex) */
|
||||
#endif
|
||||
[OPAL_DATATYPE_FLOAT_COMPLEX] = sizeof(float _Complex),
|
||||
[OPAL_DATATYPE_DOUBLE_COMPLEX] = sizeof(double _Complex),
|
||||
[OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = sizeof(long double _Complex),
|
||||
@ -136,6 +143,7 @@ OPAL_DECLSPEC const opal_datatype_t* opal_datatype_basicDatatypes[OPAL_DATATYPE_
|
||||
[OPAL_DATATYPE_FLOAT8] = &opal_datatype_float8,
|
||||
[OPAL_DATATYPE_FLOAT12] = &opal_datatype_float12,
|
||||
[OPAL_DATATYPE_FLOAT16] = &opal_datatype_float16,
|
||||
[OPAL_DATATYPE_SHORT_FLOAT_COMPLEX] = &opal_datatype_short_float_complex,
|
||||
[OPAL_DATATYPE_FLOAT_COMPLEX] = &opal_datatype_float_complex,
|
||||
[OPAL_DATATYPE_DOUBLE_COMPLEX] = &opal_datatype_double_complex,
|
||||
[OPAL_DATATYPE_LONG_DOUBLE_COMPLEX] = &opal_datatype_long_double_complex,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user