(
manifest,
layouts,
tile_descriptions,
data_type,
alignment_constraints,
complex_transforms=None,
epilogue_functor=EpilogueFunctor.LinearCombination,
swizzling_functor=SwizzlingFunctor.Identity8,
)
| 36 | |
| 37 | # |
| 38 | def CreateGemmOperator( |
| 39 | manifest, |
| 40 | layouts, |
| 41 | tile_descriptions, |
| 42 | data_type, |
| 43 | alignment_constraints, |
| 44 | complex_transforms=None, |
| 45 | epilogue_functor=EpilogueFunctor.LinearCombination, |
| 46 | swizzling_functor=SwizzlingFunctor.Identity8, |
| 47 | ): |
| 48 | |
| 49 | if complex_transforms is None: |
| 50 | complex_transforms = [(ComplexTransform.none, ComplexTransform.none)] |
| 51 | |
| 52 | element_a, element_b, element_c, element_epilogue = data_type |
| 53 | |
| 54 | operations = [] |
| 55 | |
| 56 | # by default, only generate the largest tile and largest alignment |
| 57 | if manifest.args.kernels == "": |
| 58 | tile_descriptions = [tile_descriptions[0]] |
| 59 | alignment_constraints = [alignment_constraints[0]] |
| 60 | |
| 61 | for layout in layouts: |
| 62 | for tile_description in tile_descriptions: |
| 63 | for alignment in alignment_constraints: |
| 64 | for complex_transform in complex_transforms: |
| 65 | |
| 66 | alignment_c = min(8, alignment) |
| 67 | |
| 68 | A = TensorDescription( |
| 69 | element_a, layout[0], alignment, complex_transform[0] |
| 70 | ) |
| 71 | B = TensorDescription( |
| 72 | element_b, layout[1], alignment, complex_transform[1] |
| 73 | ) |
| 74 | C = TensorDescription(element_c, layout[2], alignment_c) |
| 75 | |
| 76 | new_operation = GemmOperation( |
| 77 | GemmKind.Universal, |
| 78 | tile_description.minimum_compute_capability, |
| 79 | tile_description, |
| 80 | A, |
| 81 | B, |
| 82 | C, |
| 83 | element_epilogue, |
| 84 | epilogue_functor, |
| 85 | swizzling_functor, |
| 86 | ) |
| 87 | |
| 88 | manifest.append(new_operation) |
| 89 | operations.append(new_operation) |
| 90 | |
| 91 | return operations |
| 92 | |
| 93 | |
| 94 | ########################################################################################################### |
nothing calls this directly
no test coverage detected