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 "aicpu_context.h"
12 : #include <unistd.h>
13 :
14 : namespace aicpu {
15 0 : status_t SetOpname(const std::string& opname) { return AICPU_ERROR_NONE; }
16 :
17 0 : status_t SetThreadLocalCtx(const std::string& key, const std::string& value) { return AICPU_ERROR_NONE; }
18 :
19 0 : status_t GetThreadLocalCtx(const std::string& key, std::string& value) { return AICPU_ERROR_NONE; }
20 :
21 14 : status_t aicpuGetContext(aicpuContext_t* ctx)
22 : {
23 14 : if (ctx != nullptr) {
24 14 : ctx->deviceId = 0;
25 14 : ctx->tsId = 0;
26 14 : ctx->vfId = 0;
27 14 : ctx->hostPid = getpid();
28 : }
29 14 : return AICPU_ERROR_NONE;
30 : }
31 :
32 19 : status_t GetAicpuRunMode(uint32_t& runMode)
33 : {
34 19 : runMode = aicpu::THREAD_MODE;
35 19 : return AICPU_ERROR_NONE;
36 : }
37 :
38 32 : uint32_t GetUniqueVfId() { return 0U; }
39 :
40 0 : void SetUniqueVfId(const uint32_t uniqueVfId) { (void)uniqueVfId; }
41 :
42 0 : void SetCustAicpuSdFlag(const bool isCustAicpuSdFlag) { (void)isCustAicpuSdFlag; }
43 :
44 8 : bool IsCustAicpuSd() { return false; }
45 : } // namespace aicpu
|