Skip to content

Commit 04b312e

Browse files
cpuhrschgchanan
authored andcommitted
Remove SSE-only code and convolve5x5 (pytorch#12109)
Summary: Performance oriented code will use AVX/AVX2, so we don't need SSE specific code anymore. This will also reduce the probability of running into an error on legacy CPUs. On top of this convolve is covered by modern libraries such as MKLDNN, which are much more performant and which we now build against by default (even for builds from source). Pull Request resolved: pytorch#12109 Differential Revision: D10055134 Pulled By: colesbury fbshipit-source-id: 789b8a34d5936d9c144bcde410c30f7eb1c776fa
1 parent 208f449 commit 04b312e

14 files changed

+63
-1552
lines changed

aten/src/TH/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
set(extra_src)
22

3-
# IF ANY SIMD FOUND
4-
IF(C_AVX2_FOUND OR C_AVX_FOUND OR C_SSE4_2_FOUND OR C_SSE4_1_FOUND)
5-
LIST(APPEND extra_src ${CMAKE_CURRENT_SOURCE_DIR}/generic/simd/convolve.cpp)
6-
ENDIF(C_AVX2_FOUND OR C_AVX_FOUND OR C_SSE4_2_FOUND OR C_SSE4_1_FOUND)
7-
8-
# IF SSE4 FOUND
9-
IF(C_SSE4_1_FOUND OR C_SSE4_2_FOUND)
10-
LIST(APPEND extra_src ${CMAKE_CURRENT_SOURCE_DIR}/generic/simd/convolve5x5_sse.cpp)
11-
ENDIF(C_SSE4_1_FOUND OR C_SSE4_2_FOUND)
12-
133
# IF AVX FOUND
144
IF(C_AVX_FOUND)
155
LIST(APPEND extra_src ${CMAKE_CURRENT_SOURCE_DIR}/vector/AVX.cpp)
16-
LIST(APPEND extra_src ${CMAKE_CURRENT_SOURCE_DIR}/generic/simd/convolve5x5_avx.cpp)
176
ENDIF(C_AVX_FOUND)
187

198
IF(C_AVX2_FOUND)

aten/src/TH/THVector.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "THVector.h"
22

3-
#include "generic/simd/simd.h"
3+
#include "vector/simd.h"
44

55
#ifdef __NEON__
66
#include "vector/NEON.cpp"
@@ -10,11 +10,6 @@
1010
#include "vector/VSX.cpp"
1111
#endif
1212

13-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
14-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
15-
#include "vector/SSE.cpp"
16-
#endif
17-
1813
#if defined(USE_AVX)
1914
#include "vector/AVX.h"
2015
#endif

aten/src/TH/generic/THVectorDispatch.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ static FunctionDescription THVector_(fill_DISPATCHTABLE)[] = {
3232
#endif
3333
#endif
3434

35-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
36-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
37-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
38-
FUNCTION_IMPL(THVector_(fill_SSE), SIMDExtension_SSE),
39-
#endif
40-
#endif
4135
FUNCTION_IMPL(THVector_(fill_DEFAULT), SIMDExtension_DEFAULT)
4236
};
4337
void THVector_(fill)(scalar_t *x, const scalar_t c, const ptrdiff_t n) {
@@ -64,13 +58,6 @@ static FunctionDescription THVector_(cadd_DISPATCHTABLE)[] = {
6458
#endif
6559
#endif
6660

67-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
68-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
69-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
70-
FUNCTION_IMPL(THVector_(cadd_SSE), SIMDExtension_SSE),
71-
#endif
72-
#endif
73-
7461
FUNCTION_IMPL(THVector_(cadd_DEFAULT), SIMDExtension_DEFAULT)
7562
};
7663
void THVector_(cadd)(scalar_t *z, const scalar_t *x, const scalar_t *y, const scalar_t c, const ptrdiff_t n) {
@@ -97,13 +84,6 @@ static FunctionDescription THVector_(adds_DISPATCHTABLE)[] = {
9784
#endif
9885
#endif
9986

100-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
101-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
102-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
103-
FUNCTION_IMPL(THVector_(adds_SSE), SIMDExtension_SSE),
104-
#endif
105-
#endif
106-
10787
FUNCTION_IMPL(THVector_(adds_DEFAULT), SIMDExtension_DEFAULT)
10888
};
10989
// Dispatch stubs that just call the pointers
@@ -125,13 +105,6 @@ static FunctionDescription THVector_(cmul_DISPATCHTABLE)[] = {
125105
#endif
126106
#endif
127107

128-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
129-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
130-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
131-
FUNCTION_IMPL(THVector_(cmul_SSE), SIMDExtension_SSE),
132-
#endif
133-
#endif
134-
135108
FUNCTION_IMPL(THVector_(cmul_DEFAULT), SIMDExtension_DEFAULT)
136109
};
137110
void THVector_(cmul)(scalar_t *z, const scalar_t *x, const scalar_t *y, const ptrdiff_t n) {
@@ -158,13 +131,6 @@ static FunctionDescription THVector_(muls_DISPATCHTABLE)[] = {
158131
#endif
159132
#endif
160133

161-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
162-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
163-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
164-
FUNCTION_IMPL(THVector_(muls_SSE), SIMDExtension_SSE),
165-
#endif
166-
#endif
167-
168134
FUNCTION_IMPL(THVector_(muls_DEFAULT), SIMDExtension_DEFAULT)
169135
};
170136
void THVector_(muls)(scalar_t *y, const scalar_t *x, const scalar_t c, const ptrdiff_t n) {
@@ -185,13 +151,6 @@ static FunctionDescription THVector_(cdiv_DISPATCHTABLE)[] = {
185151
#endif
186152
#endif
187153

188-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
189-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
190-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
191-
FUNCTION_IMPL(THVector_(cdiv_SSE), SIMDExtension_SSE),
192-
#endif
193-
#endif
194-
195154
FUNCTION_IMPL(THVector_(cdiv_DEFAULT), SIMDExtension_DEFAULT)
196155
};
197156
void THVector_(cdiv)(scalar_t *z, const scalar_t *x, const scalar_t *y, const ptrdiff_t n) {
@@ -212,13 +171,6 @@ static FunctionDescription THVector_(divs_DISPATCHTABLE)[] = {
212171
#endif
213172
#endif
214173

215-
#if defined(USE_SSE2) || defined(USE_SSE3) || defined(USE_SSSE3) \
216-
|| defined(USE_SSE4_1) || defined(USE_SSE4_2)
217-
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
218-
FUNCTION_IMPL(THVector_(divs_SSE), SIMDExtension_SSE),
219-
#endif
220-
#endif
221-
222174
FUNCTION_IMPL(THVector_(divs_DEFAULT), SIMDExtension_DEFAULT)
223175
};
224176
void THVector_(divs)(scalar_t *y, const scalar_t *x, const scalar_t c, const ptrdiff_t n) {

0 commit comments

Comments
 (0)