Skip to content

Commit

Permalink
Undefine bool and vector after including altivec.h (#46179)
Browse files Browse the repository at this point in the history
Summary:
Fixes #41261

Pull Request resolved: #46179

Reviewed By: bdhirsh

Differential Revision: D24258470

Pulled By: glaringlee

fbshipit-source-id: f9d3589a30ed396cb88404d3471788aed8dea237
  • Loading branch information
Flamefire authored and facebook-github-bot committed Oct 14, 2020
1 parent 45de2ee commit f2e5ae4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aten/src/ATen/cpu/vec256/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
(defined(__VEC__) || defined(__ALTIVEC__))
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
/* We need to undef those tokens defined by <altivec.h> to avoid conflicts
with the C++ types. => Can still use __bool/__vector */
#undef bool
#undef vector
#undef pixel
#elif defined(__GNUC__) && defined(__SPE__)
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
Expand Down
5 changes: 5 additions & 0 deletions aten/src/ATen/native/cpu/Intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
(defined(__VEC__) || defined(__ALTIVEC__))
/* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
#include <altivec.h>
/* We need to undef those tokens defined by <altivec.h> to avoid conflicts
with the C++ types. => Can still use __bool/__vector */
#undef bool
#undef vector
#undef pixel
#elif defined(__GNUC__) && defined(__SPE__)
/* GCC-compatible compiler, targeting PowerPC with SPE */
#include <spe.h>
Expand Down

0 comments on commit f2e5ae4

Please sign in to comment.