hidet.ir.func

Classes:

Function(name, params, body, ret_type, kind)

Valid Attrs:

class hidet.ir.func.Function(name, params, body, ret_type, kind, attrs=None)[source]
Valid Attrs:
‘kind’: str,
the kind of this function.
  • ‘cuda_internal’: this is a cuda device function, can only be called by cuda function

  • ‘cuda_kernel’: this is a cuda kernel function

  • ‘cpu_kernel’: this is a cpu kernel function

  • ‘cpu_internal’: this is a cpu function but not a kernel

  • ‘public’: this is a packed function that wraps kernel function(s)

‘cuda.grid_dim’: Union[int, List[int]]

the grid dimension in cuda launch configuration

‘cuda.block_dim’: Union[int, List[int]]

the block dimension in cuda launch configuration

‘cuda.dynamic_smem_bytes’: int

the dynamic shared memory in cuda launch configuration

‘cuda.min_blocks’: int

the minimal number of thread blocks in launch bound of cuda kernel function

Methods:

get_attr(attr_name[, default, allow_missing])

Get attribute of this function.

Parameters:
  • name (str) –

  • kind (str) –

get_attr(attr_name, default=None, allow_missing=False)[source]

Get attribute of this function.

When default is not None or allow_missing is True, this function will return the default value (in case default is not None) or None (in case default is None) when the attribute is not found. Otherwise, this function will raise a KeyError.

Parameters:
  • attr_name (str) – The name of attribute

  • default (Any, optional) – The default value of attribute

  • allow_missing (bool, default False) –

Returns:

attr_value – The value of attribute

Return type:

Any