GetCoreMemSize

Function Usage

Obtains the memory size of the storage space on the hardware platform, for example, L1, L0_A, L0_B, and L2. The supported storage space types 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
};

Prototype

void GetCoreMemSize(const CoreMemType &memType, uint64_t &size) const;

Parameters

Parameter

Input/Output

Description

memType

Input

Hardware storage space type

size

Output

Size of the storage space of the corresponding type, in bytes

Returns

None

Constraints

None

Example

ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    uint64_t ub_size, l1_size;
    ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ub_size);
    ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::L1, l1_size);
    // ...
    return ret;
}