root/oshmem/shmem/fortran/shmem_int4_cswap_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. SHMEM_GENERATE_WEAK_BINDINGS

   1 /*
   2  * Copyright (c) 2013      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * Copyright (c) 2013 Cisco Systems, Inc.  All rights reserved.
   5  * Copyright (c) 2014      Research Organization for Information Science
   6  *                         and Technology (RIST). All rights reserved.
   7  * Copyright (c) 2019      IBM Corporation.  All rights reserved.
   8  * $COPYRIGHT$
   9  *
  10  * Additional copyrights may follow
  11  *
  12  * $HEADER$
  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 

/* [<][>][^][v][top][bottom][index][help] */