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 : #ifndef OPERATOR_KERNEL_DEQUEUE_BASE_H
11 : #define OPERATOR_KERNEL_DEQUEUE_BASE_H
12 :
13 : #include "operator_kernel_context.h"
14 :
15 :
16 : namespace AicpuSchedule {
17 : class OperatorKernelDequeueBase {
18 : public:
19 123 : OperatorKernelDequeueBase() = default;
20 123 : virtual ~OperatorKernelDequeueBase() {};
21 :
22 : int32_t DequeueTask(BufEnQueueInfo &bufInfo, const RunContext &taskContext, const bool needPending) const;
23 : static int32_t AlignTimestamp(BatchDequeueInfo &batchDeqInfo, const RunContext &taskContext,
24 : uint32_t &maxAlignTimestamp, uint32_t &minAlignTimestamp,
25 : uint32_t &minTimestampIndex);
26 : void ProcessMbufHeadInDequeueTask(const uint32_t modelId, void * const headBuf, const uint32_t headSize) const;
27 : void SetModelEndOfSequence(const uint32_t modelId, void * const headBuf, const uint32_t headSize) const;
28 : private:
29 : void SetModelNullData(const uint32_t modelId, const MbufHeadMsg * const headMsg) const;
30 : void SetModelRetCode(const uint32_t modelId, const MbufHeadMsg * const headMsg) const;
31 : void SetMbufStepId(const uint32_t modelId, MbufHeadMsg * const headMsg) const;
32 : };
33 : } // namespace AicpuSchedule
34 : #endif // OPERATOR_KERNEL_DEQUEUE_BASE_H
|