Skip to content

Commit b7ee68e

Browse files
committed
Remove redundant cod and fix compilation error
Signed-off-by: Michal Shalev <[email protected]>
1 parent 0fa6861 commit b7ee68e

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/plugins/ucx/ucx_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ void* nixlUcxEngine::exportXferReqtoGPU(nixlBackendReqH* handle) const {
13441344
return nullptr;
13451345
}
13461346

1347-
return ep->exported_batch;
1347+
return ep->exported_batches.at(ucx_req);
13481348
}
13491349

13501350
nixl_status_t nixlUcxEngine::releaseXferReqtoGPU(nixlBackendReqH* handle) const {

src/utils/ucx/ucx_utils.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,9 @@ nixl_status_t nixlUcxEp::exportBatch(nixlUcxReq &req)
399399
return NIXL_ERR_INVALID_PARAM;
400400
}
401401

402-
// Clear any existing batch
403-
exported_batch = nullptr;
402+
void *exported_batch = nullptr;
404403

405-
ucs_status_t status = ucp_ep_rma_batch_export((void*)req, (ucp_batch_h*)&exported_batch);
404+
ucs_status_t status = ucp_ep_rma_batch_export((void *)req, (ucp_batch_h *)&exported_batch);
406405
if (status != UCS_OK) {
407406
NIXL_ERROR << "Failed to export batch request: " << ucs_status_string(status);
408407
exported_batch = nullptr;
@@ -420,7 +419,7 @@ nixl_status_t nixlUcxEp::releaseBatch(nixlUcxReq &req)
420419
return NIXL_ERR_INVALID_PARAM;
421420
}
422421

423-
ucs_status_t status = ucp_ep_rma_batch_release((void *)req, exported_batches[req]);
422+
ucs_status_t status = ucp_ep_rma_batch_release((void *)req, (ucp_batch_h)exported_batches[req]);
424423
if (status != UCS_OK) {
425424
NIXL_ERROR << "Failed to release UCX batch: " << ucs_status_string(status);
426425
}

src/utils/ucx/ucx_utils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ class nixlUcxEp {
8686
nixl_status_t disconnect_nb();
8787
public:
8888
void err_cb(ucp_ep_h ucp_ep, ucs_status_t status);
89-
void* exported_batch{nullptr};
90-
std::unordered_map<nixlUcxReq, ucp_batch_h> exported_batches;
89+
std::unordered_map<nixlUcxReq, void *> exported_batches;
9190

9291
nixl_status_t checkTxState() const {
9392
switch (state) {

0 commit comments

Comments
 (0)