Commit 7b813c5
committed
Use std::transform with pre-allocated buffer in transform_tensor
fplus::transform_convert uses reserve() + back_insert_iterator, which
prevents auto-vectorization because push_back updates the vector's
internal end pointer on every write. Using resize() and writing via a
plain random-access iterator allows the compiler to emit SIMD
instructions, giving ~5% faster inference on VGG19.1 parent 1a404d1 commit 7b813c5
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
0 commit comments