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_sharder.h"
12 : #include <atomic>
13 : #include <semaphore.h>
14 : #include <unistd.h>
15 : #include <error.h>
16 : #include <cstring>
17 : #include <algorithm>
18 : #include <cerrno>
19 :
20 : namespace aicpu {
21 1 : SharderNonBlock::SharderNonBlock()
22 1 : : cpuCoreNum_(0U),
23 1 : randomKernelScheduler_(nullptr),
24 1 : splitKernelScheduler_(nullptr),
25 1 : splitKernelGetProcesser_(nullptr),
26 1 : parallelId_(0U)
27 1 : {}
28 :
29 1 : void SharderNonBlock::Register(
30 : const uint32_t cpuCoreNum, const RandomKernelScheduler& randomKernelScheduler,
31 : const SplitKernelScheduler& splitKernelScheduler, const SplitKernelGetProcesser& splitKernelGetProcesser)
32 : {
33 : (void)cpuCoreNum;
34 : (void)randomKernelScheduler;
35 : (void)splitKernelScheduler;
36 : (void)splitKernelGetProcesser;
37 1 : }
38 :
39 2 : SharderNonBlock& SharderNonBlock::GetInstance()
40 : {
41 2 : static SharderNonBlock sharderNonBlock;
42 2 : return sharderNonBlock;
43 : }
44 : } // namespace aicpu
|