tilelang.utils.target¶
Attributes¶
Functions¶
Check if CUDA is available on the system by locating the CUDA path. |
|
Check if HIP (ROCm) is available on the system by locating the ROCm path. |
|
|
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.