GetTaskRatio

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Obtains the ratio of the number of Cube Cores (AICs) or Vector Cores (AIVs) on an AI Core to the number of AI Cores in separated mode. In coupled mode, the return is always 1.

Prototype

1
__aicore__ inline int64_t GetTaskRatio()

Parameters

None

Returns

  • In separated mode, the return values of this API called on the AIC and AIV vary depending on the kernel type (set by using the Setting Kernel Type API).
    Table 1 Return values

    Kernel Type

    KERNEL_TYPE_AIV_ONLY

    KERNEL_TYPE_AIC_ONLY

    KERNEL_TYPE_MIX_AIC_1_2

    KERNEL_TYPE_MIX_AIC_1_1

    KERNEL_TYPE_MIX_AIC_1_0

    KERNEL_TYPE_MIX_AIV_1_0

    AIV

    1

    -

    2

    1

    -

    1

    AIC

    -

    1

    1

    1

    1

    -

  • In coupled mode, the return is always 1.

Restrictions

None

Example

1
2
uint64_t ratio = AscendC::GetTaskRatio(); // Return the ratio of AICs or AIVs to the number of AI Cores.
AscendC::PRINTF("task ratio is %u", ratio);