MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / select

Function select

python/cuda_tile/dialects/cuda_tile_ops.py:3559–3574  ·  view source on GitHub ↗
(condition, trueval, falseval, *, loc=None, ip=None)

Source from the content-addressed store, hash-verified

3557
3558@cuda_tile_op
3559def select(condition, trueval, falseval, *, loc=None, ip=None) -> Tile:
3560 if trueval.element_type != falseval.element_type:
3561 raise TypeError("trueval and falseval must have the same element type")
3562 if (
3563 not isinstance(condition.element_type, _ods_ir.IntegerType)
3564 or condition.element_type.width != 1
3565 ):
3566 raise TypeError("condition must have boolean element type")
3567 if (
3568 trueval.tile_type.shape != falseval.tile_type.shape
3569 or condition.tile_type.shape != trueval.tile_type.shape
3570 ):
3571 raise TypeError("trueval, falseval and condition must have the same shape")
3572 return return_results(
3573 _cuda_tile.SelectOp(condition, trueval, falseval, loc=loc, ip=ip)
3574 )
3575
3576
3577@cuda_tile_op

Callers

nothing calls this directly

Calls 1

return_resultsFunction · 0.85

Tested by

no test coverage detected