(args)
| 866 | # L1 will have a single kernel for every unique shape |
| 867 | # L2 will have everything else |
| 868 | def GenerateGemm_Simt(args): |
| 869 | ################################################################################ |
| 870 | # warps per threadblock |
| 871 | ################################################################################ |
| 872 | warpsPerThreadblocks = [] |
| 873 | for warpsPerThreadblock0 in warpsPerThreadblockEdge: |
| 874 | for warpsPerThreadblock1 in warpsPerThreadblockEdge: |
| 875 | if ( |
| 876 | warpsPerThreadblock0 / warpsPerThreadblock1 <= warpsPerThreadblockRatio |
| 877 | and warpsPerThreadblock1 / warpsPerThreadblock0 |
| 878 | <= warpsPerThreadblockRatio |
| 879 | and warpsPerThreadblock0 * warpsPerThreadblock1 |
| 880 | <= warpsPerThreadblockMax |
| 881 | ): |
| 882 | warpsPerThreadblocks.append( |
| 883 | [warpsPerThreadblock0, warpsPerThreadblock1] |
| 884 | ) |
| 885 | |
| 886 | ################################################################################ |
| 887 | # warp shapes |
| 888 | ################################################################################ |
| 889 | warpNumThreads = 32 |
| 890 | warpShapes = [] |
| 891 | for warp0 in warpShapeEdges: |
| 892 | for warp1 in warpShapeEdges: |
| 893 | if ( |
| 894 | warp0 / warp1 <= warpShapeRatio |
| 895 | and warp1 / warp0 <= warpShapeRatio |
| 896 | and warp0 * warp1 <= warpShapeMax |
| 897 | and warp0 * warp1 > warpShapeMin |
| 898 | ): |
| 899 | warpShapes.append([warp0, warp1]) |
| 900 | |
| 901 | # sgemm |
| 902 | ( |
| 903 | precisionType, |
| 904 | precisionBits, |
| 905 | threadblockMaxElements, |
| 906 | threadblockTilesL0, |
| 907 | ) = precisions["s"] |
| 908 | |
| 909 | layouts = [ |
| 910 | (LayoutType.ColumnMajor, LayoutType.ColumnMajor, LayoutType.RowMajor), # nn |
| 911 | (LayoutType.ColumnMajor, LayoutType.RowMajor, LayoutType.RowMajor), # nt |
| 912 | (LayoutType.RowMajor, LayoutType.ColumnMajor, LayoutType.RowMajor), # tn |
| 913 | (LayoutType.RowMajor, LayoutType.RowMajor, LayoutType.RowMajor), # tt |
| 914 | ] |
| 915 | |
| 916 | math_instructions = [ |
| 917 | MathInstruction( |
| 918 | [1, 1, 1], |
| 919 | DataType.f32, |
| 920 | DataType.f32, |
| 921 | DataType.f32, |
| 922 | OpcodeClass.Simt, |
| 923 | MathOperation.multiply_add, |
| 924 | ) |
| 925 | ] |
no test coverage detected