Skip to content

Commit 8be95d7

Browse files
committed
Avoid name collisions with intrinsics functions
Many compilers (tested with gcc and clang) use the memcpy and memmove keywords as intrinsics functions. They also lack a proper syntactic matching, and this prevents the use of any intrincs names as members of structures. Use a different name for the 2 members of the accelerator framework that handles memory copies and moves. Fixes #10869. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent d8c1471 commit 8be95d7

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

ompi/mca/coll/cuda/coll_cuda.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static inline int mca_coll_cuda_check_buf(void *addr)
9797
static inline void *mca_coll_cuda_memcpy(void *dest, const void *src, size_t size)
9898
{
9999
int res;
100-
res = opal_accelerator.memcpy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
101-
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
100+
res = opal_accelerator.mem_copy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
101+
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
102102
if (res != 0) {
103103
opal_output(0, "CUDA: Error in cuMemcpy: res=%d, dest=%p, src=%p, size=%d", res, dest, src,
104104
(int) size);

opal/datatype/opal_convertor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void *opal_convertor_accelerator_memcpy(void *dest, const void *src, size
5252
return MEMCPY(dest, src, size);
5353
}
5454

55-
res = opal_accelerator.memcpy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
55+
res = opal_accelerator.mem_copy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
5656
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
5757
if (OPAL_SUCCESS != res) {
5858
opal_output(0, "Error in accelerator memcpy");

opal/datatype/opal_datatype_copy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
static void *opal_datatype_accelerator_memcpy(void *dest, const void *src, size_t size)
5959
{
6060
int res;
61-
res = opal_accelerator.memcpy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
61+
res = opal_accelerator.mem_copy(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
6262
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
6363
if (OPAL_SUCCESS != res) {
6464
opal_output(0, "Error in accelerator memcpy");
@@ -70,8 +70,8 @@ static void *opal_datatype_accelerator_memcpy(void *dest, const void *src, size_
7070
static void *opal_datatype_accelerator_memmove(void *dest, const void *src, size_t size)
7171
{
7272
int res;
73-
res = opal_accelerator.memmove(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
74-
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
73+
res = opal_accelerator.mem_move(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
74+
dest, src, size, MCA_ACCELERATOR_TRANSFER_UNSPEC);
7575
if (OPAL_SUCCESS != res) {
7676
opal_output(0, "Error in accelerator memmove");
7777
abort();

opal/mca/accelerator/accelerator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ typedef struct {
386386
opal_accelerator_base_module_record_event_fn_t record_event;
387387
opal_accelerator_base_module_query_event_fn_t query_event;
388388

389-
opal_accelerator_base_module_memcpy_async_fn_t memcpy_async;
390-
opal_accelerator_base_module_memcpy_fn_t memcpy;
391-
opal_accelerator_base_module_memmove_fn_t memmove;
389+
opal_accelerator_base_module_memcpy_async_fn_t mem_copy_async;
390+
opal_accelerator_base_module_memcpy_fn_t mem_copy;
391+
opal_accelerator_base_module_memmove_fn_t mem_move;
392392

393393
opal_accelerator_base_module_mem_alloc_fn_t mem_alloc;
394394
opal_accelerator_base_module_mem_release_fn_t mem_release;

opal/mca/btl/smcuda/btl_smcuda_accelerator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ int mca_btl_smcuda_memcpy(void *dst, void *src, size_t amount, char *msg,
209209
}
210210
}
211211

212-
result = opal_accelerator.memcpy_async(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
213-
dst, src, amount, ipc_stream, MCA_ACCELERATOR_TRANSFER_UNSPEC);
212+
result = opal_accelerator.mem_copy_async(MCA_ACCELERATOR_NO_DEVICE_ID, MCA_ACCELERATOR_NO_DEVICE_ID,
213+
dst, src, amount, ipc_stream, MCA_ACCELERATOR_TRANSFER_UNSPEC);
214214
if (OPAL_UNLIKELY(OPAL_SUCCESS != result)) {
215215
opal_output_verbose(1, mca_btl_smcuda_component.cuda_ipc_output, "smcuda: memcpy async failed: %d",
216216
result);

0 commit comments

Comments
 (0)