GetCoreNum
Function Usage
Obtains the number of cores on the current hardware platform. If the AI Core architecture is a cube/vector separated architecture, the number of vector cores on AI Cores is returned. If the architecture is not a separated architecture, the number of AI Cores is returned.
Prototype
uint32_t GetCoreNum(void) const;
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
- |
- |
- |
Returns
For the
Constraints
None
Example
ge::graphStatus TilingXXX(gert::TilingContext* context) {
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
auto coreNum = ascendcPlatform.GetCoreNum();
// ... Design the tiling policy based on the number of cores.
context->SetBlockDim(coreNum);
return ret;
}
Parent topic: PlatformAscendC