Conv3D Tiling Constructor

Function

Creates a Conv3D single-core tiling object.

Prototype

  • Parameterized constructor, which requires the hardware platform information to be passed. You are advised to use this type of constructor to achieve better compatibility.
    • Use PlatformAscendC to pass in information.
      1
      explicit Conv3dTiling(const platform_ascendc::PlatformAscendC& ascendcPlatform)
      
    • Use PlatformInfo to pass in information.
      If platform_ascendc::PlatformAscendC fails to be obtained during tiling running, you need to construct the PlatformInfo structure and transparently transmit it to the Conv3dTiling constructor.
      1
      explicit Conv3dTiling(const PlatformInfo& platform)
      
  • Base class constructor
    Conv3dTiling is inherited from the base class Conv3dTilingBase. Its constructor is as follows:
    1
    explicit Conv3dTilingBase(const platform_ascendc::PlatformAscendC& ascendcPlatform)
    
    1
    explicit Conv3dTilingBase(const PlatformInfo& platform)
    

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

ascendcPlatform

Input

Hardware platform information that is passed. For details about the definition of PlatformAscendC, see Constructor and Destructor.

platform

Input

Hardware version and memory size of each hardware unit in the AI Core. The value is obtained through Constructor and Destructor during PlatformInfo construction.

The PlatformInfo structure is defined as follows. socVersion is obtained and transparently transmitted through GetSocVersion. The storage space size of each hardware is obtained and transparently transmitted through GetCoreMemSize.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
struct PlatformInfo {
    platform_ascendc::SocVersion socVersion;
    uint64_t l1Size = 0;
    uint64_t l0CSize = 0;
    uint64_t ubSize = 0;
    uint64_t l0ASize = 0;
    uint64_t l0BSize = 0;
    uint64_t btSize = 0;
    uint64_t fbSize = 0;
};

Restrictions

None

Example

1
2
3
4
5
6
7
// Instantiate the Conv3d API.
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
Conv3dTilingApi::Conv3dTiling conv3dApiTiling(ascendcPlatform);
conv3dApiTiling.SetGroups(groups);
conv3dApiTiling.SetOrgWeightShape(cout, kd, kh, kw);
...
conv3dApiTiling.GetTiling(conv3dCustomTilingData.conv3dApiTilingData);