Predefined Macros and Built-in Variables
Predefined Macros
Like other language compilers, the BiSheng Compiler has some predefined macros for developers to write programs.
|
Predefined Macros |
Default Value |
Description |
|---|---|---|
|
__CCE_IS_AICORE__ |
1 |
The value is 1 on the device, which can be used to distinguish device code from host code. |
Built-in Variables
The following variables are built-in variables of the BiSheng Compiler. The variable names defined by developers in programs cannot be the same as the built-in variable names. Additionally, built-in variables are usually used by the framework and remain imperceptible to developers. To obtain the core ID or number of cores, use the corresponding Ascend C API.
Parent topic: Basic Programming Guide