1 /*
2  * Copyright (c) 2013      Mellanox Technologies, Inc.
3  *                         All rights reserved.
4  * Copyright (c) 2013 Cisco Systems, Inc.  All rights reserved.
5  * $COPYRIGHT$
6  *
7  * Additional copyrights may follow
8  *
9  * $HEADER$
10  */
11 
12 #include "oshmem_config.h"
13 #include "oshmem/shmem/fortran/bindings.h"
14 #include "oshmem/include/shmem.h"
15 #include "oshmem/shmem/shmem_api_logger.h"
16 #include "oshmem/runtime/runtime.h"
17 #include "oshmem/mca/atomic/atomic.h"
18 #include "ompi/datatype/ompi_datatype.h"
19 #include "oshmem/op/op.h"
20 #include "stdio.h"
21 
22 #if OSHMEM_PROFILING
23 #include "oshmem/shmem/fortran/profile/pbindings.h"
SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_INT8_ADD,shmem_int8_add)24 SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_INT8_ADD, shmem_int8_add)
25 #include "oshmem/shmem/fortran/profile/defines.h"
26 #endif
27 
28 SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
29         SHMEM_INT8_ADD,
30         shmem_int8_add_,
31         shmem_int8_add__,
32         shmem_int8_add_f,
33         (FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe),
34         (target,value,pe) )
35 
36 void shmem_int8_add_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe)
37 {
38     ompi_fortran_integer8_t out_value = 0;
39     oshmem_op_t* op = oshmem_op_sum_fint8;
40 
41     MCA_ATOMIC_CALL(fadd(FPTR_2_VOID_PTR(target),
42         (void *)&out_value,
43         FPTR_2_VOID_PTR(value),
44         sizeof(out_value),
45         OMPI_FINT_2_INT(*pe),
46         op));
47 }
48 
49