LCOV - code coverage report
Current view: top level - aicpu_schedule/core/operator_kernel/enqueue - operator_kernel_model_enqueue.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 12 12
Test Date: 2026-08-12 11:05:02 Functions: 100.0 % 2 2

            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 "operator_kernel_model_enqueue.h"
      12              : 
      13              : #include "aicpusd_status.h"
      14              : #include "aicpusd_profiler.h"
      15              : 
      16              : namespace AicpuSchedule {
      17              : namespace {
      18              : const std::string KERNEL_MODEL_ENQUEUE = "modelEnqueue";
      19              : } // namespace
      20              : 
      21            7 : int32_t OperatorKernelModelEnqueue::Compute(const AicpuTaskInfo& kernelTaskInfo, const RunContext& taskContext)
      22              : {
      23            7 :     auto bufInfo = PtrToPtr<void, BufEnQueueInfo>(ValueToPtr(kernelTaskInfo.paraBase));
      24            7 :     if (bufInfo == nullptr) {
      25            1 :         aicpusd_err(
      26              :             "ModelEnqueue kernelTaskInfo paramBase is null, modelId[%u], streamId[%u], taskId[%u]", taskContext.modelId,
      27              :             taskContext.streamId, kernelTaskInfo.taskID);
      28            1 :         return AICPU_SCHEDULE_ERROR_PARAMETER_NOT_VALID;
      29              :     }
      30            6 :     g_aicpuProfiler.SetEndGraph();
      31            6 :     g_aicpuProfiler.SetEqStart();
      32            6 :     const int32_t ret = EnqueueTask(*bufInfo, taskContext);
      33            6 :     g_aicpuProfiler.SetEqEnd();
      34            6 :     g_aicpuProfiler.SetModelEnd();
      35            6 :     return static_cast<uint32_t>(ret);
      36              : }
      37              : 
      38            6 : REGISTER_OPERATOR_KERNEL(KERNEL_MODEL_ENQUEUE, OperatorKernelModelEnqueue);
      39              : } // namespace AicpuSchedule
        

Generated by: LCOV version 2.0-1