@@ -948,6 +948,75 @@ UCS_TEST_P(test_ucp_proto_mock_gpu, cuda_managed_ppln_host_frag,
948948UCP_INSTANTIATE_TEST_CASE_TLS (test_ucp_proto_mock_gpu, rcx_gpu,
949949 " rc_x,cuda,rocm" )
950950
951+ class test_ucp_proto_mock_cuda_ipc : public test_ucp_proto_mock {
952+ public:
953+ test_ucp_proto_mock_cuda_ipc ()
954+ {
955+ mock_transport (" rc_mlx5" );
956+ }
957+
958+ virtual void init () override
959+ {
960+ if (!mem_buffer::is_mem_type_supported (UCS_MEMORY_TYPE_CUDA)) {
961+ UCS_TEST_SKIP_R (" CUDA memory is not supported" );
962+ }
963+
964+ add_mock_iface (" mock" , [](uct_iface_attr_t &iface_attr) {
965+ iface_attr.bandwidth .shared = 40e9 ;
966+ iface_attr.latency .c = 400e-9 ;
967+ iface_attr.latency .m = 1e-9 ;
968+ });
969+
970+ test_ucp_proto_mock::init ();
971+ }
972+
973+ ucp_worker_cfg_index_t find_rkey_cfg_index (ucs_memory_type_t mem_type)
974+ {
975+ ucp_worker_h worker = sender ().worker ();
976+ ucp_proto_select_key_t sel_key;
977+ ucp_rkey_config_t *rkey_config;
978+
979+ /* Find rkey config with required mem_type for local and remote
980+ * memory */
981+ for (auto i = 0 ; i < ucs_array_length (&worker->rkey_config ); ++i) {
982+ rkey_config = &ucs_array_elem (&worker->rkey_config , i);
983+
984+ if (rkey_config->key .mem_type != mem_type) {
985+ continue ;
986+ }
987+
988+ kh_foreach_key (rkey_config->proto_select .hash , sel_key.u64 , {
989+ if (sel_key.param .mem_type == mem_type) {
990+ return i;
991+ }
992+ })
993+ }
994+
995+ return UCP_WORKER_CFG_INDEX_NULL;
996+ }
997+ };
998+
999+ UCS_TEST_P (test_ucp_proto_mock_cuda_ipc, put_cuda, " IB_NUM_PATHS?=1" )
1000+ {
1001+ send_recv_rma_put (UCS_MBYTE, UCS_MEMORY_TYPE_CUDA);
1002+
1003+ ucp_proto_select_key_t key = any_key ();
1004+ key.param .op_id_flags = UCP_OP_ID_PUT;
1005+ key.param .op_attr = 0 ;
1006+ key.param .mem_type = UCS_MEMORY_TYPE_CUDA;
1007+
1008+ auto rkey_cfg_index = find_rkey_cfg_index (UCS_MEMORY_TYPE_CUDA);
1009+ ASSERT_NE (rkey_cfg_index, UCP_WORKER_CFG_INDEX_NULL);
1010+
1011+ check_rkey_config (sender (), {
1012+ {0 , 0 , " short" , " rc_mlx5/mock" },
1013+ {1 , INF, " zero-copy" , " cuda_ipc/cuda" },
1014+ }, key, rkey_cfg_index);
1015+ }
1016+
1017+ UCP_INSTANTIATE_TEST_CASE_TLS_GPU_AWARE (test_ucp_proto_mock_cuda_ipc,
1018+ shm_ib_ipc, " shm,ib,cuda_ipc,rocm_ipc" )
1019+
9511020class test_ucp_proto_mock_rcx_twins : public test_ucp_proto_mock {
9521021public:
9531022 test_ucp_proto_mock_rcx_twins ()
0 commit comments