Line data Source code
1 : /**
2 : * Copyright (c) 2025 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 "orion_adapter_tsd.h"
12 : #include "log.h"
13 : #include "rt_external_device.h"
14 :
15 : namespace Hccl {
16 :
17 : const std::string HDC_TYPE_EXT_PAM = "--hdcType=18";
18 :
19 2 : HcclResult HrtOpenTsdProcess(u32 deviceLogicId)
20 : {
21 : rtNetServiceOpenArgs openArgs;
22 2 : rtProcExtParam extParam{};
23 2 : extParam.paramInfo = HDC_TYPE_EXT_PAM.c_str();
24 2 : extParam.paramLen = HDC_TYPE_EXT_PAM.size();
25 2 : openArgs.extParamCnt = 1UL;
26 2 : openArgs.extParamList = &extParam;
27 2 : rtError_t aclret = rtOpenNetService(&openArgs);
28 2 : if (aclret != 0) {
29 0 : HCCL_INFO("deviceLogicId = %u TsdProcessOpen fail aclret:%d", deviceLogicId, aclret);
30 0 : return HcclResult::HCCL_E_UNAVAIL;
31 : } else {
32 6 : HCCL_INFO("deviceLogicId = %u TsdProcessOpen success", deviceLogicId);
33 2 : return HcclResult::HCCL_SUCCESS;
34 : }
35 : }
36 : } // namespace Hccl
|