Skip to content

Commit 0e35b44

Browse files
committed
src/modules/transport: fix unused variable warnings in ibgda/ibrc
- move GDRCopy-only temps inside NVSHMEM_USE_GDRCOPY guards in ibgda/ibrc - avoid unused-variable warnings when GDRCopy is disabled Signed-off-by: Ruiqing Feng <fengrq@mail.ustc.edu.cn>
1 parent 919760f commit 0e35b44

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/modules/transport/ibgda/ibgda.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,6 @@ static int ibgda_gpu_mem_alloc(struct ibgda_mem_object **pmobject, size_t size,
10321032
void *aligned_ptr;
10331033
size_t bufsize = size;
10341034

1035-
void *cpu_ptr_base = NULL;
1036-
void *cpu_ptr = NULL;
1037-
10381035
struct ibgda_mem_object *mobject =
10391036
(struct ibgda_mem_object *)calloc(1, sizeof(struct ibgda_mem_object));
10401037
NVSHMEMI_NULL_ERROR_JMP(mobject, status, NVSHMEMX_ERROR_OUT_OF_MEMORY, out,
@@ -1066,6 +1063,9 @@ static int ibgda_gpu_mem_alloc(struct ibgda_mem_object **pmobject, size_t size,
10661063
if (host_mapping) {
10671064
#ifdef NVSHMEM_USE_GDRCOPY
10681065
if (use_gdrcopy) {
1066+
void *cpu_ptr_base = NULL;
1067+
void *cpu_ptr = NULL;
1068+
10691069
status = gdrcopy_ftable.pin_buffer(gdr_desc, (unsigned long)aligned_ptr,
10701070
IBGDA_ROUND_UP(size, IBGDA_GPAGE_SIZE), 0, 0,
10711071
&mobject->mh);

src/modules/transport/ibrc/ibrc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,6 @@ int nvshmemt_ibrc_amo(struct nvshmem_transport *tcurr, int pe, void *curetptr, a
11941194
struct ibv_send_wr *sr, **bad_sr;
11951195
struct ibv_sge *sge;
11961196
int op_id;
1197-
struct ibrc_atomic_op op;
1198-
11991197
ep = (struct ibrc_ep *)nvshmemt_ib_common_get_ep_from_qp_index(tcurr, qp_index, pe);
12001198

12011199
status = nvshmemt_ib_common_check_poll_avail(tcurr, ep, NVSHMEMT_IB_COMMON_WAIT_ANY);
@@ -1236,6 +1234,8 @@ int nvshmemt_ibrc_amo(struct nvshmem_transport *tcurr, int pe, void *curetptr, a
12361234
}
12371235

12381236
#ifdef NVSHMEM_USE_GDRCOPY
1237+
struct ibrc_atomic_op op;
1238+
12391239
/* we track if the memory handle is EGM based so that GDRCOPY can be disabled*/
12401240
is_egm = check_egm(remote->remote_memdesc.ptr, tcurr->egm_map);
12411241
if (is_egm) {

0 commit comments

Comments
 (0)