|
2 | 2 | # See https://llvm.org/LICENSE.txt for license information. |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
4 | 4 |
|
| 5 | +from ...ir import IntegerAttr, IntegerType, register_attribute_builder |
5 | 6 | from .._gpu_ops_gen import * |
6 | 7 | from .._gpu_enum_gen import * |
7 | 8 | from ..._mlir_libs._mlirDialectsGPU import * |
| 9 | + |
| 10 | + |
| 11 | +@register_attribute_builder("builtin.GPU_AddressSpaceEnum") |
| 12 | +def _gpu_addressspaceenum(x, context): |
| 13 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 14 | + |
| 15 | + |
| 16 | +@register_attribute_builder("builtin.GPU_AllReduceOperation") |
| 17 | +def _gpu_allreduceoperation(x, context): |
| 18 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 19 | + |
| 20 | + |
| 21 | +@register_attribute_builder("builtin.GPU_CompilationTargetEnum") |
| 22 | +def _gpu_compilationtargetenum(x, context): |
| 23 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 24 | + |
| 25 | + |
| 26 | +@register_attribute_builder("builtin.GPU_Dimension") |
| 27 | +def _gpu_dimension(x, context): |
| 28 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 29 | + |
| 30 | + |
| 31 | +@register_attribute_builder("builtin.GPU_Prune2To4SpMatFlag") |
| 32 | +def _gpu_prune2to4spmatflag(x, context): |
| 33 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 34 | + |
| 35 | + |
| 36 | +@register_attribute_builder("builtin.GPU_ShuffleMode") |
| 37 | +def _gpu_shufflemode(x, context): |
| 38 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 39 | + |
| 40 | + |
| 41 | +@register_attribute_builder("builtin.GPU_SpGEMMWorkEstimationOrComputeKind") |
| 42 | +def _gpu_spgemmworkestimationorcomputekind(x, context): |
| 43 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 44 | + |
| 45 | + |
| 46 | +@register_attribute_builder("builtin.GPU_TransposeMode") |
| 47 | +def _gpu_transposemode(x, context): |
| 48 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 49 | + |
| 50 | + |
| 51 | +@register_attribute_builder("builtin.MMAElementWise") |
| 52 | +def _mmaelementwise(x, context): |
| 53 | + return IntegerAttr.get(IntegerType.get_signless(32, context=context), int(x)) |
| 54 | + |
| 55 | + |
| 56 | +@register_attribute_builder("builtin.MappingIdEnum") |
| 57 | +def _mappingidenum(x, context): |
| 58 | + return IntegerAttr.get(IntegerType.get_signless(64, context=context), int(x)) |
| 59 | + |
| 60 | + |
| 61 | +@register_attribute_builder("builtin.ProcessorEnum") |
| 62 | +def _processorenum(x, context): |
| 63 | + return IntegerAttr.get(IntegerType.get_signless(64, context=context), int(x)) |
0 commit comments