GetCoreMemBw

Function Usage

Obtains the bandwidth size of the memory on the hardware platform. Types of the hardware storage space are defined as follows:

enum class CoreMemType {
    L0_A = 0, // Reserved.
    L0_B = 1, // Reserved.
    L0_C = 2, // Reserved.
    L1 = 3,   // Reserved.
    L2 = 4,
    UB = 5,   // Reserved.
    HBM = 6,
    RESERVED
};

Prototype

void GetCoreMemBw(const CoreMemType &memType, uint64_t &bwSize) const;

Parameters

Parameter

Input/Output

Description

memType

Input

Hardware memory type.

bwSize

Output

Bandwidth size of the storage space of hardware. The unit is byte/cycle, and cycle indicates the clock cycle.

Returns

None

Constraints

None

Example

ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    uint64_t l2_bw;
    ascendcPlatform.GetCoreMemBw(platform_ascendc::CoreMemType::L2, l2_bw);
    // ...
    return ret;
}