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 <cstdarg>
11 : #include "set_device_vxx.h"
12 : #include "acl_rt_impl.h"
13 : #include "toolchain/dump_shim.h"
14 : #include "adump_pub.h"
15 : #include "adx_datadump_server.h"
16 :
17 : namespace {
18 35 : int32_t SetDumpConfigByShim(const acl::AdumpDumpConfigInfo& configInfo)
19 : {
20 : Adx::DumpConfigInfo adxConfigInfo;
21 35 : adxConfigInfo.dumpConfigPath = configInfo.dumpConfigPath;
22 35 : adxConfigInfo.dumpConfigData = configInfo.dumpConfigData;
23 35 : adxConfigInfo.dumpConfigSize = configInfo.dumpConfigSize;
24 70 : return Adx::AdumpSetDumpConfig(adxConfigInfo);
25 : }
26 :
27 1 : __attribute__((constructor)) void InitializeAscendDump()
28 : {
29 : acl::AdumpCallbacks callbacks;
30 1 : callbacks.setDumpConfig = &SetDumpConfigByShim;
31 1 : callbacks.unsetDump = &Adx::AdumpUnSetDump;
32 1 : callbacks.serverInit = &AdxDataDumpServerInit;
33 1 : callbacks.serverUnInit = &AdxDataDumpServerUnInit;
34 1 : acl::SetAdumpCallbacks(callbacks);
35 1 : }
36 : } // namespace
37 :
38 199 : ACL_FUNC_MAP(ACL_RT_CPP)
39 :
40 1649 : ACL_RT_FUNC_MAP(ACL_RT_CPP)
41 :
42 101 : ACL_MDLRI_FUNC_MAP(ACL_RT_CPP)
43 :
44 50 : ACL_MDL_FUNC_MAP(ACL_RT_CPP)
45 :
46 29 : ACL_RT_ALLOCATOR_FUNC_MAP(ACL_RT_CPP)
47 :
48 9 : void aclAppLog(aclLogLevel logLevel, const char* func, const char* file, uint32_t line, const char* fmt, ...)
49 : {
50 : va_list args;
51 9 : va_start(args, fmt);
52 9 : aclAppLogImpl(logLevel, func, file, line, fmt, args);
53 9 : va_end(args);
54 9 : }
55 :
56 1 : extern "C" ACL_FUNC_VISIBILITY void aclAppLogWithArgs(
57 : aclLogLevel logLevel, const char* func, const char* file, uint32_t line, const char* fmt, va_list args)
58 : {
59 1 : aclAppLogImpl(logLevel, func, file, line, fmt, args);
60 1 : }
|