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 <cstring>
11 : #include "runtime/base.h"
12 : #include "runtime/dev.h"
13 : #include "dump_printf_platform.h"
14 : #include "adump_platform_manager.h"
15 :
16 : #ifdef __cplusplus
17 : extern "C" {
18 : #endif
19 :
20 8 : size_t AdxGetCoreTypeIDOffset()
21 : {
22 8 : static const Adx::DataDumpInterface defaultPlat;
23 8 : auto* plat = Adx::DataDumpManager::Get();
24 8 : return (plat != nullptr) ? plat->GetCoreTypeIDOffset() : defaultPlat.GetCoreTypeIDOffset();
25 : }
26 :
27 18 : size_t AdxGetBlockNum()
28 : {
29 18 : static const Adx::DataDumpInterface defaultPlat;
30 18 : auto* plat = Adx::DataDumpManager::Get();
31 18 : return (plat != nullptr) ? plat->GetBlockNum() : defaultPlat.GetBlockNum();
32 : }
33 :
34 20 : bool AdxEnableSimtDump(size_t dumpWorkSpaceSize)
35 : {
36 20 : auto* plat = Adx::DataDumpManager::Get();
37 20 : if (plat == nullptr) {
38 13 : return false;
39 : }
40 7 : return plat->IsSimtDumpEnabled(dumpWorkSpaceSize);
41 : }
42 :
43 15 : int32_t GetStreamSynchronizeTimeout()
44 : {
45 15 : static const Adx::DataDumpInterface defaultPlat;
46 15 : auto* plat = Adx::DataDumpManager::Get();
47 15 : return (plat != nullptr) ? plat->GetStreamSyncTimeout() : defaultPlat.GetStreamSyncTimeout();
48 : }
49 :
50 : #ifdef __cplusplus
51 : }
52 : #endif
|