Line data Source code
1 : /**
2 : * Copyright (c) 2026 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #include "uboe_ub_rtp_endpoint_helper.h"
12 : #include <algorithm>
13 : #include "log.h"
14 :
15 : namespace hcomm {
16 :
17 15 : UboeUbRtpEndpointHelper::UboeUbRtpEndpointHelper(const EndpointDesc& endpointDesc) : Endpoint(endpointDesc) {}
18 :
19 0 : HcclResult UboeUbRtpEndpointHelper::ServerSocketListen([[maybe_unused]] const uint32_t port)
20 : {
21 0 : HCCL_INFO("%s is not supported", __func__);
22 0 : return HCCL_SUCCESS;
23 : }
24 :
25 0 : HcclResult UboeUbRtpEndpointHelper::ServerSocketStopListen([[maybe_unused]] const uint32_t port)
26 : {
27 0 : HCCL_INFO("%s is not supported", __func__);
28 0 : return HCCL_SUCCESS;
29 : }
30 :
31 10 : HcclResult UboeUbRtpEndpointHelper::RegisterMemory(HcommMem mem, const char* memTag, void** memHandle)
32 : {
33 10 : CHK_RET(regedMemMgr_->RegisterMemory(mem, memTag, memHandle));
34 7 : return HCCL_SUCCESS;
35 : }
36 :
37 10 : HcclResult UboeUbRtpEndpointHelper::UnregisterMemory(void* memHandle)
38 : {
39 10 : CHK_RET(regedMemMgr_->UnregisterMemory(memHandle));
40 7 : return HCCL_SUCCESS;
41 : }
42 :
43 0 : HcclResult UboeUbRtpEndpointHelper::MemoryExport(void* memHandle, void** memDesc, uint32_t* memDescLen)
44 : {
45 0 : CHK_RET(regedMemMgr_->MemoryExport(endpointDesc_, memHandle, memDesc, memDescLen));
46 0 : return HCCL_SUCCESS;
47 : }
48 :
49 0 : HcclResult UboeUbRtpEndpointHelper::MemoryImport(const void* memDesc, uint32_t descLen, HcommMem* outMem)
50 : {
51 0 : CHK_RET(regedMemMgr_->MemoryImport(memDesc, descLen, outMem));
52 0 : return HCCL_SUCCESS;
53 : }
54 :
55 0 : HcclResult UboeUbRtpEndpointHelper::MemoryUnimport(const void* memDesc, uint32_t descLen)
56 : {
57 0 : CHK_RET(regedMemMgr_->MemoryUnimport(memDesc, descLen));
58 0 : return HCCL_SUCCESS;
59 : }
60 :
61 0 : HcclResult UboeUbRtpEndpointHelper::GetAllMemHandles(void** memHandles, uint32_t* memHandleNum)
62 : {
63 0 : CHK_RET(regedMemMgr_->GetAllMemHandles(memHandles, memHandleNum));
64 0 : return HCCL_SUCCESS;
65 : }
66 :
67 : } // namespace hcomm
|