root/opal/include/opal_stdatomic.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2018      Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #if !defined(OPAL_STDATOMIC_H)
  13 #define OPAL_STDATOMIC_H
  14 
  15 #include "opal_stdint.h"
  16 
  17 #if OPAL_ASSEMBLY_BUILTIN != OPAL_BUILTIN_C11
  18 
  19 typedef volatile int opal_atomic_int_t;
  20 typedef volatile long opal_atomic_long_t;
  21 
  22 typedef volatile int32_t opal_atomic_int32_t;
  23 typedef volatile uint32_t opal_atomic_uint32_t;
  24 typedef volatile int64_t opal_atomic_int64_t;
  25 typedef volatile uint64_t opal_atomic_uint64_t;
  26 
  27 typedef volatile size_t opal_atomic_size_t;
  28 typedef volatile ssize_t opal_atomic_ssize_t;
  29 typedef volatile intptr_t opal_atomic_intptr_t;
  30 typedef volatile uintptr_t opal_atomic_uintptr_t;
  31 
  32 #else /* OPAL_HAVE_C__ATOMIC */
  33 
  34 #include <stdatomic.h>
  35 
  36 typedef atomic_int opal_atomic_int_t;
  37 typedef atomic_long opal_atomic_long_t;
  38 
  39 typedef _Atomic int32_t opal_atomic_int32_t;
  40 typedef _Atomic uint32_t opal_atomic_uint32_t;
  41 typedef _Atomic int64_t opal_atomic_int64_t;
  42 typedef _Atomic uint64_t opal_atomic_uint64_t;
  43 
  44 typedef _Atomic size_t opal_atomic_size_t;
  45 typedef _Atomic ssize_t opal_atomic_ssize_t;
  46 typedef _Atomic intptr_t opal_atomic_intptr_t;
  47 typedef _Atomic uintptr_t opal_atomic_uintptr_t;
  48 
  49 #endif /* OPAL_HAVE_C__ATOMIC */
  50 
  51 #if HAVE_OPAL_INT128_T
  52 
  53 /* do not use C11 atomics for __int128 if they are not lock free */
  54 #if OPAL_HAVE_C11_CSWAP_INT128
  55 
  56 typedef _Atomic opal_int128_t opal_atomic_int128_t;
  57 
  58 #else
  59 
  60 typedef volatile opal_int128_t opal_atomic_int128_t;
  61 
  62 #endif
  63 
  64 #endif
  65 
  66 #endif /* !defined(OPAL_STDATOMIC_H) */

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