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_ubg_endpoint_helper.h"
12 : #include <algorithm>
13 : #include "log.h"
14 :
15 : namespace hcomm {
16 :
17 15 : UboeUbgEndpointHelper::UboeUbgEndpointHelper(const EndpointDesc &endpointDesc)
18 15 : : Endpoint(endpointDesc)
19 : {
20 15 : }
21 :
22 0 : HcclResult UboeUbgEndpointHelper::ServerSocketListen(const uint32_t port)
23 : {
24 0 : HCCL_INFO("%s is not supported", __func__);
25 0 : return HCCL_SUCCESS;
26 : }
27 :
28 0 : HcclResult UboeUbgEndpointHelper::ServerSocketStopListen(const uint32_t port)
29 : {
30 0 : HCCL_INFO("%s is not supported", __func__);
31 0 : return HCCL_SUCCESS;
32 : }
33 :
34 10 : HcclResult UboeUbgEndpointHelper::RegisterMemory(HcommMem mem, const char *memTag, void **memHandle)
35 : {
36 10 : CHK_RET(regedMemMgr_->RegisterMemory(mem, memTag, memHandle));
37 7 : return HCCL_SUCCESS;
38 : }
39 :
40 10 : HcclResult UboeUbgEndpointHelper::UnregisterMemory(void* memHandle)
41 : {
42 10 : CHK_RET(regedMemMgr_->UnregisterMemory(memHandle));
43 7 : return HCCL_SUCCESS;
44 : }
45 :
46 0 : HcclResult UboeUbgEndpointHelper::MemoryExport(void *memHandle, void **memDesc, uint32_t *memDescLen)
47 : {
48 0 : CHK_RET(regedMemMgr_->MemoryExport(endpointDesc_, memHandle, memDesc, memDescLen));
49 0 : return HCCL_SUCCESS;
50 : }
51 :
52 0 : HcclResult UboeUbgEndpointHelper::MemoryImport(const void *memDesc, uint32_t descLen, HcommMem *outMem)
53 : {
54 0 : CHK_RET(regedMemMgr_->MemoryImport(memDesc, descLen, outMem));
55 0 : return HCCL_SUCCESS;
56 : }
57 :
58 0 : HcclResult UboeUbgEndpointHelper::MemoryUnimport(const void *memDesc, uint32_t descLen)
59 : {
60 0 : CHK_RET(regedMemMgr_->MemoryUnimport(memDesc, descLen));
61 0 : return HCCL_SUCCESS;
62 : }
63 :
64 0 : HcclResult UboeUbgEndpointHelper::GetAllMemHandles(void **memHandles, uint32_t *memHandleNum)
65 : {
66 0 : CHK_RET(regedMemMgr_->GetAllMemHandles(memHandles, memHandleNum));
67 0 : return HCCL_SUCCESS;
68 : }
69 :
70 : }
|