SetInputType

Function

Sets the position, data format, and data type of Input in the memory.

Prototype

1
void SetInputType(const ConvCommonApi::TPosition pos, const ConvCommonApi::ConvFormat format, const ConvCommonApi::ConvDtype dtype)

Parameters

Parameter

Input/Output

Description

pos

Input

Position of Input in the memory. Currently, only TPosition::GM is supported.

format

Input

Input data format. Currently, only ConvFormat::NDC1HWC0 is supported.

dtype

Input

Input data type. Currently, only ConvDtype::FLOAT16 and ConvDtype::BF16 are supported.

Returns

None

Restrictions

This API is optional before calling the GetTiling API. If this API is not called, the default Input is pos=TPosition::GM, format=ConvFormat::NDC1HWC0 and dtype=ConvDtype::FLOAT16.

Example

1
2
3
4
// Instantiate the Conv3D API.
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
Conv3dTilingApi::Conv3dTiling conv3dApiTiling(ascendcPlatform);
conv3dApiTiling.SetInputType(ConvCommonApi::TPosition::GM, ConvCommonApi::ConvFormat::NDC1HWC0, ConvCommonApi::ConvDtype::BF16);