目录

GetCoreMemBw

Function Description

Obtains the bandwidth of the storage space on the hardware platform. Only L2 and HBM are supported. Types of the hardware storage space are defined as follows:

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

Function Prototype

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

Parameters

Parameter Input/Output Description
memType Input Hardware memory type. Only L2 and HBM are supported.
bwSize Output Bandwidth size of the storage space of hardware. The unit is byte/cycle, and cycle indicates the clock cycle.

Return Value

None

Restrictions

The memType input can only be L2 or HBM.

Calling 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;
}