* Copyright (c) 2026 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
* \file stateless_randperm_struct.h
* \brief tiling base data
*/
#ifndef STATELESS_RANDPERM_STRUCT_H
#define STATELESS_RANDPERM_STRUCT_H
constexpr uint32_t SUB_N_TILE_COUNT = 8;
constexpr uint16_t PHILOX_KEY_SIZE = 2;
struct SortRegBaseTilingDataForRandperm {
uint32_t numTileDataSize;
uint32_t unsortedDimParallel;
uint32_t lastDimTileNum;
uint32_t sortLoopTimes;
uint32_t lastDimNeedCore;
uint32_t keyParams0;
uint32_t keyParams1;
uint32_t keyParams2;
uint32_t keyParams3;
uint32_t keyParams4;
uint32_t keyParams5;
uint32_t tmpUbSize;
int64_t lastAxisNum;
int64_t unsortedDimNum;
};
struct StatelessRandpermTilingData{
int32_t randomBits;
uint32_t islandFactor;
uint32_t islandFactorTail;
uint32_t castFactor;
uint32_t castFactorTail;
uint32_t realCoreNum;
uint64_t randomWkSizeByte;
uint32_t subNTileCount;
uint32_t subNTile[SUB_N_TILE_COUNT];
uint32_t philoxKey[PHILOX_KEY_SIZE];
uint32_t philoxOffset;
int64_t n;
struct SortRegBaseTilingDataForRandperm sortTilingData;
};
#endif