Eliminate type dispatch from copy_kernel, and use memcpy directly rather than impleme...
authorOwen Anderson <owen.anderson@oculus.com>
Wed, 17 Apr 2019 22:33:07 +0000 (15:33 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 17 Apr 2019 22:39:13 +0000 (15:39 -0700)
commitd6b91075dc79af5022206dac730732fd1edcb488
tree8688dd33d7eedda06b656503fe6e8120b15c9628
parent3e0b46b6d132c22af84769a6df1ef8d1f785dbe2
Eliminate type dispatch from copy_kernel, and use memcpy directly rather than implementing our own copy. (#19198)

Summary:
It turns out that copying bytes is the same no matter what type
they're interpreted as, and memcpy is already vectorized on every
platform of note.  Paring this down to the simplest implementation
saves just over 4KB off libtorch.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19198

Differential Revision: D14922656

Pulled By: resistor

fbshipit-source-id: bb03899dd8f6b857847b822061e7aeb18c19e7b4
aten/src/ATen/native/cpu/CopyKernel.cpp