Skip to content

Commit 8a31e77

Browse files
committed
AUTO for SYMX_ENABLE_AVX2
1 parent 6ea6bc8 commit 8a31e77

File tree

9 files changed

+15
-10
lines changed

9 files changed

+15
-10
lines changed

.doctrees/compilation.doctree

100 Bytes
Binary file not shown.

.doctrees/environment.pickle

0 Bytes
Binary file not shown.

.doctrees/setup.doctree

1.82 KB
Binary file not shown.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_static/overview.jpg

_sources/compilation.md.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Compiled<__m256d> compiled({f, df_dx}, "my_function_simd4d", codegen_dir, checks
120120
Compiled<__m256> compiled({f, df_dx}, "my_function_simd8f", codegen_dir, checksum);
121121
```
122122
Note that you will need to set values of type `FLOAT` and that the result will be returned as `View<FLOAT>`.
123-
If your system does not support these SIMD types, set SymX's the CMake flag `SYMX_ENABLE_AVX2` to `OFF`.
123+
If your system does not support these SIMD types, disable them with `-DSYMX_ENABLE_AVX2=OFF` (the default `AUTO` already does this on non-x86 targets).
124124

125125
### Parallel evaluation
126126
You can evaluate a `Compiled` expression in parallel in the following way:

_sources/setup.md.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,19 @@ build/examples/examples # Examples
4141

4242
| Option | Default | Description |
4343
|---|---|---|
44-
| `SYMX_ENABLE_AVX2` | `ON` | Enable AVX2 + FMA SIMD paths |
44+
| `SYMX_ENABLE_AVX2` | `AUTO` | Enable AVX2 + FMA SIMD paths (`AUTO` / `ON` / `OFF`); `AUTO` enables on x86/x86_64/AMD64 |
4545
| `SYMX_COMPILER_PATH` | `AUTO` | Compiler used for JIT code generation at runtime |
4646
| `SYMX_CODEGEN_DIR` | *(empty)* | Output directory for generated files; defaults to `<build>/codegen` |
4747
| `SYMX_HESS_STORAGE_FLOAT` | `float` | Hessian storage precision (`float` or `double`) |
4848

4949

5050
### AVX2 support
5151
SymX uses AVX2 to speedup computations in several locations, such as evaluation and linear system solves.
52-
If your system does not support it (e.g. Apple Silicon) use `SYMX_ENABLE_AVX2=OFF` in CMake to disable such code paths.
52+
`SYMX_ENABLE_AVX2` accepts `AUTO` (default), `ON`, or `OFF`.
53+
`AUTO` enables AVX2 on x86/x86_64/AMD64 and disables it everywhere else (e.g. Apple Silicon).
54+
Override explicitly with `-DSYMX_ENABLE_AVX2=ON` or `-DSYMX_ENABLE_AVX2=OFF`.
5355

54-
If you try to compile SymX as-is, without support for AVX2 you will get something like:
56+
If you try to compile on a non-AVX2 system with `ON`, you will get something like:
5557

5658
```bash
5759
../immintrin.h:14 error "This header is only meant to be used on x86 and x64 architecture"

compilation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ <h3>Compilation <code class="docutils literal notranslate"><span class="pre">FLO
383383
</pre></div>
384384
</div>
385385
<p>Note that you will need to set values of type <code class="docutils literal notranslate"><span class="pre">FLOAT</span></code> and that the result will be returned as <code class="docutils literal notranslate"><span class="pre">View&lt;FLOAT&gt;</span></code>.
386-
If your system does not support these SIMD types, set SymX’s the CMake flag <code class="docutils literal notranslate"><span class="pre">SYMX_ENABLE_AVX2</span></code> to <code class="docutils literal notranslate"><span class="pre">OFF</span></code>.</p>
386+
If your system does not support these SIMD types, disable them with <code class="docutils literal notranslate"><span class="pre">-DSYMX_ENABLE_AVX2=OFF</span></code> (the default <code class="docutils literal notranslate"><span class="pre">AUTO</span></code> already does this on non-x86 targets).</p>
387387
</section>
388388
<section id="parallel-evaluation">
389389
<h3>Parallel evaluation<a class="headerlink" href="#parallel-evaluation" title="Link to this heading"></a></h3>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ <h2>CMake options<a class="headerlink" href="#cmake-options" title="Link to this
323323
</thead>
324324
<tbody>
325325
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">SYMX_ENABLE_AVX2</span></code></p></td>
326-
<td><p><code class="docutils literal notranslate"><span class="pre">ON</span></code></p></td>
327-
<td><p>Enable AVX2 + FMA SIMD paths</p></td>
326+
<td><p><code class="docutils literal notranslate"><span class="pre">AUTO</span></code></p></td>
327+
<td><p>Enable AVX2 + FMA SIMD paths (<code class="docutils literal notranslate"><span class="pre">AUTO</span></code> / <code class="docutils literal notranslate"><span class="pre">ON</span></code> / <code class="docutils literal notranslate"><span class="pre">OFF</span></code>); <code class="docutils literal notranslate"><span class="pre">AUTO</span></code> enables on x86/x86_64/AMD64</p></td>
328328
</tr>
329329
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">SYMX_COMPILER_PATH</span></code></p></td>
330330
<td><p><code class="docutils literal notranslate"><span class="pre">AUTO</span></code></p></td>
@@ -344,8 +344,10 @@ <h2>CMake options<a class="headerlink" href="#cmake-options" title="Link to this
344344
<section id="avx2-support">
345345
<h3>AVX2 support<a class="headerlink" href="#avx2-support" title="Link to this heading"></a></h3>
346346
<p>SymX uses AVX2 to speedup computations in several locations, such as evaluation and linear system solves.
347-
If your system does not support it (e.g. Apple Silicon) use <code class="docutils literal notranslate"><span class="pre">SYMX_ENABLE_AVX2=OFF</span></code> in CMake to disable such code paths.</p>
348-
<p>If you try to compile SymX as-is, without support for AVX2 you will get something like:</p>
347+
<code class="docutils literal notranslate"><span class="pre">SYMX_ENABLE_AVX2</span></code> accepts <code class="docutils literal notranslate"><span class="pre">AUTO</span></code> (default), <code class="docutils literal notranslate"><span class="pre">ON</span></code>, or <code class="docutils literal notranslate"><span class="pre">OFF</span></code>.
348+
<code class="docutils literal notranslate"><span class="pre">AUTO</span></code> enables AVX2 on x86/x86_64/AMD64 and disables it everywhere else (e.g. Apple Silicon).
349+
Override explicitly with <code class="docutils literal notranslate"><span class="pre">-DSYMX_ENABLE_AVX2=ON</span></code> or <code class="docutils literal notranslate"><span class="pre">-DSYMX_ENABLE_AVX2=OFF</span></code>.</p>
350+
<p>If you try to compile on a non-AVX2 system with <code class="docutils literal notranslate"><span class="pre">ON</span></code>, you will get something like:</p>
349351
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>../immintrin.h:14<span class="w"> </span>error<span class="w"> </span><span class="s2">&quot;This header is only meant to be used on x86 and x64 architecture&quot;</span>
350352
</pre></div>
351353
</div>

0 commit comments

Comments
 (0)