tilelang.utils.target

Attributes

Functions

check_cuda_availability()

Check if CUDA is available on the system by locating the CUDA path.

check_hip_availability()

Check if HIP (ROCm) is available on the system by locating the ROCm path.

determine_target([target, return_object])

Determine the appropriate target for compilation (CUDA, HIP, or manual selection).

Module Contents

tilelang.utils.target.AVALIABLE_TARGETS
tilelang.utils.target.check_cuda_availability()

Check if CUDA is available on the system by locating the CUDA path. :returns: True if CUDA is available, False otherwise. :rtype: bool

Return type:

bool

tilelang.utils.target.check_hip_availability()

Check if HIP (ROCm) is available on the system by locating the ROCm path. :returns: True if HIP is available, False otherwise. :rtype: bool

Return type:

bool

tilelang.utils.target.determine_target(target='auto', return_object=False)

Determine the appropriate target for compilation (CUDA, HIP, or manual selection).

Parameters:
  • target (Union[str, Target, Literal["auto"]]) – User-specified target. - If “auto”, the system will automatically detect whether CUDA or HIP is available. - If a string or Target, it is directly validated.

  • return_object (bool)

Returns:

The selected target (“cuda”, “hip”, or a valid Target object).

Return type:

Union[str, Target]

Raises:
  • ValueError – If no CUDA or HIP is available and the target is “auto”.

  • AssertionError – If the target is invalid.