Skip to main content
Log in

Mojo function

bitwidthof

bitwidthof[type: AnyTrivialRegType, target: target = current_target()]() -> IntLiteral

Returns the size of (in bits) of the type.

Parameters:

  • type (AnyTrivialRegType): The type in question.
  • target (target): The target architecture.

Returns:

The size of the type in bits.

bitwidthof[type: DType, target: target = current_target()]() -> IntLiteral

Returns the size of (in bits) of the dtype.

Parameters:

  • type (DType): The type in question.
  • target (target): The target architecture.

Returns:

The size of the dtype in bits.