| 16 | |
| 17 | # |
| 18 | class Conv2dOperation: |
| 19 | # |
| 20 | def __init__( |
| 21 | self, |
| 22 | conv_kind, |
| 23 | conv_type, |
| 24 | arch, |
| 25 | tile_description, |
| 26 | src, |
| 27 | flt, |
| 28 | bias, |
| 29 | dst, |
| 30 | element_epilogue, |
| 31 | epilogue_functor=EpilogueFunctor.LinearCombination, |
| 32 | swizzling_functor=SwizzlingFunctor.Identity4, |
| 33 | special_optimization=SpecialOptimizeDesc.NoneSpecialOpt, |
| 34 | implicit_gemm_mode=ImplicitGemmMode.GemmNT, |
| 35 | without_shared_load=False, |
| 36 | required_cuda_ver_major=9, |
| 37 | required_cuda_ver_minor=2, |
| 38 | rin=None, |
| 39 | rout=None, |
| 40 | ): |
| 41 | |
| 42 | self.operation_kind = OperationKind.Conv2d |
| 43 | self.conv_kind = conv_kind |
| 44 | self.arch = arch |
| 45 | self.tile_description = tile_description |
| 46 | self.conv_type = conv_type |
| 47 | self.src = src |
| 48 | self.flt = flt |
| 49 | self.bias = bias |
| 50 | self.dst = dst |
| 51 | self.element_epilogue = element_epilogue |
| 52 | self.epilogue_functor = epilogue_functor |
| 53 | self.swizzling_functor = swizzling_functor |
| 54 | self.special_optimization = special_optimization |
| 55 | self.implicit_gemm_mode = implicit_gemm_mode |
| 56 | self.without_shared_load = without_shared_load |
| 57 | self.required_cuda_ver_major = required_cuda_ver_major |
| 58 | self.required_cuda_ver_minor = required_cuda_ver_minor |
| 59 | self.rin = rin |
| 60 | self.rout = rout |
| 61 | |
| 62 | # |
| 63 | def accumulator_type(self): |
| 64 | accum = self.tile_description.math_instruction.element_accumulator |
| 65 | |
| 66 | return accum |
| 67 | |
| 68 | # |
| 69 | def core_name(self): |
| 70 | """ The basic operation kind is prefixed with a letter indicating the accumulation type. """ |
| 71 | |
| 72 | intermediate_type = "" |
| 73 | |
| 74 | if self.tile_description.math_instruction.opcode_class == OpcodeClass.TensorOp: |
| 75 | inst_shape = "%d%d%d" % tuple( |
no outgoing calls
no test coverage detected