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 "aicpusd_status.h"
12 : #include "ascend_hal.h"
13 : #include "tsd.h"
14 :
15 : #ifdef __cplusplus
16 : extern "C" {
17 : #endif
18 :
19 2 : drvError_t halGetDeviceInfo(uint32_t devId, int32_t moduleType, int32_t infoType, int64_t *value)
20 : {
21 : (void)devId;
22 2 : aicpusd_info("Get host aicpu num in stub func[%s].", __func__);
23 2 : const int64_t hostAicpuNum = 64;
24 2 : const int64_t hostAicpuBitMap = 0;
25 2 : if (moduleType == MODULE_TYPE_AICPU && infoType == INFO_TYPE_CORE_NUM) {
26 1 : *value = hostAicpuNum;
27 1 : } else if (moduleType == MODULE_TYPE_AICPU && infoType == INFO_TYPE_OCCUPY) {
28 1 : *value = hostAicpuBitMap;
29 : }
30 2 : return DRV_ERROR_NONE;
31 : }
32 : #ifdef __cplusplus
33 : }
34 : #endif
35 :
36 1 : drvError_t drvBindHostPid(struct drvBindHostpidInfo info)
37 : {
38 : (void)info;
39 1 : aicpusd_info("Bind host pid in stub func[%s].", __func__);
40 1 : return DRV_ERROR_NONE;
41 : }
42 :
43 1 : drvError_t drvQueryProcessHostPid(int pid, unsigned int *chip_id, unsigned int *vfid,
44 : unsigned int *host_pid, unsigned int *cp_type)
45 : {
46 : (void)pid;
47 : (void)chip_id;
48 : (void)vfid;
49 : (void)host_pid;
50 : (void)cp_type;
51 1 : return DRV_ERROR_NONE;
52 : }
53 :
54 1 : DVresult halMemInitSvmDevice(int hostpid, unsigned int vfid, unsigned int dev_id)
55 : {
56 : (void)hostpid;
57 : (void)vfid;
58 : (void)dev_id;
59 1 : aicpusd_info("Init svm mem in stub func[%s].", __func__);
60 1 : return DRV_ERROR_NONE;
61 : }
62 :
63 1 : int halGetDeviceVfMax(unsigned int devId, unsigned int *vf_max_num)
64 : {
65 1 : aicpusd_info("Get device max vf in stub func[%s].", __func__);
66 : (void)devId;
67 : (void)vf_max_num;
68 1 : return DRV_ERROR_NONE;
69 : }
70 :
71 1 : int halGetDeviceVfList(unsigned int devId, unsigned int *vf_list, unsigned int list_len, unsigned int *vf_num)
72 : {
73 1 : aicpusd_info("Get device vf list in stub func[%s].", __func__);
74 : (void)devId;
75 : (void)vf_list;
76 : (void)list_len;
77 : (void)vf_num;
78 1 : return DRV_ERROR_NONE;
79 : }
|