This source file includes following definitions.
- mca_atomic_mxm_add
- mca_atomic_mxm_fadd
1
2
3
4
5
6
7
8
9
10
11
12
13 #include "oshmem_config.h"
14 #include <stdio.h>
15 #include <stdlib.h>
16
17 #include "oshmem/constants.h"
18 #include "oshmem/op/op.h"
19 #include "oshmem/mca/spml/spml.h"
20 #include "oshmem/mca/atomic/atomic.h"
21 #include "oshmem/mca/atomic/base/base.h"
22 #include "oshmem/mca/memheap/memheap.h"
23 #include "oshmem/mca/memheap/base/base.h"
24 #include "oshmem/runtime/runtime.h"
25
26 #include "atomic_mxm.h"
27
28 int mca_atomic_mxm_add(shmem_ctx_t ctx,
29 void *target,
30 uint64_t value,
31 size_t size,
32 int pe)
33 {
34 mxm_send_req_t sreq;
35 static char dummy_buf[8];
36
37 mca_atomic_mxm_req_init(&sreq, pe, target, size);
38
39 sreq.op.atomic.value = value;
40 sreq.opcode = MXM_REQ_OP_ATOMIC_FADD;
41 sreq.base.data.buffer.ptr = dummy_buf;
42
43 mca_atomic_mxm_post(&sreq);
44
45 return OSHMEM_SUCCESS;
46 }
47
48 int mca_atomic_mxm_fadd(shmem_ctx_t ctx,
49 void *target,
50 void *prev,
51 uint64_t value,
52 size_t size,
53 int pe)
54 {
55 mxm_send_req_t sreq;
56
57 mca_atomic_mxm_req_init(&sreq, pe, target, size);
58
59 sreq.op.atomic.value = value;
60 sreq.opcode = MXM_REQ_OP_ATOMIC_FADD;
61 sreq.base.data.buffer.ptr = prev;
62
63 mca_atomic_mxm_post(&sreq);
64
65 return OSHMEM_SUCCESS;
66 }