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_check_vec_util.h
13 : * \brief
14 : */
15 : #ifndef ASCENDC_CHECK_VEC_UTIL_H
16 : #define ASCENDC_CHECK_VEC_UTIL_H
17 : #if ASCENDC_CPU_DEBUG
18 : #include <string>
19 : #include "kernel_utils.h"
20 :
21 : namespace AscendC {
22 : enum class TransposeType : uint8_t {
23 : // default value
24 : TRANSPOSE_TYPE_NONE,
25 : // { shape:[B, A1, A3 / 16, A2 / 16, 16, 16], format:"NZ"} -->{ shape:[B, A2, A1, A3], ori_shape:[B, A2, A1, A3],
26 : // format:"ND"}
27 : TRANSPOSE_NZ2ND_0213,
28 : // { shape:[B, A1, A3 / 16, A2 / 16, 16, 16], format:"NZ"}-->{ shape:[B, A2, A3 / 16, A1 / 16, 16, 16],
29 : // origin_shape:[B, A2, A1, A3], format:"NZ"}
30 : TRANSPOSE_NZ2NZ_0213,
31 : // { shape:[B, H / 16, S / 16, 16, 16], format:"NZ"}-->{ shape:[B, N, H/N/16, S / 16, 16, 16], ori_shape:[B, N, S,
32 : // H/N], format:"NZ"}
33 : TRANSPOSE_NZ2NZ_012_WITH_N,
34 : // { shape:[B, H / 16, S / 16, 16, 16], format:"NZ"}-->{ shape:[B, N, S, H/N], ori_shape:[B, N, S, H/N],
35 : // format:"ND"}
36 : TRANSPOSE_NZ2ND_012_WITH_N,
37 : // { shape:[B, N, H/N/16, S/16, 16, 16], format:"NZ"}-->{ shape:[B, S, H], ori_shape:[B, S, H], format:"ND"}
38 : TRANSPOSE_NZ2ND_012_WITHOUT_N,
39 : // { shape:[B, N, H/N/16, S/16, 16, 16], format:"NZ"}-->{ shape:[B, H/16, S/16, 16, 16], ori_shape:[B, S, H],
40 : // format:"NZ"}
41 : TRANSPOSE_NZ2NZ_012_WITHOUT_N,
42 : TRANSPOSE_ND2ND_ONLY, // { shape:[H, W], format:"ND"} -->{ shape:[W, H], format:"ND"}
43 : TRANSPOSE_ND_UB_GM, // [B, N, S, H/N] -> [B, S, H]
44 : TRANSPOSE_GRAD_ND_UB_GM, // [B, S, H] -> [B, N, S, H/N]
45 : TRANSPOSE_ND2ND_B16, // { shape:[16, 16], format:"ND", dataType: B16} -->{ shape:[16, 16], format:"ND"}
46 : TRANSPOSE_NCHW2NHWC, // [ N, C, H, W] -> [N, H, W, C]
47 : TRANSPOSE_NHWC2NCHW, // [ N, H, W, C] -> [N, C, H, W]
48 : #if defined(__NPU_ARCH__) && ((__NPU_ARCH__ == 3510) || (__NPU_ARCH__ == 5102))
49 : TRANSPOSE_ND2ND_021, // [H, W]->[W, H], [N, H, W]->[N, W, H]
50 : TRANSPOSE_ND2ND_102, // [N, H, W]->[H, N, W]
51 : TRANSPOSE_ND2ND_210, // [N, H, W]->[W, H, N]
52 : TRANSPOSE_ND2NZ_WITH_INTLV // [N, D] -> [N, Z]
53 : #endif
54 : };
55 : } // namespace AscendC
56 :
57 : namespace AscendC {
58 : namespace check {
59 : struct VecScatterApiParams {
60 : VecScatterApiParams() {}
61 : VecScatterApiParams(
62 : uint64_t dstAddrIn, uint64_t srcAddrIn, uint64_t dstOffsetAddrIn, uint32_t dstDtypeBytesIn,
63 : uint32_t srcDtypeBytesIn, uint32_t dstOffsetDtypeBytesIn, uint32_t dstBaseAddrIn, uint32_t countIn,
64 : uint64_t dstSizeIn, uint64_t srcSizeIn, uint64_t dstOffsetSizeIn, uint8_t dstPosIn, uint8_t srcPosIn,
65 : uint8_t dstOffsetPosIn)
66 : {
67 : dstAddr = dstAddrIn;
68 : srcAddr = srcAddrIn;
69 : dstOffsetAddr = dstOffsetAddrIn;
70 : dstDtypeBytes = dstDtypeBytesIn;
71 : srcDtypeBytes = srcDtypeBytesIn;
72 : dstOffsetDtypeBytes = dstOffsetDtypeBytesIn;
73 : dstBaseAddr = dstBaseAddrIn;
74 : count = countIn;
75 : dstSize = dstSizeIn;
76 : srcSize = srcSizeIn;
77 : dstOffsetSize = dstOffsetSizeIn;
78 : dstLogicPos = dstPosIn;
79 : srcLogicPos = srcPosIn;
80 : dstOffsetLogicPos = dstOffsetPosIn;
81 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
82 : srcPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(srcPosIn)));
83 : dstOffsetPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstOffsetPosIn)));
84 : }
85 : VecScatterApiParams(
86 : uint64_t dstAddrIn, uint64_t srcAddrIn, uint64_t dstOffsetAddrIn, uint32_t dstDtypeBytesIn,
87 : uint32_t srcDtypeBytesIn, uint32_t dstOffsetDtypeBytesIn, uint32_t dstBaseAddrIn, uint8_t repeatTimesIn,
88 : uint16_t srcRepStrideIn, uint64_t dstSizeIn, uint64_t srcSizeIn, uint64_t dstOffsetSizeIn, uint8_t dstPosIn,
89 : uint8_t srcPosIn, uint8_t dstOffsetPosIn)
90 : {
91 : dstAddr = dstAddrIn;
92 : srcAddr = srcAddrIn;
93 : dstOffsetAddr = dstOffsetAddrIn;
94 : dstDtypeBytes = dstDtypeBytesIn;
95 : srcDtypeBytes = srcDtypeBytesIn;
96 : dstOffsetDtypeBytes = dstOffsetDtypeBytesIn;
97 : dstBaseAddr = dstBaseAddrIn;
98 : repeatTimes = repeatTimesIn;
99 : srcRepStride = srcRepStrideIn;
100 : dstSize = dstSizeIn;
101 : srcSize = srcSizeIn;
102 : dstOffsetSize = dstOffsetSizeIn;
103 : dstLogicPos = dstPosIn;
104 : srcLogicPos = srcPosIn;
105 : dstOffsetLogicPos = dstOffsetPosIn;
106 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
107 : srcPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(srcPosIn)));
108 : dstOffsetPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstOffsetPosIn)));
109 : }
110 : uint64_t dstAddr = 0;
111 : uint64_t srcAddr = 0;
112 : uint64_t dstOffsetAddr = 0;
113 : uint8_t repeatTimes = 0;
114 : uint32_t dstDtypeBytes = 0;
115 : uint32_t srcDtypeBytes = 0;
116 : uint32_t dstOffsetDtypeBytes = 0;
117 : uint32_t dstBaseAddr = 0;
118 : uint64_t dstSize = 0;
119 : uint64_t srcSize = 0;
120 : uint64_t dstOffsetSize = 0;
121 : uint16_t srcRepStride = 0;
122 : uint8_t dstLogicPos = 0;
123 : uint8_t srcLogicPos = 0;
124 : uint8_t dstOffsetLogicPos = 0;
125 : uint8_t dstPos = 0;
126 : uint8_t srcPos = 0;
127 : uint8_t dstOffsetPos = 0;
128 : uint32_t count = 0;
129 : };
130 : struct VecCmpRgtApiParams {
131 : VecCmpRgtApiParams() {}
132 : VecCmpRgtApiParams(
133 : uint64_t src0AddrIn, uint64_t src1AddrIn, uint16_t src0BlockStrideIn, uint16_t src1BlockStrideIn,
134 : uint16_t src0RepeatStrideIn, uint16_t src1RepeatStrideIn, uint32_t src0DtypeBytesIn, uint32_t src1DtypeBytesIn,
135 : uint64_t src0SizeIn, uint64_t src1SizeIn, uint8_t src0PosIn, uint8_t src1PosIn)
136 : {
137 : src0Addr = src0AddrIn;
138 : src1Addr = src1AddrIn;
139 : src0BlockStride = src0BlockStrideIn;
140 : src1BlockStride = src1BlockStrideIn;
141 : src0RepeatStride = src0RepeatStrideIn;
142 : src1RepeatStride = src1RepeatStrideIn;
143 : src0DtypeBytes = src0DtypeBytesIn;
144 : src1DtypeBytes = src1DtypeBytesIn;
145 : src0Size = src0SizeIn;
146 : src1Size = src1SizeIn;
147 : src0LogicPos = src0PosIn;
148 : src1LogicPos = src1PosIn;
149 : src0Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src0PosIn)));
150 : src1Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src1PosIn)));
151 : }
152 : uint64_t src0Addr = 0;
153 : uint64_t src1Addr = 0;
154 : uint8_t repeatTimes = 1;
155 : uint16_t src0BlockStride = 0;
156 : uint16_t src1BlockStride = 0;
157 : uint16_t src0RepeatStride = 0;
158 : uint16_t src1RepeatStride = 0;
159 : uint32_t src0DtypeBytes = 0;
160 : uint32_t src1DtypeBytes = 0;
161 : uint64_t src0Size = 0;
162 : uint64_t src1Size = 0;
163 : uint8_t src0LogicPos = 0;
164 : uint8_t src1LogicPos = 0;
165 : uint8_t src0Pos = 0;
166 : uint8_t src1Pos = 0;
167 : };
168 :
169 : struct VecBilinearInterpolationApiParams {
170 : VecBilinearInterpolationApiParams() {}
171 : VecBilinearInterpolationApiParams(
172 : uint64_t dstAddrIn, uint64_t src0AddrIn, uint64_t offsetAddrIn, uint64_t src1AddrIn, uint8_t hRepeatIn,
173 : bool repeatModeIn, uint16_t dstBlockStrideIn, uint16_t vROffsetIn, uint16_t vRepeatIn, uint32_t dstDtypeBytesIn,
174 : uint32_t src0DtypeBytesIn, uint32_t offsetDtypeBytesIn, uint32_t src1DtypeBytesIn, uint64_t dstSizeIn,
175 : uint64_t src0SizeIn, uint64_t offsetSizeIn, uint64_t src1SizeIn, uint8_t dstPosIn, uint8_t src0PosIn,
176 : uint8_t offsetPosIn, uint8_t src1PosIn)
177 : {
178 : dstAddr = dstAddrIn;
179 : src0Addr = src0AddrIn;
180 : offsetAddr = offsetAddrIn;
181 : src1Addr = src1AddrIn;
182 : hRepeat = hRepeatIn;
183 : repeatMode = repeatModeIn;
184 : dstBlockStride = dstBlockStrideIn;
185 : vROffset = vROffsetIn;
186 : vRepeat = vRepeatIn;
187 : dstDtypeBytes = dstDtypeBytesIn;
188 : src0DtypeBytes = src0DtypeBytesIn;
189 : offsetDtypeBytes = offsetDtypeBytesIn;
190 : src1DtypeBytes = src1DtypeBytesIn;
191 : dstSize = dstSizeIn;
192 : src0Size = src0SizeIn;
193 : offsetSize = offsetSizeIn;
194 : src1Size = src1SizeIn;
195 : dstLogicPos = dstPosIn;
196 : src0LogicPos = src0PosIn;
197 : offsetLogicPos = offsetPosIn;
198 : src1LogicPos = src1PosIn;
199 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
200 : ;
201 : src0Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src0PosIn)));
202 : ;
203 : offsetPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(offsetPosIn)));
204 : ;
205 : src1Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src1PosIn)));
206 : ;
207 : }
208 : uint64_t dstAddr = 0;
209 : uint64_t src0Addr = 0;
210 : uint64_t offsetAddr = 0;
211 : uint64_t src1Addr = 0;
212 : uint8_t hRepeat = 0;
213 : bool repeatMode = false;
214 : uint16_t dstBlockStride = 0;
215 : uint16_t vROffset = 0;
216 : uint16_t vRepeat = 0;
217 : uint32_t dstDtypeBytes = 0;
218 : uint32_t src0DtypeBytes = 0;
219 : uint32_t offsetDtypeBytes = 0;
220 : uint32_t src1DtypeBytes = 0;
221 : uint64_t dstSize = 0;
222 : uint64_t src0Size = 0;
223 : uint64_t offsetSize = 0;
224 : uint64_t src1Size = 0;
225 : uint8_t dstLogicPos = 0;
226 : uint8_t src0LogicPos = 0;
227 : uint8_t offsetLogicPos = 0;
228 : uint8_t src1LogicPos = 0;
229 : uint8_t dstPos = 0;
230 : uint8_t src0Pos = 0;
231 : uint8_t offsetPos = 0;
232 : uint8_t src1Pos = 0;
233 : };
234 :
235 : struct VecTransposeApiParams {
236 : VecTransposeApiParams() {}
237 20 : VecTransposeApiParams(
238 : uint64_t dstAddrIn, uint64_t srcAddrIn, uint8_t repeatIn, uint16_t dstRepeatStrideIn,
239 : uint16_t srcRepeatStrideIn, uint32_t dstDtypeBytesIn, uint32_t srcDtypeBytesIn, uint64_t dstSizeIn,
240 : uint64_t srcSizeIn, uint8_t dstPosIn, uint8_t srcPosIn, int8_t indexIn = -1)
241 20 : {
242 20 : dstAddr = dstAddrIn;
243 20 : srcAddr = srcAddrIn;
244 20 : repeatTimes = repeatIn;
245 20 : dstRepeatStride = dstRepeatStrideIn;
246 20 : srcRepeatStride = srcRepeatStrideIn;
247 20 : dstDtypeBytes = dstDtypeBytesIn;
248 20 : srcDtypeBytes = srcDtypeBytesIn;
249 20 : dstSize = dstSizeIn;
250 20 : srcSize = srcSizeIn;
251 20 : dstLogicPos = dstPosIn;
252 20 : srcLogicPos = srcPosIn;
253 20 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
254 20 : srcPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(srcPosIn)));
255 20 : index = indexIn;
256 20 : }
257 : VecTransposeApiParams(
258 : uint64_t dstAddrIn, uint64_t srcAddrIn, uint8_t repeatIn, uint16_t dstRepeatStrideIn,
259 : uint16_t srcRepeatStrideIn, uint32_t dstDtypeBytesIn, uint32_t srcDtypeBytesIn, uint64_t dstSizeIn,
260 : uint64_t srcSizeIn, uint64_t tmpBufferSizeIn, uint8_t dstPosIn, uint8_t srcPosIn, uint16_t nSizeIn,
261 : uint16_t cSizeIn, uint16_t hSizeIn, uint16_t wSizeIn, TransposeType transposeTypeIn)
262 : {
263 : dstAddr = dstAddrIn;
264 : srcAddr = srcAddrIn;
265 : repeatTimes = repeatIn;
266 : dstRepeatStride = dstRepeatStrideIn;
267 : srcRepeatStride = srcRepeatStrideIn;
268 : dstDtypeBytes = dstDtypeBytesIn;
269 : srcDtypeBytes = srcDtypeBytesIn;
270 : dstSize = dstSizeIn;
271 : srcSize = srcSizeIn;
272 : tmpBufferSize = tmpBufferSizeIn;
273 : dstLogicPos = dstPosIn;
274 : srcLogicPos = srcPosIn;
275 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
276 : srcPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(srcPosIn)));
277 : nSize = nSizeIn;
278 : cSize = cSizeIn;
279 : hSize = hSizeIn;
280 : wSize = wSizeIn;
281 : transposeType = transposeTypeIn;
282 : }
283 : uint64_t dstAddr = 0;
284 : uint64_t srcAddr = 0;
285 : uint8_t repeatTimes = 0;
286 : uint16_t dstBlockStride = 1;
287 : uint16_t dstRepeatStride = 0;
288 : uint16_t srcBlockStride = 1;
289 : uint16_t srcRepeatStride = 0;
290 : uint32_t dstDtypeBytes = 0;
291 : uint64_t dstSize = 0;
292 : uint32_t srcDtypeBytes = 0;
293 : uint64_t srcSize = 0;
294 : uint64_t tmpBufferSize = 0;
295 : uint16_t nSize = 0;
296 : uint16_t cSize = 0;
297 : uint16_t hSize = 0;
298 : uint16_t wSize = 0;
299 : uint8_t dstLogicPos = 0;
300 : uint8_t srcLogicPos = 0;
301 : uint8_t dstPos = 0;
302 : uint8_t srcPos = 0;
303 : int8_t index = 0; // transdata [16]
304 : TransposeType transposeType = TransposeType::TRANSPOSE_TYPE_NONE;
305 : };
306 :
307 : struct VecProposalApiParams {
308 : VecProposalApiParams() {}
309 : VecProposalApiParams(
310 : uint64_t dstAddrIn, uint64_t src0AddrIn, uint8_t repeatIn, uint32_t dstDtypeBytesIn, uint32_t src0DtypeBytesIn,
311 : uint64_t dstSizeIn, uint64_t src0SizeIn, uint8_t dstPosIn, uint8_t src0PosIn)
312 : {
313 : dstAddr = dstAddrIn;
314 : src0Addr = src0AddrIn;
315 : repeatTimes = repeatIn;
316 : dstDtypeBytes = dstDtypeBytesIn;
317 : src0DtypeBytes = src0DtypeBytesIn;
318 : dstSize = dstSizeIn;
319 : src0Size = src0SizeIn;
320 : dstLogicPos = dstPosIn;
321 : src0LogicPos = src0PosIn;
322 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
323 : src0Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src0PosIn)));
324 : }
325 60 : VecProposalApiParams(
326 : uint64_t dstAddrIn, uint64_t src0AddrIn, uint64_t src1AddrIn, uint8_t repeatIn, uint32_t dstDtypeBytesIn,
327 : uint32_t src0DtypeBytesIn, uint32_t src1DtypeBytesIn, uint64_t dstSizeIn, uint64_t src0SizeIn,
328 : uint64_t src1SizeIn, uint8_t dstPosIn, uint8_t src0PosIn, uint8_t src1PosIn)
329 60 : {
330 60 : dstAddr = dstAddrIn;
331 60 : src0Addr = src0AddrIn;
332 60 : src1Addr = src1AddrIn;
333 60 : repeatTimes = repeatIn;
334 60 : dstDtypeBytes = dstDtypeBytesIn;
335 60 : src0DtypeBytes = src0DtypeBytesIn;
336 60 : src1DtypeBytes = src1DtypeBytesIn;
337 60 : dstSize = dstSizeIn;
338 60 : src0Size = src0SizeIn;
339 60 : src1Size = src1SizeIn;
340 60 : dstLogicPos = dstPosIn;
341 60 : src0LogicPos = src0PosIn;
342 60 : src1LogicPos = src1PosIn;
343 60 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
344 60 : src0Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src0PosIn)));
345 60 : src1Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src1PosIn)));
346 60 : }
347 20 : VecProposalApiParams(
348 : uint64_t dstAddrIn, uint64_t src0AddrIn, uint8_t repeatIn, uint32_t dstDtypeBytesIn, uint32_t src0DtypeBytesIn,
349 : uint64_t dstSizeIn, uint64_t src0SizeIn, uint8_t dstPosIn, uint8_t src0PosIn, uint16_t validBitIn,
350 : const uint16_t elementLenIn[4], uint8_t srcIndexIn, bool isExhaustedIn = false, bool isContinousIn = false)
351 20 : {
352 20 : dstAddr = dstAddrIn;
353 20 : src0Addr = src0AddrIn;
354 20 : repeatTimes = repeatIn;
355 20 : dstDtypeBytes = dstDtypeBytesIn;
356 20 : src0DtypeBytes = src0DtypeBytesIn;
357 20 : dstSize = dstSizeIn;
358 20 : src0Size = src0SizeIn;
359 20 : dstLogicPos = dstPosIn;
360 20 : src0LogicPos = src0PosIn;
361 20 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
362 20 : src0Pos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(src0PosIn)));
363 20 : validBit = validBitIn;
364 100 : for (size_t i = 0; i < eleSize; i++) {
365 80 : elementLengths[i] = elementLenIn[i];
366 : }
367 20 : srcIndex = srcIndexIn;
368 20 : isExhausted = isExhaustedIn;
369 20 : isContinuous = isContinousIn;
370 20 : }
371 : const uint32_t eleSize = 4;
372 : uint64_t dstAddr = 0;
373 : uint64_t src0Addr = 0;
374 : uint64_t src1Addr = 0;
375 : uint8_t repeatTimes = 0;
376 : uint32_t dstDtypeBytes = 0;
377 : uint32_t src0DtypeBytes = 0;
378 : uint32_t src1DtypeBytes = 0;
379 : uint64_t dstSize = 0;
380 : uint64_t src0Size = 0;
381 : uint64_t src1Size = 0;
382 : uint8_t dstLogicPos = 0;
383 : uint8_t src0LogicPos = 0;
384 : uint8_t src1LogicPos = 0;
385 : uint8_t dstPos = 0;
386 : uint8_t src0Pos = 0;
387 : uint8_t src1Pos = 0;
388 : uint16_t validBit = 0;
389 : uint16_t elementLengths[4];
390 : uint8_t srcIndex = 0;
391 : bool isExhausted = false;
392 : bool isContinuous = false;
393 : };
394 : struct SortApiParams {
395 : SortApiParams() {}
396 : SortApiParams(
397 : uint64_t dstAddrIn, uint64_t concatAddrIn, uint64_t indexAddrIn, uint64_t tmpAddrIn, uint8_t repeatIn,
398 : uint32_t dstDtypeBytesIn, uint32_t concatDtypeBytesIn, uint32_t indexDtypeBytesIn, uint32_t tmpDtypeBytesIn,
399 : uint64_t dstSizeIn, uint64_t concatSizeIn, uint64_t indexSizeIn, uint64_t tmpSizeIn, uint8_t dstPosIn,
400 : uint8_t concatPosIn, uint8_t indexPosIn, uint8_t tmpPosIn, bool isFullSortIn)
401 : {
402 : dstAddr = dstAddrIn;
403 : concatAddr = concatAddrIn;
404 : indexAddr = indexAddrIn;
405 : tmpAddr = tmpAddrIn;
406 : repeatTimes = repeatIn;
407 : dstDtypeBytes = dstDtypeBytesIn;
408 : concatDtypeBytes = concatDtypeBytesIn;
409 : indexDtypeBytes = indexDtypeBytesIn;
410 : tmpDtypeBytes = tmpDtypeBytesIn;
411 : dstSize = dstSizeIn;
412 : concatSize = concatSizeIn;
413 : indexSize = indexSizeIn;
414 : tmpSize = tmpSizeIn;
415 : dstLogicPos = dstPosIn;
416 : concatLogicPos = concatPosIn;
417 : indexLogicPos = indexPosIn;
418 : tmpLogicPos = tmpPosIn;
419 : dstPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(dstPosIn)));
420 : concatPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(concatPosIn)));
421 : indexPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(indexPosIn)));
422 : tmpPos = static_cast<uint8_t>(GetPhyType(static_cast<TPosition>(tmpPosIn)));
423 : isFullSort = isFullSortIn;
424 : }
425 : uint64_t dstAddr = 0;
426 : uint64_t concatAddr = 0;
427 : uint64_t indexAddr = 0;
428 : uint64_t tmpAddr = 0;
429 : uint8_t repeatTimes = 0;
430 : uint32_t dstDtypeBytes = 0;
431 : uint32_t concatDtypeBytes = 0;
432 : uint32_t indexDtypeBytes = 0;
433 : uint32_t tmpDtypeBytes = 0;
434 : uint64_t dstSize = 0;
435 : uint64_t concatSize = 0;
436 : uint64_t indexSize = 0;
437 : uint64_t tmpSize = 0;
438 : uint8_t dstLogicPos = 0;
439 : uint8_t concatLogicPos = 0;
440 : uint8_t indexLogicPos = 0;
441 : uint8_t tmpLogicPos = 0;
442 : uint8_t dstPos = 0;
443 : uint8_t concatPos = 0;
444 : uint8_t indexPos = 0;
445 : uint8_t tmpPos = 0;
446 : bool isFullSort = false;
447 : };
448 : bool CheckFuncVecCmpRgtImplForMaskArray(VecCmpRgtApiParams& chkParams, const uint64_t mask[], const char* intriName);
449 : bool CheckFuncVecCmpRgtImpl(VecCmpRgtApiParams& chkParams, const uint64_t mask, const char* intriName);
450 : bool CheckFuncBilinearInterpolationImpl(
451 : VecBilinearInterpolationApiParams& chkParams, const uint64_t mask, const char* intriName);
452 : bool CheckFuncBilinearInterpolationImpl(
453 : VecBilinearInterpolationApiParams& chkParams, const uint64_t mask[], const char* intriName);
454 : bool CheckFunTransposeImpl(VecTransposeApiParams& chkParams, const char* intriName);
455 : bool CheckFunProposalImpl(VecProposalApiParams& chkParams, const char* intriName);
456 : bool CheckFunScatterImpl(VecScatterApiParams& chkParams, const char* intriName);
457 : bool CheckFunScatterImpl(VecScatterApiParams& chkParams, const uint64_t mask, const char* intriName);
458 : bool CheckFunScatterImplForMaskArray(VecScatterApiParams& chkParams, const uint64_t mask[], const char* intriName);
459 : bool CheckSortImpl(SortApiParams& chkParams, const char* intriName);
460 : uint64_t GetHardWarebufferSize(uint8_t index);
461 : } // namespace check
462 : } // namespace AscendC
463 : #endif
464 : #endif
|