(el_type, src: Tile, *, loc=None, ip=None)
| 2301 | |
| 2302 | @cuda_tile_op |
| 2303 | def bitcast(el_type, src: Tile, *, loc=None, ip=None) -> Tile: |
| 2304 | el_type = _get_mlir_type(el_type) |
| 2305 | |
| 2306 | # Check that neither source nor destination types are pointer types |
| 2307 | if PointerType.isinstance(src.element_type): |
| 2308 | raise TypeError("bitcast source cannot be a pointer type") |
| 2309 | if PointerType.isinstance(el_type): |
| 2310 | raise TypeError("bitcast destination cannot be a pointer type") |
| 2311 | |
| 2312 | result_type = TileType.get(src.shape, el_type) |
| 2313 | from_width = src.element_type.width |
| 2314 | to_width = el_type.width |
| 2315 | if from_width != to_width: |
| 2316 | raise TypeError( |
| 2317 | f"mismatching bitwidth between {src.element_type} ({from_width}) " |
| 2318 | f"and {result_type.element_type} ({to_width})" |
| 2319 | ) |
| 2320 | return return_results( |
| 2321 | _cuda_tile.BitcastOp(result=result_type, source=src, loc=loc, ip=ip) |
| 2322 | ) |
| 2323 | |
| 2324 | |
| 2325 | def _get_element_bit_width(elem_type) -> int: |
nothing calls this directly
no test coverage detected