From ea878d5dd5fc950ba83ccec9057c837cdff812f5 Mon Sep 17 00:00:00 2001 From: Sourav Chakraborty Date: Tue, 22 Jun 2021 14:04:44 -0700 Subject: [PATCH] UCT/ROCM/COPY: Fix test_uct_query gtest --- src/uct/rocm/copy/rocm_copy_iface.c | 8 +++++++- test/gtest/uct/test_p2p_rma.cc | 3 ++- test/gtest/uct/v2/test_uct_query.cc | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/uct/rocm/copy/rocm_copy_iface.c b/src/uct/rocm/copy/rocm_copy_iface.c index c3e1bf892a3..82c7a209b4d 100644 --- a/src/uct/rocm/copy/rocm_copy_iface.c +++ b/src/uct/rocm/copy/rocm_copy_iface.c @@ -130,6 +130,11 @@ static uct_iface_ops_t uct_rocm_copy_iface_ops = { .iface_is_reachable = uct_rocm_copy_iface_is_reachable, }; +static uct_iface_internal_ops_t uct_rocm_copy_iface_internal_ops = { + .iface_estimate_perf = (uct_iface_estimate_perf_func_t)ucs_empty_function_return_success, + .iface_vfs_refresh = (uct_iface_vfs_refresh_func_t)ucs_empty_function, +}; + static UCS_CLASS_INIT_FUNC(uct_rocm_copy_iface_t, uct_md_h md, uct_worker_h worker, const uct_iface_params_t *params, const uct_iface_config_t *tl_config) @@ -137,7 +142,8 @@ static UCS_CLASS_INIT_FUNC(uct_rocm_copy_iface_t, uct_md_h md, uct_worker_h work uct_rocm_copy_iface_config_t *config = ucs_derived_of(tl_config, uct_rocm_copy_iface_config_t); - UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_copy_iface_ops, NULL, + UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_copy_iface_ops, + &uct_rocm_copy_iface_internal_ops, md, worker, params, tl_config UCS_STATS_ARG(params->stats_root) UCS_STATS_ARG(UCT_ROCM_COPY_TL_NAME)); diff --git a/test/gtest/uct/test_p2p_rma.cc b/test/gtest/uct/test_p2p_rma.cc index 091a765df3a..9bf3f5caf01 100644 --- a/test/gtest/uct/test_p2p_rma.cc +++ b/test/gtest/uct/test_p2p_rma.cc @@ -71,7 +71,8 @@ void uct_p2p_rma_test::test_xfer(send_func_t send, size_t length, { ucs_memory_type_t src_mem_type = UCS_MEMORY_TYPE_HOST; - if (has_transport("cuda_ipc")) { + if (has_transport("cuda_ipc") || + has_transport("rocm_copy")) { src_mem_type = mem_type; } diff --git a/test/gtest/uct/v2/test_uct_query.cc b/test/gtest/uct/v2/test_uct_query.cc index 6ff7579c86a..022ea0df119 100644 --- a/test/gtest/uct/v2/test_uct_query.cc +++ b/test/gtest/uct/v2/test_uct_query.cc @@ -43,7 +43,9 @@ UCS_TEST_P(test_uct_query, query_perf) /* At least one type of bandwidth must be non-zero */ EXPECT_NE(0, perf_attr.bandwidth.shared + perf_attr.bandwidth.dedicated); - if (has_transport("cuda_copy") || has_transport("gdr_copy")) { + if (has_transport("cuda_copy") || + has_transport("gdr_copy") || + has_transport("rocm_copy")) { uct_perf_attr_t perf_attr_get; perf_attr_get.field_mask = UCT_PERF_ATTR_FIELD_OPERATION | UCT_PERF_ATTR_FIELD_BANDWIDTH;