AddPlatformInfo
Function
Sets the hardware platform information for debugging the operator tiling function. The following two setting methods are supported:
- Automatically obtaining the current hardware platform information: Pass a null pointer to automatically obtain the current hardware information and add it to the ContextBuilder class.
- Specifying the hardware platform information: Pass a specific Ascend AI Processor model and add the corresponding hardware information to the ContextBuilder class.
If the setting fails, an error message is printed. For details about how to configure and view logs, see Logs.
Prototype
1
|
ContextBuilder &AddPlatformInfo(const char* customSocVersion) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
customSocVersion |
Input |
Ascend AI Processor model. The configuration method is as follows:
|
Returns
Object of the current ContextBuilder.
Restrictions
After AddPlatformInfo is called, the tiling context needs to be constructed using BuildTilingContext and passed to the tiling function.
Example
1 2 3 4 5 6 7 8 9 |
void AddPlatformInfoDemo(......) { auto holder = context_ascendc::ContextBuilder() // ... ... // Add the calling of the operator input and output APIs. .AddPlatformInfo("Ascendxxxyy") .BuildTilingContext(); auto tilingContext = holder->GetContext<gert::TilingContext>(); // ... ... } |