This source file includes following definitions.
- SHMEM_GENERATE_WEAK_BINDINGS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include "oshmem_config.h"
16 #include "oshmem/shmem/fortran/bindings.h"
17 #include "oshmem/include/shmem.h"
18 #include "oshmem/shmem/shmem_api_logger.h"
19 #include "oshmem/runtime/runtime.h"
20 #include "oshmem/mca/atomic/atomic.h"
21 #include "ompi/datatype/ompi_datatype.h"
22 #include "stdio.h"
23
24 #if OSHMEM_PROFILING
25 #include "oshmem/shmem/fortran/profile/pbindings.h"
26 SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_INT4_CSWAP, shmem_int4_cswap)
27 #include "oshmem/shmem/fortran/profile/defines.h"
28 #endif
29
30 SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (ompi_fortran_integer4_t,
31 SHMEM_INT4_CSWAP,
32 shmem_int4_cswap_,
33 shmem_int4_cswap__,
34 shmem_int4_cswap_f,
35 (FORTRAN_POINTER_T target, MPI_Fint *cond, FORTRAN_POINTER_T value, MPI_Fint *pe),
36 (target,cond,value,pe) )
37
38 ompi_fortran_integer4_t shmem_int4_cswap_f(FORTRAN_POINTER_T target, MPI_Fint *cond, FORTRAN_POINTER_T value, MPI_Fint *pe)
39 {
40 ompi_fortran_integer8_t out_value = 0;
41
42 MCA_ATOMIC_CALL(cswap(oshmem_ctx_default, FPTR_2_VOID_PTR(target),
43 (void *)&out_value,
44 FPTR_2_INT(cond, sizeof(ompi_fortran_integer4_t)),
45 FPTR_2_INT(value, sizeof(ompi_fortran_integer4_t)),
46 sizeof(ompi_fortran_integer4_t),
47 OMPI_FINT_2_INT(*pe)));
48
49 return out_value;
50 }
51