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 : /*!
12 : * \file kernel_data_copy_slice_check.h
13 : * \brief
14 : */
15 :
16 : #ifndef ASCENDC_DATA_COPY_SLICE_CHECK_H
17 : #define ASCENDC_DATA_COPY_SLICE_CHECK_H
18 : #include "kernel_base_check.h"
19 :
20 : namespace AscendC {
21 : namespace check {
22 : class TikcppDataCopySliceCheck : public TikcppBaseCheck {
23 : public:
24 104 : TikcppDataCopySliceCheck(const std::string& name, DataCopySliceApiParams& param)
25 104 : : TikcppBaseCheck(name), param_(param)
26 104 : {}
27 104 : ~TikcppDataCopySliceCheck() override = default;
28 : bool CheckSliceInfoParamters(const std::string& errMsg);
29 : bool CheckDataCopyIntrsParamters(const std::string& errMsg);
30 : uint32_t DataCopyGetTotalInstrsNum(const SliceInfo sliceInfo[], const uint32_t shapeIn[]);
31 : bool CheckDataCopyInstrsNum(const std::string& errMsg);
32 :
33 : bool CheckAllHighLevel();
34 : bool CheckAddrAlign();
35 :
36 : public:
37 : static constexpr uint32_t dataCopySliceAlignSize = 32;
38 : uint32_t alignBytes_{dataCopySliceAlignSize};
39 : DataCopySliceApiParams& param_;
40 : };
41 : } // namespace check
42 : } // namespace AscendC
43 : #endif
|