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 : #include "aicpusd_interface.h"
11 : #include "prof_api.h"
12 : #include "ascend_hal.h"
13 : #include "event_custom_api_struct.h"
14 : #include "aicpusd_info.h"
15 :
16 : extern "C" {
17 : /**
18 : * @brief it is used to load model with queue.
19 : * @param [in] ptr : the address of the model info
20 : * @return AICPU_SCHEDULE_OK: success other: error code
21 : */
22 1 : int32_t AicpuLoadModelWithQ(void* ptr) { return 0; }
23 :
24 1 : int32_t AicpuLoadModel(void* ptr) { return 0; }
25 :
26 : /**
27 : * @brief it is used to load the task and stream info.
28 : * @param [in] ptr : the address of the task and stream info
29 : * @return AICPU_SCHEDULE_OK: success other: error code
30 : */
31 1 : int32_t AICPUModelLoad(void* ptr) { return 0; }
32 :
33 : /**
34 : * @brief it is used to destroy the model.
35 : * @param [in] modelId : The id of model will be destroy.
36 : * @return AICPU_SCHEDULE_OK: success other: error code
37 : */
38 1 : int32_t AICPUModelDestroy(uint32_t modelId) { return 0; }
39 :
40 : /**
41 : * @brief it is used to execute the model.
42 : * @param [in] modelId : The id of model will be run.
43 : * @return AICPU_SCHEDULE_OK: success other: error code
44 : */
45 1 : int32_t AICPUModelExecute(uint32_t modelId) { return 0; }
46 :
47 : /**
48 : * @ingroup AicpuScheduleInterface
49 : * @brief it use to execute the model from call interface.
50 : * @param [in] drvEventInfo : event info.
51 : * @param [out] drvEventAck : event ack.
52 : * @return 0: success, other: error code
53 : */
54 1 : int32_t AICPUExecuteTask(struct event_info* drvEventInfo, struct event_ack* drvEventAck) { return 0; }
55 :
56 : /**
57 : * @ingroup AicpuScheduleInterface
58 : * @brief it use to preload so.
59 : * @param [in] soName : so name.
60 : * @return 0: success, other: error code
61 : */
62 1 : int32_t AICPUPreOpenKernels(const char* soName) { return 0; }
63 :
64 : /**
65 : * @brief it is used to init aicpu scheduler for acl.
66 : * @param [in] deviceId : The id of self cpu.
67 : * @param [in] hostPid : The id of host
68 : * @param [in] profilingMode : it used to open or close profiling.
69 : * @return AICPU_SCHEDULE_OK: success other: error code in StatusCode
70 : */
71 1 : int32_t InitAICPUScheduler(uint32_t deviceId, pid_t hostPid, ProfilingMode profilingMode) { return 0; }
72 :
73 : /**
74 : * @brief it is used to init aicpu scheduler for helper.
75 : * @param [in] initParam : init param ptr.
76 : * @return AICPU_SCHEDULE_SUCCESS: success other: error code in ErrorCode
77 : */
78 1 : int32_t InitCpuScheduler(const CpuSchedInitParam* const initParam) { return 0; }
79 :
80 : /**
81 : * @brief it is used to update profiling mode for acl.
82 : * @param [in] deviceId : The id of self cpu.
83 : * @param [in] hostPid : The id of host
84 : * @param [in] flag : flag[0] == 1 means PROFILING_OPEN, otherwise PROFILING_CLOSE.
85 : * @return AICPU_SCHEDULE_OK: success other: error code in StatusCode
86 : */
87 1 : int32_t UpdateProfilingMode(uint32_t deviceId, pid_t hostPid, uint32_t flag) { return 0; }
88 :
89 : /**
90 : * @brief it is used to stop the aicpu scheduler for acl.
91 : * @param [in] deviceId : The id of self cpu.
92 : * @param [in] hostPid : host pid
93 : * @return AICPU_SCHEDULE_OK: success other: error code in StatusCode
94 : */
95 1 : int32_t StopAICPUScheduler(uint32_t deviceId, pid_t hostPid) { return 0; }
96 :
97 : /**
98 : * @brief Check if the scheduling module stops running
99 : * @return true or false
100 : */
101 1 : bool AicpuIsStoped() { return false; }
102 :
103 : /**
104 : * @brief it is used to load op mapping info for data dump.
105 : * @param [in] infoAddr : The pointer of info.
106 : * @param [in] len : The length of info
107 : * @return AICPU_SCHEDULE_OK: success other: error code in StatusCode
108 : */
109 1 : int32_t LoadOpMappingInfo(const void* infoAddr, uint32_t len) { return 0; }
110 :
111 : /**
112 : * @brief it is used to set report callback function.
113 : * @param [in] reportCallback : report callback function.
114 : * @return AICPU_SCHEDULE_OK: success other: error code in StatusCode
115 : */
116 1 : int32_t AicpuSetMsprofReporterCallback(MsprofReporterCallback reportCallback) { return 0; }
117 :
118 1 : void AicpuReportNotifyInfo(const aicpu::AsyncNotifyInfo& notifyInfo) {}
119 :
120 1 : uint32_t AicpuGetTaskDefaultTimeout() { return 0; }
121 :
122 1 : void RegLastwordCallback(const std::string mark, std::function<void()> callback, std::function<void()>& cancelReg)
123 : {
124 1 : return;
125 : }
126 : }
|