Skip to content

Commit 21cf47d

Browse files
committed
fix dtype promotion doc legend
Signed-off-by: Boyan Li <boyanl@nvidia.com>
1 parent 2911544 commit 21cf47d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/cuda/tile/_datatype.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,15 @@ def _get_mma_scaled_scaling_block_sizes(data_dtype, scale_dtype) -> Tuple[int, .
489489

490490
# =============== Documentation Generator ================
491491

492+
def _is_public(dtype_name: str) -> bool:
493+
import cuda.tile
494+
return hasattr(cuda.tile, dtype_name)
495+
496+
492497
def _generate_rst_dtype_promotion_table() -> str:
493498
"""Generate an RST table representation of the dtype promotion rules."""
494-
import cuda.tile
495499
# Skip dtypes not exposed in cuda.tile yet. Promomotion table is append only.
496-
n = sum(1 for dtype in _enum_to_dtype.values() if hasattr(cuda.tile, dtype.name))
500+
n = sum(1 for dtype in _enum_to_dtype.values() if _is_public(dtype.name))
497501
table = _DTypePromotionImpl._common_dtype_table
498502
return _generate_rst_table([row[:n] for row in table[:n]])
499503

@@ -577,7 +581,8 @@ def _generate_rst_table(common_dtype_table) -> str:
577581
for enum_val, dtype_obj in _enum_to_dtype.items():
578582
enum_name = enum_val.name.lower()
579583
dtype_name = dtype_obj.name
580-
lines.append(f"* {enum_name}: ``{dtype_name}``")
584+
if _is_public(dtype_name):
585+
lines.append(f"* {enum_name}: ``{dtype_name}``")
581586

582587
# Add an entry for the error case
583588
lines.append("* ERR: Implicit promotion between these types is not supported")

0 commit comments

Comments
 (0)