* Copyright (c) 2025 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.
*/
#ifndef AIR_CXX_RUNTIME_V2_RTS_STUB_H_
#define AIR_CXX_RUNTIME_V2_RTS_STUB_H_
#include <stdlib.h>
typedef enum {
RT_ENGINE_TYPE_AIC = 0,
RT_ENGINE_TYPE_AIV
} rtEngineType;
* @ingroup rts_kernel
* @brief kernel launch option config type
*/
typedef enum {
RT_LAUNCH_KERNEL_ATTR_SCHEM_MODE = 1,
RT_LAUNCH_KERNEL_ATTR_DYN_UBUF_SIZE,
RT_LAUNCH_KERNEL_ATTR_ENGINE_TYPE,
RT_LAUNCH_KERNEL_ATTR_BLOCKDIM_OFFSET,
RT_LAUNCH_KERNEL_ATTR_BLOCK_TASK_PREFETCH,
RT_LAUNCH_KERNEL_ATTR_DATA_DUMP,
RT_LAUNCH_KERNEL_ATTR_TIMEOUT,
RT_LAUNCH_KERNEL_ATTR_MAX
} rtLaunchKernelAttrId;
typedef union {
uint8_t schemMode;
uint32_t dynUBufSize;
rtEngineType engineType;
uint32_t blockDimOffset;
uint8_t isBlockTaskPrefetch;
uint8_t isDataDump;
uint16_t timeout;
uint32_t rsv[4];
} rtLaunchKernelAttrVal_t;
* @ingroup rts_kernel
* @brief kernel launch option config struct
*/
typedef struct {
rtLaunchKernelAttrId id;
rtLaunchKernelAttrVal_t value;
} rtLaunchKernelAttr_t;
typedef struct {
rtLaunchKernelAttr_t *attrs;
size_t numAttrs;
} rtKernelLaunchCfg_t;
typedef enum {
RT_LOAD_BINARY_OPT_LAZY_LOAD = 1,
RT_LOAD_BINARY_OPT_MAGIC = 2,
RT_LOAD_BINARY_OPT_CPU_KERNEL_MODE = 3,
RT_LOAD_BINARY_OPT_MAX
} rtLoadBinaryOption;
typedef union {
uint32_t isLazyLoad;
uint32_t magic;
int32_t cpuKernelMode;
uint32_t rsv[4];
} rtLoadBinaryOptionValue_t;
typedef struct {
rtLoadBinaryOption optionId;
rtLoadBinaryOptionValue_t value;
} rtLoadBinaryOption_t;
typedef struct {
rtLoadBinaryOption_t *options;
size_t numOpt;
} rtLoadBinaryConfig_t;
typedef struct {
uint32_t addrOffset;
uint32_t dataOffset;
} rtPlaceHolderInfo_t;
#endif