aclrtAtomicOperation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
typedef enum aclrtAtomicOperation {
    ACL_RT_ATOMIC_OPERATION_INTEGER_ADD = 0,       // Atomic integer addition, corresponding to the asc_atomic_add API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_INTEGER_MIN = 1,       // Atomic integer minimum, corresponding to the asc_atomic_min API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_INTEGER_MAX = 2,       // Atomic integer maximum, corresponding to the asc_atomic_max API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_INTEGER_INCREMENT = 3, // Atomic integer increment, corresponding to the asc_atomic_inc API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_INTEGER_DECREMENT = 4, // Atomic integer decrement, corresponding to the asc_atomic_dec API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_AND = 5,               // Atomic bitwise AND (&), corresponding to the asc_atomic_and API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_OR = 6,                // Atomic bitwise  OR (|), corresponding to the asc_atomic_or API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_XOR = 7,               // Atomic bitwise XOR (^) , corresponding to the asc_atomic_xor API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_EXCHANGE = 8,          // Atomic value exchange, corresponding to the asc_atomic_exch API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_CAS = 9,               // Atomic compare-and-swap, corresponding to the asc_atomic_cas API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_FLOAT_ADD = 10,        // Atomic floating-point addition, corresponding to the asc_atomic_add API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_FLOAT_MIN = 11,        // Atomic floating-point minimum, corresponding to the asc_atomic_min API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_FLOAT_MAX = 12,        // Atomic floating-point maximum, corresponding to the asc_atomic_max API in Ascend C.

    /* The preceding options are atomic operations based on Single Instruction Multiple Thread (SIMT) programming. */
    /* The following options are atomic operations based on Single Instruction Multiple Data (SIMD) programming. */

    ACL_RT_ATOMIC_OPERATION_DMA_ADD = 30,          // Atomic addition, corresponding to the SetAtomicAdd API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_DMA_MIN = 31,          // Atomic minimum, corresponding to the SetAtomicMin API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_DMA_MAX = 32,          // Atomic maximum, corresponding to the SetAtomicMax API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_SIMD_SCALAR_ADD = 40,  // Atomic addition, corresponding to the AtomicAdd API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_SIMD_SCALAR_MIN = 41,  // Atomic minimum, corresponding to the AtomicMin API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_SIMD_SCALAR_MAX = 42,  // Atomic maximum, corresponding to the AtomicMax API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_SIMD_SCALAR_CAS = 43,  // Atomic compare-and-swap, corresponding to the AtomicCas API in Ascend C.
    ACL_RT_ATOMIC_OPERATION_SIMD_SCALAR_EXCH = 44, // Atomic value exchange, corresponding to the AtomicExch API in Ascend C.
} aclrtAtomicOperation;