Skip to content

Commit b49923b

Browse files
authored
Merge pull request #5425 from qingqing01/avx_cmake
Fix cmake error when building with WITH_AVX=OFF.
2 parents 3014645 + 7eb65b3 commit b49923b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
if(WITH_AVX)
2-
cc_library(activation_functions SRCS avx_functions.cc)
3-
endif()
1+
cc_library(activation_functions SRCS avx_functions.cc)

paddle/operators/math/detail/avx_functions.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

15+
#ifdef __AVX__
16+
1517
#include <immintrin.h>
1618
#include "paddle/operators/math/detail/activation_functions.h"
1719
// TODO(qingqing) refine this dependence
@@ -84,3 +86,5 @@ __m256 Identity(const __m256 a, const __m256 b) { return a; }
8486
} // namespace math
8587
} // namespace operators
8688
} // namespace paddle
89+
90+
#endif

0 commit comments

Comments
 (0)