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 18 : static const Adx::DataDumpInterface defaultPlat;
29 18 : auto *plat = Adx::DataDumpManager::Get();
30 18 : return (plat != nullptr) ? plat->GetBlockNum() : defaultPlat.GetBlockNum();
31 : }
32 :
33 20 : bool AdxEnableSimtDump(size_t dumpWorkSpaceSize)
34 : {
35 20 : auto *plat = Adx::DataDumpManager::Get();
36 20 : if (plat == nullptr) {
37 13 : return false;
38 : }
39 7 : return plat->IsSimtDumpEnabled(dumpWorkSpaceSize);
40 : }
41 :
42 15 : int32_t GetStreamSynchronizeTimeout()
43 : {
44 15 : static const Adx::DataDumpInterface defaultPlat;
45 15 : auto *plat = Adx::DataDumpManager::Get();
46 15 : return (plat != nullptr) ? plat->GetStreamSyncTimeout() : defaultPlat.GetStreamSyncTimeout();
47 : }
48 :
49 : #ifdef __cplusplus
50 : }
51 : #endif
|