move to explicit avx2 switching (#37207)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37207
The main idea here is to try and give build system more flexibility on when various AVX instruction are defined, previously it was based solely on compiler defined preprocessor flags.
Here we re-use `CPU_CAPABILITY` which already needs to be defined for each pass in `["DEFAULT", "AVX", "AVX2"]` over the source files.
To give a slightly more concrete reason this is needed, is that we have not found a way to override `/arch` flags previously specified on the command line from visual studio (causing us to duplicate symbols in some cases).
Test Plan: CI green
Differential Revision: D21218512
fbshipit-source-id: f628153f5f3d83cd6bd4a5283fb0dc751a58ebf9