@@ -263,13 +263,19 @@ bool caf_owns_mpi = false;
263
263
264
264
/* Foo function pointers for coreduce.
265
265
The handles when arguments are passed by reference. */
266
+ int (* int8_t_by_reference )(void * , void * );
267
+ int (* int16_t_by_reference )(void * , void * );
266
268
int (* int32_t_by_reference )(void * , void * );
269
+ int (* int64_t_by_reference )(void * , void * );
267
270
float (* float_by_reference )(void * , void * );
268
271
double (* double_by_reference )(void * , void * );
269
272
/* Strings are always passed by reference. */
270
273
void (* char_by_reference )(void * , int , void * , void * , int , int );
271
274
/* The handles when arguments are passed by value. */
275
+ int8_t (* int8_t_by_value )(int8_t , int8_t );
276
+ int16_t (* int16_t_by_value )(int16_t , int16_t );
272
277
int (* int32_t_by_value )(int32_t , int32_t );
278
+ int64_t (* int64_t_by_value )(int64_t , int64_t );
273
279
float (* float_by_value )(float , float );
274
280
double (* double_by_value )(double , double );
275
281
@@ -6635,7 +6641,10 @@ name##_by_value_adapter (void *invec, void *inoutvec, int *len, \
6635
6641
} \
6636
6642
}
6637
6643
6644
+ GEN_COREDUCE (redux_int8 , int8_t )
6645
+ GEN_COREDUCE (redux_int16 , int16_t )
6638
6646
GEN_COREDUCE (redux_int32 , int32_t )
6647
+ GEN_COREDUCE (redux_int64 , int64_t )
6639
6648
GEN_COREDUCE (redux_real32 , float )
6640
6649
GEN_COREDUCE (redux_real64 , double )
6641
6650
@@ -6979,8 +6988,20 @@ PREFIX (co_reduce) (gfc_descriptor_t *a, void *(*opr) (void *, void *), int opr_
6979
6988
* arguments to be passed by value. */
6980
6989
if ((opr_flags & GFC_CAF_ARG_VALUE ) > 0 )
6981
6990
{
6982
- int32_t_by_value = (typeof (VALUE_FUNC (int32_t )))opr ;
6983
- MPI_Op_create (redux_int32_by_value_adapter , 1 , & op );
6991
+ #define ifTypeGen (type ) if (GFC_DESCRIPTOR_SIZE(a) == sizeof (type ## _t)) \
6992
+ { \
6993
+ type ## _t_by_value = (typeof (VALUE_FUNC(type ## _t)))opr; \
6994
+ MPI_Op_create(redux_ ## type ## _by_value_adapter, 1, &op); \
6995
+ }
6996
+
6997
+ ifTypeGen (int8 )
6998
+ else ifTypeGen (int16 )
6999
+ else ifTypeGen (int32 )
7000
+ else ifTypeGen (int64 )
7001
+ else
7002
+ {
7003
+ caf_runtime_error ("CO_REDUCE unsupported integer datatype" );
7004
+ }
6984
7005
}
6985
7006
else
6986
7007
{
0 commit comments