SimtGridDim

Function Usage

Sets the dimension of a SIMT thread grid, that is, the number of thread blocks in the thread grid of the Vector unit involved in computation. The dimension is represented by the Dim3 structure. Dim3 is a structure that contains three UInt32 fields: x, y, and z. It represents the number of thread blocks in a thread grid in the x, y, and z dimensions. The operator tiling function can obtain the corresponding Dim3 pointer through the TilingContext constructed by this Builder class.

For example, block_dim.x, block_dim.y, and block_dim.z represent the number of thread blocks in the x, y, and z dimensions of a thread grid, respectively.

Prototype

OpTilingContextBuilder &SimtGridDim(const gert::Dim3 *grid_dim)

Parameters

Parameter

Input/Output

Description

grid_dim

Input

Sets the input grid dim pointer.

Returns

A reference to the OpTilingContextBuilder object. It is used for chaining method calls.

Constraints

  • InputTensors must be set before the Build method call. Otherwise, the constructed TilingContext will contain undefined data.
  • The caller has the memory ownership of the gert::Dim3* parameter passed through a pointer. They must ensure that the pointer is valid throughout the lifecycle of the ContextHolder object.