You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that Boost.SIMD requires a C++11 conformant compiler. This means that packages making use of SIMD features may not compile on platforms with older compilers including Windows and RedHat/CentOS Linux. You can however create a package that takes advantage of Boost.SIMD where available and falls back to a non-SIMD implementation elsewhere.
112
83
113
-
You can test for the availability of Boost.SIMD on a given platform using the `RCPP_PARALLEL_USE_SIMD` preprocessor variable. If the current compiler doesn't support C++11 (as determined by `__cplusplus <= 199711L`) the variable will be undefined. This allows you to write code like this:
84
+
You can test for the availability of Boost.SIMD on a given platform using the `RCPP_PARALLEL_USE_SIMD` preprocessor variable. If the current compiler doesn't support C++11 (as determined by `__cplusplus <= 199711L`) the variable will be undefined (even if you defined it explicitly). This allows you to write code like this:
114
85
115
86
```cpp
87
+
#defineRCPP_PARALLEL_USE_SIMD 1
116
88
#include <RcppParallel.h>
117
89
90
+
118
91
#if RCPP_PARALLEL_USE_SIMD
119
92
120
93
#include <boost/simd/sdk/simd/pack.hpp>
@@ -146,28 +119,6 @@ The two `transformDataImpl` functions have the same name, but only one will be c
146
119
147
120
Note that if you conditionally compile all uses of Boost.SIMD within your package then you can actually drop the `C++11` from `SystemRequirements` (it's no longer required as a result of your fallback implementation).
148
121
149
-
## Disabling SIMD
150
-
151
-
If you don't want to use Boost.SIMD at all you can explicitly disable it as follows:
152
-
153
-
1. For `sourceCpp` you can define `RCPP_PARALLEL_USE_SIMD`:
154
-
155
-
```cpp
156
-
#define RCPP_PARALLEL_USE_SIMD 0
157
-
```
158
-
159
-
2. For R packages you can pass `simd = FALSE` to the CxxFlags function:
0 commit comments