(modes, simds, fsizes)
| 149 | """.format(**vars())) |
| 150 | |
| 151 | def gen_header(modes, simds, fsizes): |
| 152 | with open('convolution_direct_special_cases.h', 'w') as f: |
| 153 | f.write("""#pragma once |
| 154 | |
| 155 | #include <cstddef> |
| 156 | #include "megdnn/arch.h" |
| 157 | |
| 158 | namespace megdnn { |
| 159 | namespace x86 { |
| 160 | namespace detail { |
| 161 | """) |
| 162 | for mode, simd, fsize in itertools.product(modes, simds, fsizes): |
| 163 | funcname = "convolution_{mode}_fh{fsize}_{simd}".format(**vars()) |
| 164 | f.write(""" |
| 165 | void {funcname}(const float *src, const float *filter, float *dst, |
| 166 | const size_t src_h, const size_t src_w, const size_t dst_h, const size_t dst_w, |
| 167 | const size_t flt_w) MEGDNN_ATTRIBUTE_TARGET("{simd}"); |
| 168 | """.format(**vars())) |
| 169 | |
| 170 | f.write("""} // namespace detail |
| 171 | } // namespace x86 |
| 172 | } // namespace megdnn |
| 173 | """) |
| 174 | |
| 175 | if __name__ == '__main__': |
| 176 | for mode in ['xcorr', 'conv']: |
no test coverage detected