Compare commits

..
677 Commits
Author SHA1 Message Date
Sven Woop 82ca6b5ccb Fixed compilation issues for ARM AArch64 processor under Linux. 2022-10-26 07:34:52 +02:00
Sven Woop 6a649a96b3 disabling windows ICX test temporarily 2022-10-18 00:08:04 -05:00
SpaceIm b0d26705cc fix cmake_minimum_required position 2022-10-18 00:08:04 -05:00
Sven Woop da4e071864 running release CI job only nightly 2022-10-18 00:08:04 -05:00
Vertexwahn 4e937c6783 Fix spelling mistake 2022-10-18 00:08:04 -05:00
Sven Woop 7f44f1c880 adding vcpkg install instructions also to docu source files 2022-09-15 07:54:30 +02:00
Jonliu1993 b3239b14d6 Add vcpkg installation instructions 2022-09-15 07:52:18 +02:00
Sven Woop 698442324c regenerated documentation 2022-09-08 08:40:43 +02:00
Sven Woop 7d9870320e setting version to v3.13.5 2022-09-08 08:38:23 +02:00
Krzysztof Raszkowski c49b994c74 ci: add github actions workflows 2022-09-08 05:40:37 +00:00
jiebin sun 37fde23bc8 FastAllocator: fix the false sharing in SpinLock array
The size of SpinLock is only 1 byte. When allocating a
SpinLock array (SlotMutex[MAX_THREAD_USED_BLOCK_SLOTS]),
they will shares within the same cache line (64 bytes).
Although different threads using different slot, they
actually update the same cache line which has a false
sharing issue.

This patch introduce a PaddedSpinLock for this scenario,
by padding SpinLock to 1 cache line size. This can fix
the false sharing problem in FastAllocator.

We got the test data from pts/openvkl-1.0.0.
It get 5.2% score improvement on ICX platform.

CPU: ICX 8380 x 2 sockets
Core number: 40 x 2 physical cores
Benchmark: pts/openvkl-1.0.0 - render_wavelet_unstructured_hex
/density_pathtracer / 512 / ispc

Signed-off-by: Jiebin Sun <jiebin.sun@intel.com>
2022-09-06 07:17:49 +02:00
Sven Woop b50bd7a906 Fixed spatial splitting for non-planar quads. 2022-09-05 14:21:25 +02:00
Sven Woop d70beac22b no longer automatically starting thread nor setting affinity 2022-09-05 08:07:29 +02:00
Sven Woop 490e8f8025 disabling thread ID affinity re-mapping as it causes issues inside LXC containers 2022-09-05 08:01:57 +02:00
Krzysztof Raszkowski 543924e46f TBB: Stop task_scheduler_observer when TaskScheduler is destroyed 2022-09-05 07:59:36 +02:00
Sven Woop 4b3ad3fb6f Improved self intersection avoidance for RTC_GEOMETRY_TYPE_DISC_POINT geometry type. 2022-08-31 10:10:25 +02:00
Julian Amann 8a4b53508e Fix compilation issues on macOS 12.5 and Apple clang version 13.1.6 2022-08-29 16:57:50 +02:00
Sven Woop ccff5d3b8c Fixed bug in bounding flat Catmull Rom curves of subdivision level 4. 2022-07-01 09:45:05 +02:00
Mike 11614d77c0 remove redundant flags 2022-06-28 11:21:40 +02:00
郑少锟 d748e3aa17 Make the linker options in gnu.cmake compatible with lld-link 2022-06-28 11:21:32 +02:00
郑少锟 6930fce65c Fix compilation on Windows for Clang with non-MSVC command-line options 2022-06-28 11:21:21 +02:00
luz paz f045fbe7bf Fix typos in documentation 2022-06-27 10:41:24 +02:00
Florian Reibold 250cca62b4 Revert removal of EMBREE_STATIC_LIB from rtcore_config header 2022-06-27 10:28:03 +02:00
Sven Woop 489b746c0d fixed potential issues with ARM compilation under Linux 2022-06-15 07:13:52 +02:00
Sven Woop 64774c98d9 compile fixes for Windows 2022-06-15 07:06:18 +02:00
Sven Woop 2d7650f3c1 updated documentation 2022-06-14 19:06:34 +02:00
Sven Woop 77b0f38479 setting version to v3.13.4 2022-06-14 19:04:22 +02:00
Sven Woop ec136e30a6 updates to changelog 2022-06-14 19:03:58 +02:00
Sven Woop 1732d69484 Merge branch '330-restore-AVX2-via-2xNEON' into 'devel3'
Restore AVX2 via 2xNEON support for Apple silicon

See merge request renderkit/embree!1223
2022-06-14 11:26:25 +00:00
Sven Woop 901ed5c283 added Apple M1 performance optimization to changelog 2022-06-14 12:19:38 +02:00
Sven Woop 8ee28f41ff only enabling AVX2 when using AVX2NEON on MacOS 2022-06-14 12:16:57 +02:00
Sven Woop 0c126e1710 adding NEON2X cmake ISA config for ARM 2022-06-14 12:16:57 +02:00
Sven Woop 125a1aa667 restoring kernels/common/default.h 2022-06-14 12:16:57 +02:00
Sven Woop ab305081d3 restoring macosx-version-min to 10.7 2022-06-14 12:16:57 +02:00
Sven Woop 2d26f79dd9 minor cleanups 2022-06-14 12:16:57 +02:00
Sven Woop 1016d761a2 restoring scene.cpp 2022-06-14 12:16:57 +02:00
Sven Woop 18eeda2e1a consistently using fmadd/fmsub on NEON, this improves performance further 2022-06-14 12:16:57 +02:00
Sven Woop 2dae020a53 replaced _mm_movemask_popcnt_ps by faster version 2022-06-14 12:16:57 +02:00
Sven Woop e0b136fb32 removed more less important constants 2022-06-14 12:16:57 +02:00
Sven Woop ce83816847 removed more less important constants 2022-06-14 12:16:57 +02:00
Sven Woop 487be48ee3 removed some constants that were already present in mm_lookupmask_ps 2022-06-14 12:16:57 +02:00
Sven Woop 5b453ab524 no longer using c++17 under macOS 2022-06-14 12:16:57 +02:00
Sven Woop 8aea171e80 rtcore.cpp no longer using std::mutex just for Apple, we will switch to std::mutex at some later point 2022-06-14 12:16:57 +02:00
Sven Woop f677d3bf51 restored original common/sys/vector.h 2022-06-14 12:16:57 +02:00
Sven Woop 9ff10e3b86 cleanups to vboolf8_avx and verify.cpp 2022-06-14 12:16:57 +02:00
Sven Woop 841e5fc98a removed special insert/extract functions for aarch, there are already functions that perform the same operation 2022-06-14 12:16:57 +02:00
Sven Woop 8f5dee4d23 removed special store/storeu aarch64 case 2022-06-14 12:16:57 +02:00
Sven Woop 6bee1ef300 replacing prod_diff by msub again 2022-06-14 12:16:57 +02:00
Sven Woop 6ee9722d0d compile fix for EMBREE_NEON_AVX2_EMULATION disabled 2022-06-14 12:16:57 +02:00
Sven Woop 2525a63227 making EMBREE_NEON_AVX2_EMULATION configurable 2022-06-14 12:16:57 +02:00
Sven Woop a04dad68b3 using 8-wide BVH when EMBREE_NEON_AVX2_EMULATION is enabled 2022-06-14 12:16:57 +02:00
Sven Woop 9d6af06002 enabling ISPC on Apple NEON again 2022-06-14 12:16:57 +02:00
Sven Woop 2f3134ea94 using neon-i32x8 target for ISPC when EMBREE_NEON_AVX2_EMULATION is enabled 2022-06-14 12:16:57 +02:00
Sven Woop d1a18f8563 removed -fms-extensions as this causes issues with WebAssembly build 2022-06-14 12:16:57 +02:00
Sven Woop 2123d8edf4 added CI testing for NEON AVX2 mode 2022-06-14 12:16:57 +02:00
Developer-Ecosystem-Engineering 8a6c9417eb Restore AVX2 via 2x NEON support for Apple silicon
- Restore changes from Lighttransport/embree-aarch64 related to AVX2 (Neon2x for Apple silicon lighttransport/embree-aarch64#34)
- Add bootstrap scripts for linux/arm64 and mac/arm64
- Restore a couple missed PRs from the lighttransport merge around threading
- Fix broken tests highlighted by @svenwoop
2022-06-14 12:16:57 +02:00
Developer-Ecosystem-Engineering 9ca7074997 Revert "Restore AVX2 via 2xNEON support for Apple silicon"
This reverts commit fd50f37d3703bb90e522c4b8da770dc5c097d2b2.
2022-06-14 12:16:57 +02:00
Developer-Ecosystem-Engineering 3c2a9e8770 Revert "Use SIMD256 on CPU::ARM"
This reverts commit 883b78016d5a5f2ef7e1f53cac143e44e2822a50.
2022-06-14 12:16:57 +02:00
Developer-Ecosystem-Engineering 2321a83944 Use SIMD256 on CPU::ARM
SIMD256 was being disabled which was prohibiting projects from benefiting from these changes.

Also minor update to CMAKE so by default it will support AVX2 without additional flags on AS_MAC.
2022-06-14 12:16:57 +02:00
Developer-Ecosystem-Engineering dcd5706dfe Restore AVX2 via 2xNEON support for Apple silicon
- Restore changes from Lighttransport/embree-aarch64 related to AVX2
- Add bootstrap scripts for linux/arm64 and mac/arm64
2022-06-14 12:16:57 +02:00
Florian Reibold 7619ec5c01 don't define dll_export/dll_import when building Embree as a static
library on Windows
2022-06-14 10:54:44 +02:00
Sebastian Herholz 6ffcaed6ca adding support for user defined TBB library names 2022-06-14 10:07:39 +02:00
Sven Woop 0d349e3979 Fixed binning related crash in SAH BVH builder. 2022-05-24 08:53:02 +02:00
Sven Woop a5e8e6858e fixed DPCPP detection by executable name matching 2022-03-29 07:36:42 +02:00
Sven Woop d0c47b0982 using constexpr for constant definitions 2022-03-29 07:31:13 +02:00
Sven Woop 552990bae7 added more generic interface to parallel_for and parallel_for_for_prefix_sum 2022-03-29 07:31:05 +02:00
Florian Reibold ba78eaa1fe disable ICX on windows and replace TBB 2021.5.0 with 2021.2.0 2022-03-24 20:08:37 +01:00
Florian Reibold 304888c7db run windows ICX job with less threads to pervent out of memory error 2022-03-14 11:35:25 +01:00
Florian Reibold bd3d50b637 TBB 2021.5.0 might cause nondeterministic segfaults in CI test. 2022-03-11 16:39:19 +01:00
Florian Reibold fcd160334e improve handling of ICX/DPCPP on linux 2022-03-11 16:39:16 +01:00
Will Usher 212bf44fa1 Add handling for Intel oneAPI DPCPP compiler, do not treat as clang 2022-03-11 12:18:25 +01:00
Sven Woop 03950fd93b bugfix to compile with recent GCC 2022-03-07 18:35:39 +01:00
Sven Woop f19893de7a no longer passing InternalContext to user geometry callbacks 2022-03-04 10:58:12 +01:00
Sven Woop ae3a12524e invoking reportIntersection1/reportOcclusion1 via direct call in rtcore.cpp 2022-03-04 10:49:09 +01:00
Florian Reibold ab648f3690 add threads:N argument to test.py configure stage 2022-02-21 13:42:35 +01:00
Sven Woop 1705273cd6 disabled ICX Windows CI for now 2022-02-21 11:35:55 +01:00
luz paz 5641c6248e Fix various typos
Found via `codespell -q 3 -S ./common/simd -L affinitized,ba,coner,fo,parm,parms,seh,wit`
2022-02-21 08:24:40 +01:00
Sven Woop 14e6497992 added Intel® oneAPI DPC++/C++ Compiler 2022.0.0 as supported compiler 2022-02-17 07:06:46 +01:00
Florian Reibold 50938adf3b use specific ICX version under Windows 2022-02-16 09:44:23 +01:00
Sven Woop 0835461a5d running nightly CI also for web pipeline triggers 2022-02-11 07:16:08 +01:00
Sven Woop b25dc11d54 adding support for comments in CI models file 2022-02-11 07:05:45 +01:00
Sven Woop de0a3ca1ca regenerated documenation 2022-02-10 16:19:37 +01:00
Sven Woop ca71c31c1f setting version to v3.13.3 2022-02-10 15:22:29 +01:00
Sven Woop 6c801c8cbc updates to changelog 2022-02-10 15:22:02 +01:00
Sven Woop 211eb871d3 disabling sponza CI testing 2022-02-10 12:11:32 +01:00
Sven Woop 2a29f4b097 fixed typo in TBB version 2021.5.0 under Windows 2022-02-10 11:57:37 +01:00
Sven Woop ba3ff8f98a Upgrading to oneTBB 2021.5.0 for release build. 2022-02-09 11:17:07 +01:00
Sven Woop 0ad51f0274 using ISPC 1.17.0 2022-02-09 09:20:11 +01:00
Sven Woop 4e0ae2b4d5 fixed issues with increased compare-threshold for sponza model 2022-02-09 09:09:15 +01:00
Florian Reibold 2d801fcc7c fix MY_PROJECT_BINARY_DIR in case of icx compiler 2022-02-08 21:20:12 +01:00
Florian Reibold ffb06b787a add ICX test on windows 2022-02-08 21:20:12 +01:00
Florian Reibold 252a48fc4f change dpcpp fp-mode to precise (same as clang's default) 2022-02-08 21:20:12 +01:00
Florian Reibold 87e579c725 add support for icx (oneapi intel dpcpp compiler) on linux 2022-02-08 21:20:03 +01:00
Florian Reibold bbc79bdb26 don't alias -i and -c command line options for benchmarking 2022-02-08 21:19:14 +01:00
Sven Woop 2dd3716dfb This commit fixes an issue with normal oriented curve construction, caused by large
curvature of the center curve at begin (or end). These large curvatures cause the
line segment at the start (or end) of the curve to rotate very fast, making the derivatives of the
motion of its end points very large. This causes a large extension of the constructed curve
in some cases. As workaround we just use 0 as second order derivative of the center
curve.
2022-02-08 09:01:16 +01:00
Sven Woop e5cab61294 removed some space in path fixes that cause issues 2022-02-07 08:35:58 +01:00
Florian Reibold 664049491b changelog 2022-02-04 21:20:09 +01:00
Florian Reibold fc0ea79b29 Fix occlusion query bug in subgrid intersector for ray packets 2022-02-04 20:35:53 +01:00
Sven Woop 410a2573d8 added WebAssembly CI test 2022-02-04 11:02:13 +01:00
Eric Stollnitz 79763160b7 Fix parallel_partition test on WASM.
Need to use uint64_t instead of size_t to avoid overflows.
2022-02-04 10:07:09 +01:00
Eric Stollnitz 043f504dc0 Allow choice of EMBREE_TASKING_SYSTEM in emscripten. 2022-02-04 10:06:55 +01:00
Eric Stollnitz e5919f1821 Fixed #359: Support compiling to WebAssembly using Emscripten 2022-02-04 10:06:40 +01:00
Sven Woop 86b63f60c4 fixing more places where spaces in filenames made potential issues 2022-02-02 15:34:00 +01:00
ashpil 17fb1eff7e fix build error if built in directory with spaces 2022-02-02 11:06:25 +01:00
Sven Woop 8062495fd0 no longer building MSI and PKG installers for release 2022-02-02 08:33:20 +01:00
Sven Woop 9718c78e3f removing scripts/release scripts, these are not used 2022-02-02 08:16:36 +01:00
Florian Reibold 6f9ade5e17 changelog 2022-01-27 16:18:25 +01:00
Florian Reibold 93b380a382 bugfix for linear quaternion interpolation fallback. 2022-01-27 16:17:30 +01:00
Florian Reibold 8c1fe91fe9 bugfix in emulated ray packet intersection when EMBREE_RAY_PACKETS is
turned off.
2022-01-27 16:17:19 +01:00
Sven Woop 22683d839f fixing embree-config.cmake for static compilation when multi-ISA enabled 2022-01-24 08:17:35 +01:00
Florian Reibold f9db0f0215 split configure, test, and build stage in CI 2022-01-17 21:03:57 +01:00
Sven Woop 5631ecbb45 disabling valgrind CI test as it runs too slow, clang address sanitizer testing should be sufficient 2022-01-05 15:29:44 +01:00
Sven Woop 728fda94d1 Fixed crash caused by disabling a geometry and then detaching it from the scene. 2022-01-03 09:40:31 +01:00
Sven Woop 75e9cbc7a3 find_package no longer requires Embree version 2021-12-15 09:19:53 +01:00
Sven Woop 9659023606 using proper download path for TBB 2021-12-15 08:25:44 +01:00
Sven Woop 47ed47e08d using proper Intel® ISPC naming in documentation 2021-12-15 07:31:29 +01:00
Sven Woop f2999fff2f fixed wrong assertion in presplitter 2021-12-14 09:20:57 +01:00
Florian Reibold 889a960c9c reenable ray stats (e.g. MRays/s) for legacy benchmark mode 2021-12-07 16:44:49 +01:00
Florian Reibold e26774eb6c fix bug with empty child at beginning of child list 2021-11-30 20:57:50 +01:00
Florian Reibold 5898bca241 fix command line ordering issue for benchmark 2021-11-30 11:35:57 +01:00
Sven Woop 0624f12b6a setting version to v3.13.3-alpha.0 2021-11-29 13:55:27 +01:00
Sven Woop eb3b65cdda Invalid multi segment motion blurred normal oriented curves are properly excluded from BVH build. 2021-11-29 13:55:16 +01:00
Sven Woop fec998368c fixed typo in documentation 2021-11-29 12:11:08 +01:00
Yixing Lao ef588ffd3a Fix compiler check for oneAPI C++ compiler 2021-11-25 07:43:40 +00:00
Rémi VerscheldeandJFonS c557fee36e Don't override NOMINMAX and likely if already defined
Co-authored-by: JFonS <joan.fonssanchez@gmail.com>
2021-11-25 07:43:39 +00:00
Rémi VerscheldeandPedro J. Estébanez 83f256c309 sys: Fixes for MinGW support
Tested successfully in Godot to compile with MinGW-GCC and MinGW-Clang
for Windows.

This doesn't include needed changes to CMakeLists.txt to support using
a MinGW-GCC based toolchain to compile Embree with CMake.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2021-11-25 07:43:39 +00:00
Rémi VerscheldeandJFonS ef1e6e34ab thread: Add initial support for Android
This may not be all changes needed to actually use all of Embree on Android,
but it enables us to compile Embree for Android with NDK r21.4 for all
supported architectures: aarch64 armv7 x86_64 x86.

Co-authored-by: JFonS <joan.fonssanchez@gmail.com>
2021-11-25 07:43:39 +00:00
Rémi VerscheldeandJFonS 56e2aa6a30 Fix undefined reference to GridMesh with EMBREE_GEOMETRY_GRID off
This fixes the following issue when linking downstream code compiled with GCC's
`-fsanitize=undefined` with `EMBREE_GEOMETRY_GRID` undefined:

> error: undefined reference to 'typeinfo for embree::GridMesh'

Co-authored-by: JFonS <joan.fonssanchez@gmail.com>
2021-11-25 07:43:38 +00:00
Sven Woop a7df60765a allowing manual release builds 2021-11-19 10:11:12 +01:00
Sven Woop f5c5de4246 using default CMAKE_INSTALL_NAME_DIR 2021-11-16 07:38:01 +01:00
Sven Woop 440d47de74 fixed bugs with btc/bts/btr instrinsic implementation on ARM platform 2021-11-15 07:39:07 +01:00
Stefan Werner ac7514eb53 Fixed operator precedence in sin() and cos()
Extra parantheses make operator precendence clearer, code taken from
ispc was bevahing incorrectly since Embree's SIMD types don't have ||.
2021-11-10 11:03:55 +01:00
Sven Woop edd9cf1b37 fixed ISPC compile warnings 2021-11-02 09:08:34 +01:00
Sven Woop d6f8b1d872 fixed compile warning 2021-11-02 09:04:43 +01:00
Sven Woop ecbe105d2b more testing with ISPC 1.16.1 2021-11-02 08:37:22 +01:00
Sven Woop d7157470e0 regenerated documentation 2021-10-26 18:31:08 +02:00
Sven Woop e6b2880958 setting version to v3.13.2 2021-10-26 17:54:02 +02:00
Sven Woop 094e9506e7 updates to changelog 2021-10-26 17:53:44 +02:00
Sven Woop df72fbaf21 bugfix to pre-splitter 2021-10-21 11:26:15 +02:00
Sven Woop 8a9417b563 bugfix to darray_t implementation 2021-10-21 11:21:58 +02:00
Sven Woop 658ca31625 Fixed more places where less accurate Newton raphson iteration for rcp was used 2021-10-18 08:06:55 +02:00
Solomon Boulos 2a75ecaa03 Fix Newton-Raphson iteration for rcp() w/ AVX2.
The current rcp() code uses rcp_ps which is only somewhat
accurate. The Newton-Raphson iteration that Embree uses
to correct for it transforms the basic relation:

 2 * x - a * x * x

into:

 x * (2 - a * x)

But it's much more numerically accurate [1] to calculate:

 h_n = 1 - a * x (nearly 0, since a and x are inverses)
 res = x + x * h_n

This correction makes the various origin * rdir code in
the BVH intersectors (which are only enabled with AVX2+)
pass our tests, even on Intel boxes (AMD boxes were passing
because AMD's rcp approximation has generally higher accuracy).

[1] http://numbers.computation.free.fr/Constants/Algorithms/inverse.html
2021-10-18 07:20:53 +02:00
Sven Woop 3a14d8d78c introduced rtcGetGeometryThreadSafe function 2021-10-13 06:37:09 +00:00
Sven Woop 7b06d64b48 properly handling number of allowed splits during binning 2021-10-06 12:19:10 +02:00
Sven Woop e5d7481f12 fixed some issues reported by memory checker 2021-09-29 05:19:04 +00:00
Sven Woop 052b5a0347 fixed potential corner case in spatial split position fix 2021-09-27 14:27:02 +02:00
Sven Woop e5065f4069 removed old spatial binning code 2021-09-27 08:49:01 +02:00
Sven Woop 0b52511cf0 Avoiding spatial split positions that are out of geometry bounds. 2021-09-27 08:48:23 +02:00
Trevor Thomson b0e783926e Merge branch 'release-3.13.1' into 'devel'
Add SECURITY.md file

See merge request renderkit/embree!929
2021-08-13 19:38:36 +00:00
Krzysztof Raszkowski 12b9939343 Add SECURITY.md file 2021-08-13 03:35:12 +02:00
Trevor Thomson 50173c89ef Merge branch 'release-3.13.1' into 'devel'
Release 3.13.1

See merge request renderkit/embree!928
2021-08-12 15:36:58 +00:00
Trevor Thomson 73358d12c3 Roll back dependency version upgrades in ospray test 2021-08-11 13:13:46 -04:00
Trevor Thomson 3eab1d9434 Rebuilt documentation 2021-08-10 17:39:17 -04:00
Trevor Thomson 8a7eee7d5e Upgrade to tbb 2021.3.0 and ispc 1.16.1 for releases (and latest dependency versions for ospray test) 2021-08-10 17:17:06 -04:00
Trevor Thomson 66e3e9c650 Set CMake Project version to 3.13.1 2021-08-10 16:41:55 -04:00
Will Usher bc11395a5a ISPC+ARM support 2021-08-10 16:41:36 -04:00
Will Usher 2261c03a59 ISPC+ARM support 2021-06-16 13:20:36 -06:00
Johannes Meng 1275f35bd9 unique_ptr constructor is explicit. 2021-06-11 17:11:00 +02:00
Sven Woop e9806e22a7 simplified instance animation code 2021-06-08 08:49:51 +02:00
Sven Woop aae839ed81 keeping current transform up to data during animation 2021-06-08 08:36:46 +02:00
Sven Woop d67025cea5 moving transform animation code to scene graph 2021-06-08 08:36:40 +02:00
Sven Woop b804b76163 fixed memory leak in hair_geometry tutorial 2021-06-02 12:06:51 +02:00
Sven Woop b38f3481d4 introducing commit function for each ISPC object 2021-06-02 11:11:07 +02:00
Sven Woop 7329a23069 constructing Embree object inside ISPC struct constructor 2021-06-02 10:42:29 +02:00
Sven Woop 6a73996b5e using visited flag during ISPCScene conversion 2021-06-02 10:23:03 +02:00
Sven Woop cb0236f812 assignShadersFunc should get executed after rtcCommitGeometry 2021-06-02 09:26:28 +02:00
Sven Woop 572ff944c1 fixed Win32 struct alignment issue 2021-05-25 11:27:59 +02:00
Sven Woop 62767c5c80 supporting camera motion when using non-animated camera from XML file 2021-05-21 11:10:25 +02:00
Sven Woop 5eed44c1b1 linear interpolation for instance and light animation 2021-05-21 10:45:00 +02:00
Sven Woop 2dd7758d0e added support for light animation 2021-05-21 10:30:52 +02:00
Sven Woop ec93f70024 added animation support to viewer 2021-05-21 09:22:25 +02:00
Sven Woop 9d8efd5cec added animated light support to scene graph 2021-05-21 08:33:48 +02:00
Sven Woop dcfbbf5e5f making base scene graph light structs non-virtual, and putting all virtual functions to SceneGraph::LightNode 2021-05-21 08:24:30 +02:00
Sven Woop 9f7729e3dc added time_range to camera animation 2021-05-21 08:24:22 +02:00
Sven Woop 56ab848027 linear blending between camera animation time stamps 2021-05-21 08:24:12 +02:00
Sven Woop 95c7bcdabc introduced SceneGraph::PerspectiveCameraData struct 2021-05-20 12:17:22 +02:00
Sven Woop 9f5d489a0c added first version of camera animation 2021-05-20 12:17:19 +02:00
Sven Woop cf8705f302 extended XML writer to support text format 2021-05-20 08:16:13 +02:00
Sven Woop 23c25dfbb3 fix for Win32 compilation 2021-05-14 06:55:09 +02:00
Sven Woop 85c036f59b Merge commit '4ab9f7ef7fe15dab64d54ba24ea559f6c79e16d9' into swoop/devel 2021-05-14 06:48:05 +02:00
Sven Woop 4ab9f7ef7f fixed memory leak, scene graph is now destroying referenced ISPC objects 2021-05-12 11:51:12 +02:00
Sven Woop b7d53ddd1b setting policy CMP0072 to NEW 2021-05-11 10:48:34 +02:00
Sven Woop 101b96d68b regenerated tutorials 2021-05-11 07:53:52 +02:00
Sven Woop fc337190fc fixed wrong usage of ray.instID instead of dg.instID in pathtracer 2021-05-11 07:45:00 +02:00
Sven Woop d660c0e0cf executing all command line scene graph operations after device construction 2021-05-10 11:39:05 +02:00
Sven Woop d78ea07be2 added multi level instancing support to pathtracer 2021-05-10 09:32:03 +00:00
Sven Woop 2656b18030 geometries that are referenced multiple times by scene graph are just created once 2021-05-10 09:32:03 +00:00
Sven Woop 98930d30d6 removed scene member of ISPCGeometry structure 2021-05-10 09:32:03 +00:00
Sven Woop 92ac88b756 checking if scene instancing depth is smaller than configured maximal instancing depth 2021-05-10 09:32:03 +00:00
Sven Woop f59311e21c Cleaned up instance handling. ISPCScene matches structure of canonical scenegraph now. 2021-05-10 09:32:02 +00:00
Sven Woop a61cc22a4a cleanups to scene_device.cpp 2021-05-10 09:32:02 +00:00
Sven Woop d7680b95cc added support for multi_level instancing mode to scene conversion and viewer 2021-05-10 09:32:02 +00:00
Carsten Benthin 7c53133eb2 removed alpha.0 from version note in cmake 2021-05-08 14:26:07 +02:00
Carsten Benthin 0d656ba62d updated doc 2021-05-06 16:04:09 +02:00
Florian Reibold 9baf008559 update Embree version and changelog.md 2021-05-04 20:42:37 +02:00
Florian Reibold 53168837b1 update ispc 1.13 to 1.15 and TBB 2021.1.1 to 2021.2.0 in release tests 2021-05-03 20:14:29 +02:00
Florian Reibold 83fdffd144 try to copy TBB dll only if it exists 2021-05-03 14:16:49 +02:00
Florian Reibold f7779efc84 also update ospray in release test 2021-05-03 14:16:49 +02:00
Florian Reibold 644ddbe612 copy tbb dlls into executable folder. 2021-04-30 20:40:08 +02:00
Florian Reibold 74ee9a95f2 update dependency versions 2021-04-23 15:46:44 +02:00
Sven Woop 0498b6d3a3 performance optimization for ARM traversal 2021-04-19 12:52:18 +02:00
Sven Woop 826ed1bb24 using proper floor/ceil/trunc implementation for ARM 2021-04-19 12:52:18 +02:00
Sven Woop 1aae87d1bd more ARM related updates to docu 2021-04-19 12:52:18 +02:00
Sven Woop 79f11d4204 cleanups to ARM support in main CMakeLists.txt 2021-04-19 12:52:18 +02:00
Sven Woop 13b77a8f7b added ARM to changelog 2021-04-19 12:52:18 +02:00
visuser 4a5229b285 fixed accuracy of rsqrt when using NEON 2021-04-19 12:52:18 +02:00
Sven Woop 417c1bad46 using fast NEON math when __aarch64__ is defined 2021-04-19 12:52:18 +02:00
Sven Woop 907b33f057 using NEON fmadd 2021-04-19 12:52:18 +02:00
Sven Woop 6678c56256 using fast min/max for NEON 2021-04-19 12:52:18 +02:00
Sven Woop 101dddb984 added cornell_box_instanced model 2021-04-19 12:52:18 +02:00
Sven Woop 875943e936 CI bugfix for ARM 2021-04-19 12:52:18 +02:00
Sven Woop e22b4cbe3e Arm -> ARM 2021-04-19 12:52:18 +02:00
Sven Woop f72129a315 supporting EMBREE_MAX_ISA=DEFAULT/NONE in ARM mode 2021-04-19 12:52:18 +02:00
Sven Woop 0044f9681f disabling setAffinity on macOS with M1, seems not supported 2021-04-19 12:52:18 +02:00
Sven Woop a0177536dc testing ARM code in CI 2021-04-19 12:52:18 +02:00
Brecht Van Lommel c5678be140 Arm: support Arm CPUs by emulating SSE2 instructions with Neon 2021-04-19 12:52:18 +02:00
Brecht Van Lommel 4f9daac367 Arm: add __X86_ASM__ define to identify processors that support X86 asm
And disable or add processor independent alternatives for instrinsics.
2021-04-19 12:52:18 +02:00
Brecht Van Lommel 1c1fcde25a Arm: add __64BIT__ define to identify 64 bit processors of any vendor 2021-04-19 12:52:18 +02:00
Brecht Van Lommel 2bbdbb3a2b Arm: add sse2neon library
From https://github.com/DLTcollab/sse2neon.git, revision 09fa961f312dd9.
2021-04-19 12:52:18 +02:00
Sven Woop 46d043d3f8 removed glfw3.h include from voronoi tutorial 2021-04-19 08:39:10 +02:00
Sven Woop b1c68f6c99 removed unused test function from SIMD wrappers 2021-04-16 11:51:22 +02:00
Sven Woop 5c2acf455a removed xchg function from SIMD wrappers 2021-04-16 11:47:59 +02:00
Sven Woop e8cac9972c removed KNL specific code 2021-04-16 11:44:40 +02:00
Sven Woop ce208595e2 removed extract64bit function which should not be inside vint vector class 2021-04-16 11:37:09 +02:00
Sven Woop 21dd2e1ce3 removed broadcast64bit function which should not be inside vint vector class 2021-04-16 11:35:52 +02:00
Sven Woop 7cc214be52 removed compact64bit which should not be inside vint vector class 2021-04-16 11:33:46 +02:00
Sven Woop bf969448a4 removed some broadcast, store_uchar, notand 2021-04-16 11:28:58 +02:00
Sven Woop 8f42dd73a0 removed some unused compact/assign/broadcast2 2021-04-16 11:20:05 +02:00
Sven Woop a954b4b8d4 removed unused code from vfloat16_avx512.h 2021-04-16 11:13:29 +02:00
Sven Woop 2f0a3f1379 removed unused broadcast4f/8f functions 2021-04-16 11:13:20 +02:00
Sven Woop d783b6461c started SIMD wrapper cleanups, cleaning up unused functions in vfloat16_avx512.h 2021-04-16 10:42:52 +02:00
Florian Reibold fc654a4d48 fix typo in doc 2021-04-12 19:13:31 +02:00
Sven Woop 9ecef1fdcb switched more portableg /usr/bin/env python3 in python scripts 2021-04-08 10:02:28 +02:00
Sven Woop 0835297b3c updated python to python3 in scripts 2021-04-07 16:23:07 +02:00
Sven Woop be9767e9ad added SSE2NEON to third-party-programs.txt 2021-03-31 06:55:25 +02:00
Sven Woop aadbfca44e removed support for .embree3 config files 2021-03-25 06:26:52 +01:00
Carsten Benthin 79cbb5aa55 added lossy grids paper to doc 2021-03-23 14:55:29 +01:00
Sven Woop d4c9045b96 Revert "disable all but benchmark in CI"
This reverts commit 5b81f7eb64.
2021-03-17 06:54:49 +01:00
Sean C McDuffee e2e5ed2c86 remove old nightlies 2021-03-15 18:29:56 -04:00
Florian Reibold 79e7b23152 insert suites and subsuites 2021-03-15 20:43:57 +01:00
Florian Reibold 3abb0141f2 don't find system wide tbb install when EMBREE_TBB_ROOT is set 2021-03-15 13:48:49 +01:00
Florian Reibold a2e5892fce take Embree regression benchmarks online 2021-03-11 11:16:47 +01:00
Florian Reibold 972931fcbb test running benchmarks automatically when scheduled but otherwise manually 2021-03-11 11:06:00 +01:00
Florian Reibold 8c538a7923 back to oneTBB 2021.1 2021-03-11 11:06:00 +01:00
Florian Reibold 97eeff1d41 test tbb 2020.3 2021-03-11 11:06:00 +01:00
Florian Reibold 992d65e1ce dummy change 2021-03-11 11:06:00 +01:00
Florian Reibold c08336ce9c reduce benchmark load 2021-03-11 11:06:00 +01:00
Florian Reibold d6e52e1279 Update .gitlab-ci.yml 2021-03-11 11:06:00 +01:00
Florian Reibold 76ead748f4 Update .gitlab-ci.yml 2021-03-11 11:06:00 +01:00
Florian Reibold 944e4c21dd Update .gitlab-ci.yml 2021-03-11 11:06:00 +01:00
Florian Reibold 1b52f4ba46 Update .gitlab-ci.yml 2021-03-11 11:06:00 +01:00
Florian Reibold 22c8e26a77 Update .gitlab-ci.yml 2021-03-11 11:06:00 +01:00
Florian Reibold 4a42629b7f dummy change 2 2021-03-11 11:06:00 +01:00
Florian Reibold 9e33da1124 dummy change 2021-03-11 11:06:00 +01:00
Florian Reibold 6362244c4f run all the benchmarks 2021-03-11 11:06:00 +01:00
Florian Reibold 039c1c9875 increase benchmark repetitions 2021-03-11 11:06:00 +01:00
Florian Reibold f04b36bcd6 benchmark other scenes again 2021-03-11 11:06:00 +01:00
Florian Reibold ceaa6aee2f reduce test intensity to 0 2021-03-11 11:06:00 +01:00
Florian Reibold b848646a58 only run barbarian_msmblur_instancing 2021-03-11 11:06:00 +01:00
Florian Reibold 6268a487d0 dummy change 2021-03-11 11:06:00 +01:00
Florian Reibold 0e40f36d9f test new benchmark setup 2021-03-11 11:06:00 +01:00
Florian Reibold 5a7875a756 dummy change 2021-03-11 11:06:00 +01:00
Florian Reibold 0893d00935 numactl fix 2021-03-11 11:05:59 +01:00
Florian Reibold 5517898780 less benchmarks (faster testing) 2021-03-11 11:05:59 +01:00
Florian Reibold 0549d44ef8 test benchmark repetitions 2021-03-11 11:05:59 +01:00
Florian Reibold 5b81f7eb64 disable all but benchmark in CI 2021-03-11 11:05:59 +01:00
Sean McDuffee 9bf219e0a4 Resolve "get ICC on new mac-mini's working" 2021-03-02 20:42:42 +00:00
Florian Reibold cf911b30df update changelog 2021-03-02 20:16:37 +01:00
Florian Reibold 2f59f188c5 port all algorithm tests to Catch 2021-03-02 18:01:04 +01:00
Florian Reibold d4fe2ddf6c use provided TBBConfig.cmake for onetbb 2021-03-02 17:52:55 +01:00
Florian Reibold af6ba7bae5 convert algorithms from object to static lib 2021-03-02 17:52:55 +01:00
Florian Reibold 491a49cb72 add uninstall target only if not already defined 2021-03-02 17:52:55 +01:00
Florian Reibold 52333100c0 fix model dir copy for add_subdirectory build 2021-03-02 17:52:55 +01:00
Sean C McDuffee 31925a61fc update to latest icc and tbb 2021-02-27 15:17:54 -05:00
Sean C McDuffee 37a0dd55e4 update changelog for
http://vis-gitlab.an.intel.com/renderkit/embree/-/issues/879
2021-02-25 12:05:58 -05:00
Sean McDuffee a85c52ca77 check for non-manifoldness when checking border
status of an edge
2021-02-25 16:31:39 +00:00
Florian Reibold dbc656f1ad refactor benchmarking system
* use google benchmark (optional)
* integrate to benchmark CI (WIP)
2021-02-16 16:43:11 +01:00
Robert Cohn 7eac211d6c fix some restructuredText issues 2021-02-08 10:40:25 -05:00
Donna Nemshick 61475f2772 Update spec.md 2021-02-05 17:14:22 +00:00
Krzysztof Raszkowski 828a41474c ci: change interpretation of bdba verdict N/A as accepted 2021-02-05 05:58:47 +00:00
Sven Woop 8e85d62a89 increasing clamscan limits to properly scan macOS packages 2021-02-05 05:58:47 +00:00
Krzysztof Raszkowski 98b1f72b6c ci: add binary scans for release jobs 2021-02-05 05:58:47 +00:00
Sven Woop 30d11daacd signing only on some macs 2021-02-04 06:34:58 +01:00
Sven Woop 0179aed818 setting version to v3.12.3-alpha.0 2021-01-27 07:03:01 +01:00
Florian Reibold ae029e2ff8 updates for OSPRay integration test
* update to rkcommon
* updated versions of ISPC, VKL, OSPRay
* update to oneTBB-2021.1.1
2021-01-21 17:55:21 +01:00
Sven Woop 670df72a3a updated documentation 2021-01-21 09:59:02 +01:00
Sven Woop 461c10b22c setting version to v3.12.2 2021-01-21 09:52:12 +01:00
Sven Woop 949666d795 using TBB2021.1.1 for release build 2021-01-21 09:51:50 +01:00
Krzysztof Raszkowski a2b90bd746 ci: align kw check to requirements & add kw issues report 2021-01-21 07:58:15 +00:00
Sven Woop a1ebb79c24 fixed broken include in docu 2021-01-21 08:33:03 +01:00
Robert Cohn 7aff42d392 conversion to sphinx/rst for inclusion in oneapi-spec 2021-01-21 07:48:30 +01:00
Florian Reibold 8a5119963e upgrade oneTBB-2021.1-beta to oneTBB-2021.1.1 2021-01-20 23:34:02 +01:00
Florian Reibold efede4b37f fix findTBB for oneTBB and search for tbb12.dll on windows 2021-01-20 21:53:18 +01:00
Florian Reibold 213eb5214c install all files matching libtbb.*
cmake 3.15 can install files with all symlinks but for 3.1 glob is
probably the easiest workaround
2021-01-20 14:54:34 +01:00
Sven Woop 1885d90319 fix for Windows 2021-01-19 08:41:20 +01:00
Sven Woop 0c047fa0c9 installing cmake files to cmake/embree-version folder also in ZIP mode 2021-01-19 07:41:52 +01:00
Sven Woop ce6753cd0d removed benchmark.py script 2021-01-15 08:54:13 +01:00
Sven Woop 9f27037d84 simplifications to test.py script 2021-01-15 08:49:09 +01:00
Sven Woop 04a6c345cb added Bella Renderer to projects.md file 2021-01-15 08:19:22 +01:00
Sven Woop 2f6d9ec17c renamed verify to embree_verify 2021-01-15 07:28:13 +01:00
Sven Woop 0247adc528 changed further copyright year 2021-01-13 11:22:28 +01:00
Sven Woop 504bb38867 updated copyright headers to 2021 2021-01-13 10:44:58 +01:00
Krzysztof Raszkowski d8d4f887ab ci: change protex script to use env 2020-12-07 18:42:58 +01:00
cbenthin 5deeae445f correct bug fix in sse mode 2020-12-05 17:29:38 +01:00
cbenthin 6237e6788c test workaround for poential compiler bug 2020-12-05 17:02:21 +01:00
cbenthin f29293d687 quick test for windows 2020-12-04 18:24:14 +01:00
Carsten Benthin 62e0d47552 subgrid moeller trumberbore intersector only uses tri intersectors similar to pluecker 2020-12-04 17:46:29 +01:00
Carsten Benthin b57b7f4b1b more fixes 2020-12-04 16:37:57 +01:00
Carsten Benthin f37d2e0a56 consistency again between single and packet normals 2020-12-04 16:23:20 +01:00
Carsten Benthin 264d71553d cleanups 2020-12-04 15:11:10 +01:00
Carsten Benthin 7d73b3e5d5 packet based sub grid intersector based purely on tri intersector, also added occludedK for subgrids 2020-12-04 15:07:09 +01:00
Carsten Benthin 4fa7c8b0c7 removing explicit intersect1 from subgrid packet intersector 2020-12-04 11:30:29 +01:00
Carsten Benthin dfa1d5a7d9 single ray subgrid pluecker intersector now relies only on tri intersector 2020-12-04 10:47:52 +01:00
Carsten Benthin 13da35b584 modified pluecker tri intersector to be used for subgrid intersector 2020-12-04 08:51:56 +01:00
Carsten Benthin 40b1091bc5 fixing sse2 path 2020-12-03 18:51:16 +01:00
Carsten Benthin d46eddf3f3 making pluecker intersector interface more like moellertrumbore, e.g. calling epilog now outside the real intersect fct 2020-12-03 17:49:29 +01:00
Carsten Benthin baeef000dd making subgrid moeller and pluecker intersector more similar and simpler 2020-12-03 16:44:28 +01:00
Johannes Günther 384efb70fe Relax disclaimers 2020-12-03 09:38:09 +00:00
Sven Woop 623960e391 Added grid intersector changes to changelog. 2020-12-03 06:02:31 +01:00
cbenthin c89d3de092 more fixes in subgrid_pluecker intersector 2020-12-02 14:59:22 +01:00
cbenthin a29e363f12 Merge remote-tracking branch 'origin/devel' into issue_841 2020-12-01 22:06:09 +01:00
cbenthin 2e97c9f92c branch for fixing grid normal orientation error reported by framestore 2020-12-01 22:05:30 +01:00
Krzysztof Raszkowski 835f2b57a9 ci: increase severity in klocwork check script 2020-11-30 15:13:48 +01:00
Sven Woop 639fbf8cd9 using notarization login from gitlab environment variables 2020-11-27 11:08:16 +01:00
Sven Woop e5a2cea8d5 enabling klockwork test again 2020-11-17 09:36:31 +01:00
Sven Woop 3898940bcd fixed potential division by zero issues 2020-11-17 09:04:32 +01:00
Sven Woop 056a9e7dc4 fixed for klockwork update 2020-11-17 08:33:07 +01:00
Sven Woop 42d4f38e02 fixed some potential division by zero issues 2020-11-17 08:32:38 +01:00
Sven Woop 4581081641 error checking in condition implementation 2020-11-17 08:30:40 +01:00
Sven Woop 07c64ec106 fixed some missed renames of avx512skx to avx512 2020-11-17 06:44:23 +01:00
Sven Woop d35320860f splitted curve_intersector_virtual.cpp file to improve compile times 2020-11-17 06:03:06 +01:00
Sven Woop 96ba2bed57 disabled continuous-macosx-x64-Debug-ICC2020.1-ISPC1.14.1-SSE2-TBB2021.1-beta08 test, it runs very slow 2020-11-12 15:53:07 +01:00
Sven Woop f678d63ea7 Merge remote-tracking branch 'gitlab/devel' into swoop/removing_knl_optimizations 2020-11-12 14:31:35 +01:00
Sven Woop cbfbc969fb enabled klocwork test again, but allowing failure 2020-11-12 14:10:08 +01:00
Sven Woop 0731fd0338 Renamed AVX512SKX to official name AVX512. Old CMake setting AVX512SKX works still for compatibility. 2020-11-12 14:08:06 +01:00
Sven Woop 9ec167bf04 removed KNL optimization to calculate SIMD4/8 also with SIMD16 2020-11-12 13:27:18 +01:00
Sven Woop 0a4d8ec5f1 removed AVX512KNL 2020-11-12 11:47:58 +01:00
Sven Woop c68f339e1e removed KNL optimizations 2020-11-12 11:29:31 +01:00
Sven Woop e109203224 disabled klockwork scan temporarily 2020-11-12 11:12:26 +01:00
Sven Woop c0b65981c0 consistently drawing with same camera in view and write to disk mode, y=0 is on top of image always 2020-11-12 11:05:25 +01:00
Sven Woop 85b320a34f avoiding to use _mm_extract_ps intrinsic to extract float, as that intrinsic returns an integer 2020-11-10 06:43:31 +01:00
Lyuma 5ce93dacc2 Fix typos in #if and nonstandard implicit cast.
Collectively, these two fixes allow embree to be cross compiled using llvm-mingw on Linux:
Note that in addition to fixing the typo with _MSC_VER, the defined check must be added to avoid undefined symbols acting as 0.
2020-11-10 06:34:27 +01:00
Sven Woop 09c1969e03 fixed oneTBB 2021 version detection bug 2020-11-10 06:28:48 +01:00
Sven Woop 87494d0978 updates to triangle intersectors, more general mapUV 2020-11-04 11:10:55 +01:00
Sven Woop eae2870a45 using primRefGen for Grids 2020-11-04 09:22:01 +01:00
Sven Woop be4715e621 fix in filename.h 2020-11-04 09:21:47 +01:00
Sven Woop 57ca1510da Merge remote-tracking branch 'origin/devel' into swoop/introducing_tutorial_data_for_interpolate_tutorial 2020-11-02 11:21:57 +01:00
Sven Woop 19c8dc2d20 introduced TutorialData struct in interpolation tutorial 2020-11-02 11:03:02 +01:00
Sven Woop f8ad5e55cc workaround for gcc compile issue 2020-11-02 10:25:27 +01:00
Sven Woop 88cd78e4bd moving rtcInterpolate implementation into headers 2020-11-02 09:44:29 +01:00
Sven Woop d50cbce989 fixed further ICC compile issue 2020-10-29 09:42:08 +01:00
Sven Woop 654f5f023d fixed ICC compile issue 2020-10-29 09:42:00 +01:00
Sven Woop 9304aff7bb fixed wrong instance_id_stack::copy usage 2020-10-29 08:57:59 +01:00
Sven Woop 857473ac60 fixed compile warning 2020-10-29 08:53:20 +01:00
Sven Woop 0d9493efc8 introducing UVMapper to moeller trumbore intersector 2020-10-28 09:16:23 +00:00
Sven Woop 73a9e77d97 cleanups to instance_stack.h 2020-10-28 09:16:23 +00:00
Sven Woop 9274139733 compile fixes for multi instancing 2020-10-28 09:16:23 +00:00
Sven Woop a1a7626226 supporting vfloat<1> -> float instantiation etc. 2020-10-28 09:16:22 +00:00
Sven Woop 3b15dd2379 running CI only on embree runners 2020-10-27 06:00:19 +01:00
Johannes Günther 8b7a02d882 Updates to readme.pdf (Intel style) 2020-10-19 15:48:01 +02:00
Sven Woop 48a6471cdf running klockwork scan also in nightly testing 2020-10-14 09:28:06 +02:00
Sven Woop 69bd4c272f regenerated documentation 2020-10-13 07:02:23 +02:00
Sven Woop 94f69c5ca1 workaround to respect alignment of tbb:task_group 2020-10-12 08:17:25 +02:00
Sven Woop 14b7e53e6c removed some dependencies from python scripts 2020-10-08 06:39:39 +02:00
Sven Woop 329d234d31 fixed typo of RTC_DEVICE_PROPERTY_JOIN_COMMIT_SUPPORTED in docu 2020-10-08 06:24:59 +02:00
Sven Woop 08c2d4de16 fixed typo in test.py script 2020-10-06 10:29:37 +02:00
Sven Woop 01b117b05d doing some CI testing with enforced frequency level simd128 and simd256 2020-10-06 10:27:51 +02:00
Sven Woop a35cbd1c36 updated docu of frequency_level 2020-10-06 10:04:54 +02:00
Sven Woop cb6b0a4aba using enum classes for CPU model 2020-10-06 09:57:22 +02:00
Sven Woop d33283f419 changed default frequency level for Skylake, Kaby Lake, Comet Lake, and Tiger Lake to SIMD128 for higher clock frequencies 2020-10-06 09:48:40 +02:00
Sven Woop 47066e6ea5 added support to detect Tiger Lake CPUs 2020-10-06 09:35:35 +02:00
Sven Woop 0d0a04ef51 updates to map files 2020-10-06 09:35:19 +02:00
Sven Woop a05a8143d6 docu mentions all ISPC versions we test 2020-10-06 09:18:06 +02:00
Sven Woop 02cd963f6f better matching of user defined namespace in map file 2020-10-05 08:25:23 +02:00
Sven Woop e9faadf032 Revert "removed export maps, these are no longer required"
This reverts commit c181c51991.
2020-10-05 08:22:26 +02:00
Sven Woop c181c51991 removed export maps, these are no longer required 2020-10-05 07:33:43 +02:00
Sven Woop 68cd621791 renamed RTC_NAMESPACE_OPEN -> RTC_NAMESPACE_USE 2020-10-02 06:59:20 +02:00
Sven Woop 3979d82992 updated documentation 2020-10-01 11:29:26 +02:00
Sven Woop 8963ee3304 setting default frequency level for skylake server CPUs to simd128 2020-10-01 11:19:16 +02:00
Sven Woop 7df9121597 setting version to v3.12.1 2020-10-01 11:18:54 +02:00
Sven Woop c6eebe1e5e introducing TutorialData for user geometry tutorial. 2020-09-30 13:15:59 +02:00
CI-env-update dc490e8e03 Introduce TutorialData to grid geometry tutorial. 2020-09-29 11:14:57 +02:00
Sven Woop 1a33a89110 introducing TutorialData object for instancing_geometry tutorial 2020-09-29 09:55:29 +02:00
Sven Woop 7ae8045103 fixing path to NAS on macOS 2020-09-29 07:12:03 +02:00
Sven Woop 5bf6edf578 fixing error message for static build of multi-ISA Embree under MacOSX to Clang >= 9.0.0 2020-09-29 07:11:41 +02:00
Sven Woop b46d1971fb setting version to v3.12.1-alpha.0 2020-09-24 07:51:22 +02:00
Florian Reibold 0b0daf57f8 add oneTBB 2021.1-beta08 and ispc 14.1 tests. 2020-09-22 23:51:47 +02:00
Florian Reibold 8f5e318762 fix PATH for oneTBB 2021.1-beta08 on windows. 2020-09-22 23:51:47 +02:00
Florian Reibold 6311a90ee3 silently ignore if setaffinity fails. 2020-09-22 23:15:37 +02:00
Sven Woop b62a7b6e53 Tutorials do not link against libjpeg and libpng by default if these libraries are installed. This way our release builds do not risk to depend on these unimportant libraries. 2020-09-22 20:00:02 +02:00
Sven Woop b89537429f under Windows waiting for user input when some tutorials got opened in a new window 2020-09-22 07:09:23 +02:00
Sven Woop 7a36f2908b regenerated documentation 2020-09-21 08:41:16 +02:00
Sven Woop 3eaf7ac7af updated docu to describe the GCC version where AVX512 is supported 2020-09-21 07:59:03 +02:00
Sven Woop 9ee15a7044 some comment fixes to selected ISA check 2020-09-21 07:30:07 +02:00
Sven Woop c7e824b057 updates to changelog 2020-09-21 07:22:59 +02:00
Sven Woop 475b49da4a improvements to changelog 2020-09-21 07:15:12 +02:00
Sven Woop 012b200017 formatting in parallel_any_of.h 2020-09-21 07:08:01 +02:00
Sven Woop fbc0f1ce65 setting version to v3.12.0 2020-09-21 07:05:50 +02:00
Sven Woop 61fc84f829 moving changelog changes to proper place 2020-09-21 07:05:06 +02:00
Sven Woop 69481ba67a setting version to v3.12.0-alpha.0 2020-09-18 11:12:11 +02:00
Sven Woop 3d4ceea0b2 increased timeout for verify_memcheck CI test 2020-09-18 06:30:44 +00:00
Sven Woop 2246d5277f cleanups 2020-09-18 06:30:44 +00:00
Sven Woop 06dae285ec optimizing gatheri in pointi.h, for mblur time_range is identical for all primitives in a leaf 2020-09-18 06:30:44 +00:00
Sven Woop 51568d1989 further bugfix in time range handling for points 2020-09-18 06:30:44 +00:00
Sven Woop 082f299f27 fixed time segment handling for point geometries 2020-09-18 06:30:44 +00:00
Sven Woop d3b1f8a715 properly handling time range for points in scene graph 2020-09-18 06:30:44 +00:00
Florian Reibold c2025fa1dc update changelog 2020-09-17 17:31:42 +02:00
Florian Reibold 73cb01872d tbb::task::self() is removed in TBB 2021 beta 08 2020-09-17 17:29:19 +02:00
Florian Reibold dabd228613 add unit test for parallel_any_of algorithm. 2020-09-17 17:29:19 +02:00
Florian Reibold c3b686664d look for tbb/version.h instead of stddef.h for newer tbb versions. 2020-09-17 17:29:19 +02:00
Florian Reibold a217074cd7 update changelog 2020-09-17 15:06:43 +02:00
Florian Reibold 70e27179ff set EMBREE_TUTORIALS before include(package) 2020-09-15 17:14:01 +02:00
Sven Woop 979c2d8ecb removing NaN usage from motion blur nodes 2020-09-15 07:00:17 +02:00
Sven Woop b1abd5cd0f added to documentation that user geometries with lower>upper are ignored 2020-09-11 07:20:19 +02:00
Sven Woop 9f62336da5 fixed header formatting of rtcPointQuery in documentation 2020-09-11 07:10:39 +02:00
Sven Woop ab909013fc fixed name of install directory under Windows in documentation 2020-09-11 07:08:13 +02:00
Sven Woop 5089ee7708 fixed broken links in Embree documentation 2020-09-11 07:05:35 +02:00
Sven Woop 610dbef48c updates to changelog 2020-09-11 06:55:59 +02:00
cbenthin 15d55deb23 added u,v clamping to quad/subgrid intersector to prevent neagtive u,v 2020-09-07 12:21:22 +02:00
cbenthin 93aa94bc7b revert changes for hybrid intersector 2020-09-03 11:56:23 +02:00
cbenthin ff70fbe665 after parsing cmd line, all selected ISAs are now checked for HW support 2020-09-03 11:53:05 +02:00
cbenthin d351ebf074 setting version to 3.12, unifying changelog 2020-08-27 11:32:03 +02:00
Sean C McDuffee 55832fe60a Merge branch 'devel' into scm/714-support-morton-builder-and-refitting-for-instances 2020-08-21 14:00:51 -04:00
Sean C McDuffee 7d0ddaad44 Merge branch 'devel' into scm/727-add-embree_backface_culling_curves-cmake-option 2020-08-21 12:53:47 -04:00
Sean C McDuffee 2a5df9e8ac Merge branch 'devel' into 732-remove-avx512-ifdefs-from-cone-intersector 2020-08-21 12:04:48 -04:00
Carsten Benthin 5d55bfca80 __forceinline to static __forceinline to make MSVC in DEBUG differentiate between AVX and AVX2 compiled versions 2020-08-19 11:52:05 +02:00
cbenthin 5bf7c3595b workaround for 8-wide maxi/mini on non-avx2 platforms, seems to workaround MSVC issue 2020-08-17 21:37:59 +02:00
Sean C McDuffee 46f8b9e32d remove unecessary ifdefs 2020-08-14 16:41:17 -04:00
Sean C McDuffee 2cad0edc7e minor update 2020-08-14 15:27:02 -04:00
Sean C McDuffee 1b9cf10740 add EMBREE_BACKFACE_CULLING_CURVES option 2020-08-14 15:25:24 -04:00
Sean C McDuffee 10dbf82a6d update changelogs 2020-08-14 14:12:03 -04:00
Sean C McDuffee baf8870640 add two level declarations 2020-08-14 12:31:48 -04:00
Sean C McDuffee 7ffe6b59cc WIP 2 level instance builds 2020-08-13 16:40:23 -04:00
cbenthin 36a0705b17 clamp input u,v for grid interpolation 2020-08-04 14:31:49 +02:00
cbenthin 147da10f00 adding isvalid_non_empty() to bbox to check for finite validness and non-emptiness at the same time, used now by accelset.bounds() 2020-08-03 15:27:53 +02:00
Sean C McDuffee f1b5b55c9c Merge branch 'devel' into scm/722-cone-geometry 2020-07-21 09:18:37 -04:00
Sean C McDuffee ea5c985a31 move round curve over to new leaf type 2020-07-20 14:39:41 -04:00
Sean C McDuffee 89130e60fe add left/right connection info to leaf nodes 2020-07-20 14:12:21 -04:00
Sean C McDuffee a7c1759354 update to short copywrite 2020-07-15 16:04:28 -04:00
Sean C McDuffee 7e6a13f12e optimizations 2020-07-15 16:01:20 -04:00
Sean C McDuffee 338d2a6837 more changelog
models hash
2020-07-14 13:24:03 -04:00
Sean C McDuffee 24dfe5131f update curve tut and image
update changelog and docs
2020-07-14 13:04:15 -04:00
Sean C McDuffee 0227588aee Merge branch 'devel' into scm/722-cone-geometry 2020-07-14 12:52:59 -04:00
Sean C McDuffee 37c9a0c0b2 add cone curve to curve_geometry test 2020-07-14 12:51:50 -04:00
Sean C McDuffee 01f2ac269a patch up cone disk csg 2020-07-14 12:41:31 -04:00
Florian Reibold db1d8cd94d add bugfix to changelog 2020-07-14 15:28:43 +02:00
Sean C McDuffee 292a0643b5 modify flagging for cone caps 2020-07-13 20:45:24 -04:00
Florian Reibold c2323884b3 fix geometry disable bug
disabling of geometry was buggy since isGeometryModified always returned
false in that case and a bvh rebuild was not issued.

the test in verify now catches this issue.
2020-07-13 18:04:34 +02:00
Sean C McDuffee 2c6dd4841f add intersectors for 8 wide 2020-07-12 17:36:09 -04:00
Sean C McDuffee c27e845515 turn stream on 2020-07-12 17:35:55 -04:00
Sean C McDuffee 090da16ccd put back ray org move 2020-07-12 17:35:41 -04:00
Sean C McDuffee a9db3e26c6 reverting my gitignore clang.cmake 2020-07-11 18:59:52 -04:00
Sean C McDuffee 426fe69ee6 cone body intersector 2020-07-11 18:36:55 -04:00
Sean C McDuffee d7440cb45b more boilerplate
xml loader
2020-07-11 18:36:42 -04:00
Sean C McDuffee b00870f214 boilerplate for cone intersector 2020-07-10 16:01:18 -04:00
Sean C McDuffee bf605799b3 rename LinearCone LinearRoundCone 2020-07-10 14:56:19 -04:00
Florian Reibold fa91d343ab link tutorial code in documentation 2020-07-07 16:29:13 +02:00
Florian Reibold 4154ee8b7e use fetch content instead of submodule 2020-07-07 14:23:40 +02:00
Florian Reibold 3a4a3cf83c remove intelstyle as submodule. 2020-07-06 18:47:07 +02:00
Sven Woop 4587023c60 updated link to forum 2020-06-25 09:38:25 +02:00
Sven Woop cc8c3aac00 regenerated documentation 2020-06-24 15:31:15 +02:00
Sven Woop 68885d5d11 setting version to v3.11.0 2020-06-24 15:23:58 +02:00
Sven Woop 6b6f6db6ec bugfix in setting flags buffer in hair geometry tutorial 2020-06-24 11:34:39 +02:00
Sven Woop 6127a79af0 flags array calculation was using uninitialized data 2020-06-24 10:15:11 +02:00
Sven Woop 1d064a6226 removed linear curve flags calculation from XML loader, this is now done by Embree automatically 2020-06-24 05:54:29 +00:00
Sven Woop a137abfddb properly recalculating flags buffer of segments buffer changed 2020-06-24 05:54:29 +00:00
Sven Woop 832fb8c3a1 we will need automatic calculation of flags buffer also for oriented linear curve once we support it 2020-06-24 05:54:29 +00:00
Sven Woop dc33d5e176 added automatic left/right neighbor bit calculations to documentation 2020-06-24 05:54:29 +00:00
Sven Woop e3d465ede4 using short copyright headers 2020-06-24 05:54:29 +00:00
Sean C McDuffee cd2a9adb9d flags is sized on prims not verts 2020-06-24 05:54:29 +00:00
Sean C McDuffee 8458389aee remove runtime left/right checks
instead fill out flags buffer
2020-06-24 05:54:29 +00:00
Sean C McDuffee 64479d9472 update changelog 2020-06-24 05:54:29 +00:00
Sean C McDuffee 8601b7460f remove test for now
need to get proper static libs into test
2020-06-24 05:54:29 +00:00
Sean C McDuffee 590849e314 segment(Left/Right)Exists handles for default
behaviour
2020-06-24 05:54:28 +00:00
Sven Woop e136609131 setting ray mask to -1 in minimal tutorial 2020-06-24 07:04:27 +02:00
Sven Woop df1620c442 add redist license for Visual Studio distributables 2020-06-22 07:00:47 +02:00
Sven Woop d079246478 updates to documentation for round linear curves 2020-06-17 12:17:51 +02:00
Sven Woop 9c7553e082 Merge remote-tracking branch 'origin/devel' into scm/707-support-start-sphere-segment-for-round-linear-curves 2020-06-17 12:10:05 +02:00
Florian Reibold a08c891f60 tell cmake to use static version of svml 2020-06-15 19:50:35 +02:00
Sven Woop f09934af76 using intel internal docker registry for CI testing 2020-06-12 13:47:45 +02:00
Sven Woop 765f588e6d added additional compile options that prevent removal of error checks 2020-06-10 10:02:12 +00:00
Sven Woop e80e96cc30 using ICC2019 and Visual Studio 2017 for windows release build 2020-06-10 10:01:40 +00:00
Sven Woop 1dc2b17c65 added ubuntu:20.04 CI testing 2020-06-10 10:26:01 +02:00
Sven Woop 68b448b210 Implemented --convert-flat-to-round and --convert-round-to-flat for linear curves. 2020-06-10 10:03:10 +02:00
Sven Woop 67205d1e03 fixed link in RTC_GEOMETRY_TYPE_CURVE.md 2020-06-10 06:11:41 +02:00
Sean C McDuffee cbbb5e2807 Merge branch 'devel' into scm/707-support-start-sphere-segment-for-round-linear-curves 2020-06-09 13:23:55 -04:00
Sean C McDuffee 29aa4b3f96 Merge branch 'scm/707-support-start-sphere-segment-for-round-linear-curves' of gitlab.com:sdvis/embree into scm/707-support-start-sphere-segment-for-round-linear-curves 2020-06-09 13:09:54 -04:00
Sean C McDuffee 9a16ccb139 fix inside sphere bug 2020-06-09 13:08:22 -04:00
Sven Woop 90d6a8823d updates models hash 2020-06-09 11:24:23 +02:00
Sven Woop 30d194dd41 updating release build to use Visual Studio 2017 2020-06-09 07:59:30 +02:00
Sean C McDuffee 20aa73a61e update models images 2020-06-05 17:35:28 -04:00
Sean C McDuffee a55c4ee979 cleanups 2020-06-05 17:35:17 -04:00
Sean C McDuffee 7ed0ed5220 fix bug in sphere choice 2020-06-05 16:57:48 -04:00
Sven Woop 39568f036e introduced TutorialData structure to motion_blur_geometry tutorial 2020-06-05 12:36:08 +02:00
Sven Woop cc3928d795 disabling linking against imgui when GLFW is disabled 2020-06-05 09:53:38 +02:00
Sven Woop b25b1529bd disabling imgui compilation when GLFW is disabled 2020-06-05 09:33:46 +02:00
Sven Woop c6e77e294f fixing cmake_dependent_option usage for tutorial config 2020-06-05 06:21:37 +00:00
Sven Woop 91546c27af all tutorials user override for overriding virtual functions 2020-06-05 06:21:37 +00:00
Sven Woop e55f7906dd added support to disable GLFW in cmake 2020-06-05 06:21:37 +00:00
Sven Woop 12184e53ce added intelstyle as submodule 2020-06-04 10:40:31 +00:00
Sven Woop b34300b423 removed AVX512KNL from release build 2020-06-04 10:40:31 +00:00
Sven Woop 012733dfc5 cleanups 2020-06-04 09:36:55 +00:00
Sven Woop fad7c4e283 fixed comments 2020-06-04 09:36:55 +00:00
Sven Woop 357d441fd6 updates to min-width documentation 2020-06-04 09:36:55 +00:00
Sven Woop 188bd89bc4 added min-width testing 2020-06-04 09:36:54 +00:00
Sven Woop 4fc0a766d1 MINWIDTH->MIN_WIDTH 2020-06-04 09:36:54 +00:00
Sven Woop 22edb0e9d4 renames 2020-06-04 09:36:54 +00:00
Sven Woop dcfb1d38ac renames 2020-06-04 09:36:54 +00:00
Sven Woop 32621d2667 implemented min-width for curves 2020-06-04 09:36:54 +00:00
Sven Woop 75dff00983 implemented min-width for points 2020-06-04 09:36:54 +00:00
Sven Woop db682beb0b updates 2020-06-04 09:36:54 +00:00
Sven Woop ab14d16d6e increased version to v3.11.0 2020-06-04 09:36:54 +00:00
Sven Woop 254bdba763 added documentation of min-width feature 2020-06-04 09:36:54 +00:00
Sven Woop 824ea454e1 cleanups 2020-06-04 09:36:54 +00:00
Sven Woop 539ff369e1 more flexibility in --min-width command line 2020-06-04 09:36:54 +00:00
Sven Woop c774a08c50 added --min-width command line option to viewer 2020-06-04 09:36:54 +00:00
Sven Woop b89460764d fixes to minwidth feature 2020-06-04 09:36:54 +00:00
Sven Woop 93f3374083 implementing minwidth feature for linear curves 2020-06-04 09:36:54 +00:00
Sven Woop 6b9d792c8c fix in release script 2020-06-04 06:46:20 +02:00
Sean C McDuffee 636bfa2cac fix for left sphere cap at the beginning of curve 2020-06-03 18:04:52 -04:00
Sean C McDuffee 0e5ea5e425 fix issues when round cone degenerates 2020-06-03 14:42:30 -04:00
Sven Woop 06124d69ee added ospray testing to linux CI release build 2020-06-03 12:10:37 +00:00
Sven Woop 2f4d85e80e compile fix when only a single ISA is enabled 2020-06-03 06:42:35 +02:00
Sven Woop e9c65f3f96 just some formatting 2020-06-02 07:47:40 +00:00
Sean C McDuffee 317ed257be add tasking lib to unit test app directly 2020-06-02 07:47:40 +00:00
Sean C McDuffee 9d1034a76f removed print 2020-06-02 07:47:40 +00:00
Sean C McDuffee e530f89247 add catch2 sphere tests 2020-06-02 07:47:40 +00:00
Sven Woop e1cc278529 Merge remote-tracking branch 'origin/devel' into 693-allow-bvh-s-over-user-geometries-to-be-built-with-morton-code-builder 2020-06-02 08:44:02 +02:00
Sven Woop fbb09a2e96 improved testing for two level small/large mesh separation 2020-05-29 12:10:22 +02:00
Sven Woop fed5a318b3 Enabled fast two level builder for user geometries when low quality build is requested. 2020-05-29 12:04:52 +02:00
Sven Woop 9ad77195f1 reducing diff 2020-05-29 11:58:06 +02:00
Sven Woop 019952b7ac reducing diff 2020-05-29 11:54:22 +02:00
Sven Woop 8d57383ef9 cleanups 2020-05-29 11:51:20 +02:00
Sven Woop 7ee6e3ebaf implemented proper leaf creation loop for small geometry case 2020-05-29 11:48:55 +02:00
Sven Woop f3655335f2 switching to small geometry for N<=4 in two level builder 2020-05-29 11:39:01 +02:00
Sven Woop 7de87aff83 Revert "increased number of ground plane triangles in dynamic scene tutorial to trigger two level builder bug"
This reverts commit f9ff65e8d4.
2020-05-29 11:35:56 +02:00
Sven Woop f9ff65e8d4 increased number of ground plane triangles in dynamic scene tutorial to trigger two level builder bug 2020-05-29 11:22:40 +02:00
Sven Woop 965a8d31fe cleanups 2020-05-29 11:13:10 +02:00
Sven Woop 9d1823ffed cleanups 2020-05-29 11:03:20 +02:00
Sven Woop e483fc8cb6 removed mesh builders from BVH factories 2020-05-29 10:57:54 +02:00
Sven Woop 32d78ed278 reducing diff to devel branch 2020-05-29 10:53:16 +02:00
Sven Woop 4478a78ee5 properly supporting changing from small->large and vice versa when primitive count changes 2020-05-29 10:51:09 +02:00
Sven Woop a6531a2eea improved BVH size estimate in two level builder 2020-05-29 10:27:38 +02:00
Sven Woop 260f98e449 restoring proper third-party-programs.txt file 2020-05-29 10:25:57 +02:00
Sven Woop ca65c913f3 updates to third party programs file 2020-05-25 11:21:54 +02:00
Sean C McDuffee 81551a7bb6 update changelog 2020-05-21 15:43:50 -04:00
Sean C McDuffee 46563e9929 merge conflict fixes 2020-05-21 15:42:03 -04:00
Sean C McDuffee 8f9e0532fc Merge branch 'devel' into 693-allow-bvh-s-over-user-geometries-to-be-built-with-morton-code-builder 2020-05-21 15:33:33 -04:00
Sean C McDuffee cdd6321d6c consolidated some code 2020-05-21 15:26:28 -04:00
Sean C McDuffee 712567bc65 add twolevel helper internals 2020-05-21 15:10:06 -04:00
Sean C McDuffee d2bdec95e1 move factory builders into the
two_level code
2020-05-21 15:08:57 -04:00
Sean C McDuffee ecb3511fdd add user geometry special case 2020-05-20 17:50:34 -04:00
Sean C McDuffee 2713f822ba remove builderState 2020-05-20 13:09:34 -04:00
Sven Woop 99b9f0c39a added catch2 license to third-party-programs.txt 2020-05-20 10:26:52 +02:00
Sven Woop a757b1c063 BVH data initialization has to happen before object construction stage now,
as this stage already creates leaf data.
2020-05-20 08:43:37 +02:00
Sven Woop 4af91592cd bugfixes 2020-05-20 08:32:45 +02:00
Carsten Benthin 0ea828772c 286 cracks with displacement 2020-05-19 15:41:21 +00:00
Carsten Benthin df098e9d63 286 cracks with displacement 2020-05-19 12:45:07 +00:00
Sven Woop 30433a1db2 exporting TBB-targets when building static library 2020-05-16 08:28:58 +02:00
Florian Reibold 88d3c54998 remove dead regression test from mutex.cpp and the dependency of sys to
tasking
2020-05-15 20:11:40 +02:00
Sean C McDuffee b6e1cf4a00 wip on dynamic bug 2020-05-15 13:14:34 -04:00
Florian Reibold 325f35fa4c update install tbb 2020-05-15 19:05:37 +02:00
Florian Reibold 594d0498d7 update findTBB script
* use existing TBB target
* use modern cmake
2020-05-15 17:48:27 +02:00
Sven Woop efb92e96ce Revert "using ICC2019 to build windows releases"
This reverts commit c8ccc4b24e.
2020-05-15 06:48:17 +02:00
Sean C McDuffee 47e99d67d2 put general small mesh handler into
2 level builder
2020-05-14 17:34:21 -04:00
Sean C McDuffee d0087a0753 add primitive type template parameter to
to 2 level builder
2020-05-14 14:50:56 -04:00
Sean C McDuffee c8d50c84e3 refactor to specialized large builder funcs 2020-05-14 13:21:06 -04:00
Sven Woop c8ccc4b24e using ICC2019 to build windows releases 2020-05-14 11:08:28 +02:00
Sven Woop 8feef6a093 removed Visual Studio 2013 release build as we officially no longer support that Visual Studio version 2020-05-14 11:07:25 +02:00
Sven Woop fdf272a370 Merge remote-tracking branch 'origin/master' into swoop/fixes4 2020-05-14 10:52:51 +02:00
Sven Woop 26b9c35864 added RTCBufferType documentation 2020-05-14 10:11:48 +02:00
Sven Woop 1ed08b16f2 added documentation of RTCFormat 2020-05-14 09:59:08 +02:00
Sven Woop e095364703 embree_DIR no longer an advanced CMake variable 2020-05-14 09:22:29 +02:00
Sven Woop 4e325220b6 updates to changelog 2020-05-14 09:21:38 +02:00
Sven Woop b305281b5e compile fix for Win32 2020-05-14 09:21:10 +02:00
Sven Woop 0e78b682dc adding support for EMBREE_INCLUDE_DIRS and EMBREE_LIBRARY again to embree-config.cmake 2020-05-14 07:08:53 +02:00
Sean C McDuffee 228ecba955 extract methods out around build ref creation 2020-05-13 17:03:27 -04:00
Sean C McDuffee cd72fea556 remove old builder vector 2020-05-13 16:35:58 -04:00
Sean C McDuffee a48fd3b394 move into dedicated RefBuilderLarge 2020-05-13 16:30:47 -04:00
Sean C McDuffee d039710684 pull out objects to bvh->objects 2020-05-13 13:56:21 -04:00
Sven Woop a5cc72784e Improved documentation of RTC_SCENE_FLAG_CONTEXT_FILTER_FUNCION. 2020-05-13 07:02:18 +02:00
Sven Woop 481a3cb9e2 changing cpack package name to Intel(R) Embree Ray Tracing Kernels and updating package description 2020-05-13 06:54:04 +02:00
Sven Woop e082e39464 Fixed read of uninitialized value in curve_intersector_sweep. The value computed
from that uninitialized value was ignored later, thus this bug was not discoverable.
2020-05-13 06:46:34 +02:00
Sven Woop d3a5a95b01 dropping Visual Studio 2013 support and testing 2020-05-13 06:25:49 +02:00
Sven Woop ca9b5f5855 fixed Win32 compile error 2020-05-13 06:16:19 +02:00
Sven Woop 58b51d1494 adding support for EMBREE_INCLUDE_DIRS and EMBREE_LIBRARY again to embree-config.cmake 2020-05-12 20:07:49 +02:00
Sven Woop b7f4111af2 tutorials can get regenerated again 2020-05-12 12:08:21 +02:00
Sven Woop 8f6e4da890 removing 4th component from Vec3fa and adding Vec3fx and Vec3ff types 2020-05-12 11:10:25 +02:00
Sven Woop 124a7945de removing a component from vec3ba and vec3ia 2020-05-12 11:10:25 +02:00
Sven Woop ad35a6794c workaround for Visual Studio 2015 bug 2020-05-08 11:10:24 +02:00
Sven Woop 46fd9dd40c cleanups 2020-05-07 13:47:40 +02:00
Sven Woop e508e4ab28 updated documentation 2020-05-07 12:01:43 +02:00
Sven Woop 67b01b298b improved hair_geometry tutorial image 2020-05-07 12:00:32 +02:00
Sven Woop 6c2fd0b6b8 fixing enumeration layout in docu 2020-05-07 11:52:11 +02:00
Sven Woop 1a9100533e fixing links from API section to tutorial section in generated PDF 2020-05-07 11:49:18 +02:00
Sven Woop f2af84f70b adding support to install MSVC runtime 2020-05-07 10:14:19 +02:00
Sven Woop 4ae2da31dc updated supported compilers in documentation 2020-05-07 08:07:02 +00:00
Sven Woop 17bae5b62d removed install_linux_gcc.sh 2020-05-07 08:07:02 +00:00
Sven Woop 56a1a8728c changing Windows install directory to Intel/Embree3 2020-05-07 08:07:02 +00:00
Sven Woop e0eb2483c9 updates to Using Embree documentation 2020-05-07 08:07:02 +00:00
Sven Woop f7e8b0ebd1 added = as allowed input character 2020-05-07 07:06:58 +00:00
Sven Woop 4597daf45f limiting maximal nesting depth of XML parser 2020-05-07 07:06:58 +00:00
Sven Woop fd5f7e9a29 stricter checking of inputs for string_stream and token_stream 2020-05-07 07:06:58 +00:00
Sven Woop 74b54401ca making instID of RaySOP optional again 2020-05-07 07:25:04 +02:00
Sven Woop 68580264d3 added CanCreateLeaf interface to SAH builder 2020-05-06 14:06:06 +02:00
Sven Woop 94d58f5866 renamed IF_ENABLED_CURVES by IF_ENABLED_CURVES_OR_POINTS 2020-05-06 13:38:37 +02:00
Sven Woop 3715942ef3 setting version to v3.10.0 2020-05-06 07:40:25 +00:00
Sven Woop 61583810a4 updates to changelog 2020-05-06 07:40:25 +00:00
Sven Woop 07fb77cae5 compile fix for enabled COMPACT_POLY mode 2020-05-06 07:40:25 +00:00
Sven Woop c3f716f9c3 compile fix 2020-05-06 07:40:25 +00:00
Sven Woop bcb73c68a8 Moved part of TriangleMi and QuadMi into isa namespace to allow __noinline for ICC bug workaround. 2020-05-06 07:40:25 +00:00
Sven Woop a5a79cd94d workaround for compiler bug in ICC 2019 2020-05-06 07:40:25 +00:00
Sven Woop 56388ee2e4 introducing getVertexOffset template function 2020-05-06 07:40:25 +00:00
Sven Woop ac01607b50 trying ICC 2020.1 2020-05-06 07:40:25 +00:00
Sven Woop dda12552ee testing ICC 2019.5 2020-05-06 07:40:25 +00:00
Sven Woop e040b54180 bugfix for compact quads 2020-05-06 07:40:25 +00:00
Sven Woop 0c10e5a9bc updates to changelog 2020-05-06 07:40:25 +00:00
Sven Woop 0857580df0 compile fix 2020-05-06 07:40:25 +00:00
Sven Woop bbe80e742c cleanups 2020-05-06 07:40:25 +00:00
Sven Woop a9e7564281 no longer using getVertexID to implement compact polys, this gives 10% speedup 2020-05-06 07:40:25 +00:00
Sven Woop 8724a84733 added testing for more compact trianglei/quadi layout 2020-05-06 07:40:25 +00:00
Sven Woop 0e37b4b054 - deactivated quad indices in compact poly mode
- added testing for compact polys
- some formatting
2020-05-06 07:40:25 +00:00
Sean C McDuffee 2a7e8d0b83 bug fix 2020-05-06 07:40:25 +00:00
Sean C McDuffee 276eb07160 bug fix 2020-05-06 07:40:25 +00:00
Sean C McDuffee fd1c44fe63 compact quads 2020-05-06 07:40:25 +00:00
Sean C McDuffee b8b1606e0c working COMPACT_POLYS for tris 2020-05-06 07:40:25 +00:00
Sean C McDuffee e80c05b783 initial commit of EMBREE_COMPACT_POLYS for tris 2020-05-06 07:40:25 +00:00
Sven Woop 61f7348b9d fixed CMake variable name clash in find_embree 2020-05-06 08:06:58 +02:00
Sven Woop 3369ee6b33 make install sets proper RPATH 2020-05-06 08:06:41 +02:00
Florian Reibold f6d4adc423 fix models repo address in test.cmake 2020-05-05 22:00:45 +02:00
Sven Woop ccb4a1ba31 starting to use tbb::global_control with TBB 11005 2020-05-05 07:51:25 +00:00
Sven Woop 9e3f8a81cb using TBB 2020.2 for CI testing and releases 2020-05-05 07:51:25 +00:00
Sven Woop 1894b7a5e9 Compile fix for oneTBB 2021.1-beta05 2020-05-05 07:51:25 +00:00
Sven Woop e18bb68a02 upgrading required cmake version to v3.1.0 2020-05-05 07:36:14 +02:00
Sven Woop ba0abc3ac8 using only tbb2019.9 with ICC2020.1 2020-05-05 07:23:28 +02:00
Sven Woop b7e7b49872 not installing debug version of TBB 2020-05-04 12:05:09 +02:00
Sven Woop 694e86d31a adding EMBREE_ZIP_MODE configurable option 2020-05-04 11:57:55 +02:00
Sven Woop 68c7833740 no longer installing sys,math,simd.a files when building Embree as shared library 2020-05-04 10:02:08 +02:00
Sven Woop 607e57fcd7 enabled ICC2020.1 for CI testing 2020-05-04 09:47:27 +02:00
Sven Woop 3c1e103ac0 increasing timeout for BuildPackage test 2020-05-04 08:47:01 +02:00
Sven Woop 6a5dba51e8 fixed compile warnings when disabling intersection filter 2020-05-04 08:43:51 +02:00
Sven Woop 8c85728d77 setting proper rpath for libembree 2020-04-30 07:53:16 +02:00
Sven Woop 029e02da7a signing static libraries not supported under Windows 2020-04-30 06:32:34 +02:00
Sven Woop 6bdf0d9d7e compile fix 2020-04-29 15:04:22 +02:00
Sven Woop 5917a9858f Merge remote-tracking branch 'origin/devel' into swoop/modern_cmake_usage 2020-04-29 14:49:36 +02:00
Sven Woop 0022db381f properly exporting cmake targets 2020-04-29 14:45:59 +02:00
Sven Woop 6ec3133a26 setting install RPATH for libembree 2020-04-29 10:52:54 +00:00
Sven Woop 7f3fc2a155 updates to changelog 2020-04-29 11:44:54 +02:00
Sven Woop c95b8ddad9 fixed wrong assertion 2020-04-29 11:42:58 +02:00
Sven Woop f7efd87817 fixing more GCC compile warnings 2020-04-29 11:28:31 +02:00
Sven Woop 83f39ee2fb fixed GCC compile warning in imgui.cpp 2020-04-29 11:25:21 +02:00
Sven Woop 8e90b3c59b setting install RPATH for libembree 2020-04-29 11:11:45 +02:00
Sven Woop 5e44ead674 fixing out of bounds warning for GCC in Fedora32 2020-04-29 09:37:00 +02:00
Sven Woop 260286424d enabled ISPC v1.13.0 in CI testing 2020-04-29 07:11:18 +02:00
Sven Woop fbd7f93a30 ISPC v1.13.0 compile fix 2020-04-29 06:55:51 +02:00
Sven Woop 4a7e39781b cleanups to test.cmake 2020-04-28 12:45:16 +02:00
Sven Woop 96b82e1f1f avoiding __m128i type in primrefgen_presplit.h 2020-04-28 12:44:24 +02:00
Sven Woop cff052c077 setting MAX_BRANCHING_FACTOR to 16 for msmblur builder 2020-04-28 12:43:51 +02:00
Sven Woop e66024a315 added lerp for linearspace 2020-04-28 12:43:21 +02:00
Sven Woop d89736e7db using proper CMAKE_INSTALL_LIBDIR for rpath 2020-04-28 12:42:53 +02:00
Sven Woop f438ebb395 removed models and tbb folder from .gitignore 2020-04-28 12:42:11 +02:00
Krzysztof Raszkowski f84937abab ci: change in klocwork scans 2020-04-27 14:55:56 +00:00
Sven Woop 2561bb89b1 fixed to point geometry tutorial 2020-04-23 15:11:54 +02:00
Sven Woop 7edaf3df46 - Point geometry tutorial is created using ispc2cpp script from ISPC version
- Using TutorialData structure to contain all state required during rendering
2020-04-23 10:58:51 +02:00
Sven Woop 18f022f912 Renamed AlignedNode to AABBNode and UnalignedNode to OBBNode.
The previous names were confusing as alignment can also refer to
memory alignment.
2020-04-22 11:42:06 +02:00
Sven Woop a9095c55dc removed dependency to libtbbmalloc, Embree is not using it 2020-04-22 11:25:48 +02:00
Florian Reibold 3307e6c9f4 update model repo hash 2020-04-20 22:04:52 +02:00
Florian Reibold 2d1bb47ea8 add point geometry support to xml loader 2020-04-20 22:04:42 +02:00
Sven Woop b70b21e331 RoundLineSegments XML tag got lost in merge 2020-04-16 09:04:33 +02:00
Sven Woop f2c486bb73 Merge remote-tracking branch 'origin/devel' into scm/671-add-catmull-rom-curve-support-to-xml-loader 2020-04-16 08:14:54 +02:00
Sven Woop 14b055144d Merge branch 'devel' into scm/671-add-catmull-rom-curve-support-to-xml-loader 2020-04-16 08:14:10 +02:00
Sven Woop 597c6d8f59 some fixes to catmull rom support in XML file format 2020-04-16 08:11:09 +02:00
Sven Woop 843b750171 cloning models repo from proper location 2020-04-15 07:08:34 +02:00
Sven Woop d761f349a0 setting version to v3.9.1-alpha.0 2020-04-14 06:55:33 +02:00
Sven Woop fb0a8b4e60 fixing FreeBSD build where MAP_HUGETBL is not defined 2020-04-09 09:27:02 +02:00
Sven Woop 1752a670bd added new models 2020-04-09 09:02:31 +02:00
Sean C McDuffee a2aff1e509 add catmull rom curves to xml loader 2020-04-02 20:56:09 +00:00
933 changed files with 51400 additions and 18837 deletions
+223
View File
@@ -0,0 +1,223 @@
## Copyright 2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: continuous
on: [push, workflow_dispatch]
jobs:
################################################################################
################################################################################
# CPU tests
################################################################################
################################################################################
########################################
# Linux
########################################
continuous-linux-x64-Debug-ICC2019_4-ISPC1_12_0-AVX512-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:27
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:ICC2019.4 ispc:ispc1.12.0 isa:AVX512 frequency_level:simd256 tasking:TBB2021.2.0 intensity:2 maxinstancelevelcount:4
python scripts/test.py build
python scripts/test.py test
continuous-linux-avx512vl-x64-Debug-ICC2019_4-ISPC1_12_0-AVX512-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:27
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:ICC2019.4 ispc:ispc1.12.0 isa:AVX512 frequency_level:simd256 tasking:TBB2021.2.0 intensity:2 maxinstancelevelcount:4
python scripts/test.py build
python scripts/test.py test
continuous-linux-avx512vl-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX512-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX512 frequency_level:simd128 tasking:TBB2021.2.0 GLFW:OFF intensity:2
python scripts/test.py build
python scripts/test.py test
continuous-linux-x64-Debug-CLANG5_0_0-ISPC1_17_0-AVX2-INT-ADDRSANITIZER:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
runs-on: '[ "Linux", "docker", "build" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:CLANG5.0.0 ispc:ispc1.17.0 isa:AVX tasking:INT intensity:1 addrsanitizer:ON
python scripts/test.py build
python scripts/test.py test
continuous-ubuntu20_04-x64-Debug-GCC-ISPC1_12_0-AVX2-TBB-NAMESPACE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/ubuntu:20.04
runs-on: '[ "Linux", "docker", "build" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.12.0 isa:AVX2 frequency_level:simd256 tasking:TBB intensity:1 api_namespace:myembree
python scripts/test.py build
python scripts/test.py test
continuous-linux-avx512vl-x64-Debug-ICX2022_1_2-ISPC1_17_0-AVX512-INT:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/ubuntu:20.04
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug threads:4 compiler:ICX2022.1.2 ispc:ispc1.17.0 isa:AVX512 frequency_level:simd256 tasking:INT intensity:2
python scripts/test.py build
python scripts/test.py test
#continuous-ubuntu17_10-x64-Debug-GCC-ISPC1_12_0-AVX2-TBB-NAMESPACE:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
# with:
# image: embree/ubuntu:17.10
# runs-on: '[ "Linux", "docker" ]'
# cmd: |
# python scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.12.0 isa:AVX2 tasking:TBB intensity:1 api_namespace:myembree
# python scripts/test.py build
# python scripts/test.py test
continuous-centos7_4-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
runs-on: '[ "Linux", "docker", "build" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 frequency_level:simd128 tasking:TBB intensity:1
python scripts/test.py build
python scripts/test.py test
continuous-fedora32-x64-Debug-GCC-ISPC-AVX512-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:32
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isa:AVX512 tasking:TBB COMPACT_POLYS:ON MIN_WIDTH:ON intensity:2
python scripts/test.py build
python scripts/test.py test
########################################
# Windows
########################################
continuous-windows-x64-RelWithDebInfo-V140-ISPC1_9_2-SSE2-TBB2020_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
runs-on: '[ "Windows", "NAS", "build" ]'
cmd: |
python scripts/test.py configure platform:x64 threads:4 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:SSE2 tasking:TBB2020.2 intensity:2
python scripts/test.py build
python scripts/test.py test
# continuous-windows-Win32-RelWithDebInfoDebug-V140-ISPC1_12_0-SSE2-TBB2020_2:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
# with:
# runs-on: '[ "Windows", "NAS", "build" ]'
# cmd: |
# python scripts/test.py configure platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.12.0 isa:SSE2 tasking:TBB2020.2 intensity:2
# python scripts/test.py build
# python scripts/test.py test
continuous-windows-x64-RelWithDebInfo-V141-ISPC1_17_0-SSE2-TBB2020_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
runs-on: '[ "Windows", "NAS", "build" ]'
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V141 ispc:ispc1.17.0 isa:SSE2 tasking:TBB2020.2 intensity:2 maxinstancelevelcount:8
python scripts/test.py build
python scripts/test.py test
# continuous-windows-x64-RelWithDebInfo-ICX2022_0_0-ISPC1_16_1-AVX512-INT:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
# with:
# runs-on: '[ "Windows", "NAS", "build", "avx512" ]'
# cmd: |
# python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:ICX2022.0.0 ispc:ispc1.16.1 isa:AVX512 tasking:INT threads:16 intensity:2
# python scripts/test.py build
# python scripts/test.py test
########################################
# MacOS
########################################
continuous-macosx-ARM-Debug-CLANG-ISPC1_17_0-NEON-TBB_HOMEBREW:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "arm" ]'
cmd: |
scripts/test.py configure platform:arm64 build:Debug compiler:CLANG ispc:ispc1.17.0 isa:NEON tasking:TBB_HOMEBREW intensity:2
scripts/test.py build
scripts/test.py test
continuous-macosx-ARM-Debug-CLANG-ISPC1_17_0-NEON-AVX2-TBB_HOMEBREW:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "arm" ]'
cmd: |
scripts/test.py configure platform:arm64 build:Debug compiler:CLANG ispc:ispc1.17.0 isa:NEON2X tasking:TBB_HOMEBREW intensity:2
scripts/test.py build
scripts/test.py test
# continuous-macosx-x64-Debug-ICC2020_1-ISPC1_14_1-SSE2-TBB2021_1_1:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
# with:
# runs-on: '[ "macOS", "embree" ]'
# cmd: |
# scripts/test.py configure platform:x64 build:Debug compiler:ICC2020.1 ispc:ispc1.14.1 isa:SSE2 tasking:TBB2021.1.1 intensity:2
# scripts/test.py build
# scripts/test.py test
continuous-macosx-x64-Debug-CLANG-ISPC1_17_0-SSE2-TBB2020_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "embree" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG ispc:ispc1.17.0 isa:SSE2 tasking:TBB2020.2 intensity:2
scripts/test.py build
scripts/test.py test
continuous-linux-x64-Debug-GCC-ISPC1_17_0-SSE2-TBB-KLOCWORK:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_static_analysis.yml@main
with:
image: embree/centos:7.4
runs-on: '[ "Linux", "docker", "build" ]'
cmd: |
export CI_PROJECT_DIR=$GITHUB_WORKSPACE
export CI_JOB_ID=$GITHUB_RUN_ID
python scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:SSE2 tasking:TBB klocwork:ON intensity:0
python scripts/test.py build
python scripts/test.py test
scripts/klocwork_gen_report.sh
scripts/store_files.sh $GITHUB_REPOSITORY $GITHUB_RUN_ID klocwork "klocwork/report.log"
+645
View File
@@ -0,0 +1,645 @@
## Copyright 2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: nightly
on:
schedule:
- cron: '30 06 * * *'
workflow_dispatch:
jobs:
################################################################################
################################################################################
# CPU tests
################################################################################
################################################################################
########################################
# Linux
########################################
# CLANG compilation and testing of different ISAs
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_12_0-SSE2-TBB-NAMESPACE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.12.0 isa:SSE2 tasking:TBB2019.9 intensity:4 api_namespace:myembree maxinstancelevelcount:8
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG5_0_0-ISPC1_15_0-AVX2-INT-ADDRSANITIZER:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG5.0.0 ispc:ispc1.15.0 isa:AVX tasking:INT intensity:2 addrsanitizer:ON
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_16_1-AVX2-TBB2021_2_0-STATIC:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.16.1 isa:AVX2 frequency_level:simd128 tasking:TBB2021.2.0 intensity:4 STATIC_LIB:ON
scripts/test.py build
scripts/test.py test
nightly-linux-avx512vl-x64-Debug-CLANG4_0_0-ISPC1_16_1-AVX512-TBB2020_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.16.1 isa:AVX512 frequency_level:simd256 tasking:TBB2020.2 intensity:3
scripts/test.py build
scripts/test.py test
# GCC compilation and testing of different ISAs
nightly-linux-x64-Debug-GCC-ISPC1_16_1-SSE2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.16.1 isa:SSE2 tasking:TBB2021.2.0 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-GCC-ISPC1_16_1-AVX-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.16.1 isa:AVX tasking:TBB2019.9 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 intensity:4
scripts/test.py build
scripts/test.py test
# ICC compilation and testing of different ISAs
nightly-linux-x64-Debug-ICC2016_3-ISPC1_16_1-AVX-TBB2019_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2016.3 ispc:ispc1.16.1 isa:AVX tasking:TBB2019.2 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-avx512vl-x64-Debug-ICC2017_1-ISPC1_16_1-AVX512-TBB2019_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2017.1 ispc:ispc1.16.1 isa:AVX512 frequency_level:simd256 tasking:TBB2019.2 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-avx512vl-x64-Debug-ICC2018_0-ISPC1_16_1-AVX512-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2018.0 ispc:ispc1.16.1 isa:AVX512 tasking:TBB2019.9 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-ICC2019_4-ISPC1_16_1-AVX2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2019.4 ispc:ispc1.16.1 isa:AVX2 tasking:TBB2021.2.0 intensity:4
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-ICC2020_1-ISPC1_17_0-AVX2-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2020.1 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 intensity:4
scripts/test.py build
scripts/test.py test
# Testing on different Linux distributions
nightly-ubuntu20_04-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/ubuntu:20.04
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
nightly-ubuntu20_04-x64-Release-GCC-ISPC1_14_1-AVX2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/ubuntu:20.04
cmd: |
scripts/test.py configure platform:x64 build:Release compiler:GCC ispc:ispc1.14.1 isa:AVX2 tasking:TBB2021.2.0 intensity:2
scripts/test.py build
scripts/test.py test
nightly-ubuntu16_04-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/ubuntu:16.04
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 tasking:TBB MIN_WIDTH:ON intensity:3
scripts/test.py build
scripts/test.py test
nightly-centos7_4-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 tasking:TBB COMPACT_POLYS:ON intensity:3
scripts/test.py build
scripts/test.py test
#nightly-centos7_0-x64-Debug-GCC-ISPC1_17_0-AVX2-TBB:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
# with:
# image: embree/centos:7.0
# cmd: |
# scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc1.17.0 isa:AVX2 tasking:TBB intensity:3"]
# scripts/test.py build
# scripts/test.py test
nightly-fedora32-x64-Debug-GCC-ISPC-AVX512-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:32
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isas:AVX512 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
nightly-fedora28-x64-Debug-GCC-ISPC-AVX512-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:28
runs-on: '[ "Linux", "docker", "avx512" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isas:SSE2-SSE42-AVX-AVX2-AVX512 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
nightly-fedora27-x64-Debug-GCC-ISPC-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:27
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
nightly-fedora26-x64-Debug-GCC-ISPC-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:26
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
nightly-fedora25-x64-Debug-GCC-ISPC-AVX2-TBB:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3
scripts/test.py build
scripts/test.py test
# Compilation test of disabled features
nightly-linux-x64-Debug-CLANG4_0_0-AVX2-TBB2019_9-NO-ISPC:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 isa:AVX2 tasking:TBB2019.9 intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-NO-TUTORIALS:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 TUTORIALS:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-BACKFACECULLING:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 BACKFACE_CULLING:ON intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-IGNORE-INVALID-RAYS:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 IGNORE_INVALID_RAYS:ON intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-NO-FILTER-FUNCTION:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 FILTER_FUNCTION:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-RAYMASKS:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 RAY_MASK:ON intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-NO-PACKETS:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 RAY_PACKETS:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-STATCOUNTER:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 STAT_COUNTER:ON intensity:0
scripts/test.py build
scripts/test.py test
# Compilation test of individual ISAs
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-ISAS-SSE2-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isas:SSE2 tasking:TBB2019.9 intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-ISAS-SSE42-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isas:SSE42 tasking:TBB2021.2.0 intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-ISAS-AVX-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isas:AVX tasking:TBB2019.9 intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-ISAS-AVX2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isas:AVX2 tasking:TBB2021.2.0 intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-ISAS-AVX512-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isas:AVX512 tasking:TBB2019.9 intensity:0
scripts/test.py build
scripts/test.py test
# Compilation test of individual primitive types enabled
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-TRI:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-QUAD:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 TRI:OFF QUAD:ON GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-GRID:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 TRI:OFF QUAD:OFF GRID:ON CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-CURVE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 TRI:ON QUAD:OFF GRID:OFF CURVE:ON SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-SUBDIV:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:ON USERGEOM:OFF INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2019_9-USERGEOM:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2019.9 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:ON INSTANCE:OFF intensity:0
scripts/test.py build
scripts/test.py test
nightly-linux-x64-Debug-CLANG4_0_0-ISPC1_17_0-AVX2-TBB2021_2_0-INSTANCE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/fedora:25
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG4.0.0 ispc:ispc1.17.0 isa:AVX2 tasking:TBB2021.2.0 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:ON intensity:0
scripts/test.py build
scripts/test.py test
########################################
# Windows
########################################
nightly-windows-x64-RelWithDebInfo-V140-ISPC1_9_2-SSE2-INT:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:SSE2 tasking:INT intensity:2
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-V140-ISPC1_9_2-AVX-TBB2019_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX tasking:TBB2019.2 intensity:4
python scripts/test.py build
python scripts/test.py test
nightly-windows-Win32-RelWithDebInfo-V140-ISPC1_12_0-SSE2-TBB2020_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.12.0 isa:SSE2 tasking:TBB2020.2 intensity:2
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-V140-ISPC1_12_0-AVX2-PPL:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.12.0 isa:AVX2 frequency_level:simd256 tasking:PPL intensity:2
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-V141-ISPC1_13_0-AVX2-TBB2019_9-STATIC:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V141 ispc:ispc1.13.0 isa:AVX2 frequency_level:simd128 tasking:TBB2019.9 intensity:2 STATIC_LIB:ON
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-V142-ISPC1_13_0-AVX2-TBB2020_2-STATIC:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:V142 ispc:ispc1.13.0 isa:AVX2 tasking:TBB2020.2 intensity:2
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-LLVM-CLANG-ISPC1_13_0-AVX2-TBB2019_9-NAMESPACE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:LLVM_CLANG ispc:ispc1.13.0 isa:AVX2 tasking:TBB2019.9 intensity:4 api_namespace:myembree
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-ICC17-ISPC1_13_0-AVX2-TBB2019_2:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:ICC17-VC14 ispc:ispc1.13.0 isa:AVX2 frequency_level:simd128 tasking:TBB2019.2 intensity:4
python scripts/test.py build
python scripts/test.py test
# nightly-windows-x64-RelWithDebInfo-ICC18-ISPC1_13_0-AVX512-TBB2020_2:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
# with:
# runs-on: '[ "Windows", "NAS", "build", "avx512" ]'
# cmd: |
# python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:ICC18-VC14 ispc:ispc1.13.0 isa:AVX512 tasking:TBB2020.2 intensity:2
# python scripts/test.py build
# python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-ICC19-ISPC1_13_0-AVX512-TBB2019_9:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
runs-on: '[ "Windows", "NAS", "build", "avx512" ]'
cmd: |
python scripts/test.py configure platform:x64 build:RelWithDebInfo compiler:ICC19-VC14 ispc:ispc1.13.0 isa:AVX512 tasking:TBB2019.9 intensity:2
python scripts/test.py build
python scripts/test.py test
nightly-windows-x64-RelWithDebInfo-ICC17-ISPC1_14_1-AVX2-TBB2021_2_0:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
cmd: |
python scripts/test.py configure platform:x64 build:Release compiler:V142 ispc:ispc1.14.1 isa:AVX2 tasking:TBB2021.2.0 intensity:2
python scripts/test.py build
python scripts/test.py test
########################################
# MacOS
########################################
# CLANG compilation and testing of different ISAs
nightly-macosx-x64-Debug-CLANG-ISPC1_12_0-SSE2-TBB2020_2-NAMESPACE:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "embree" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG ispc:ispc1.12.0 isa:SSE2 tasking:TBB2020.2 intensity:4 api_namespace:myembree maxinstancelevelcount:4
scripts/test.py build
scripts/test.py test
nightly-macosx-x64-Debug-CLANG-ISPC1_13_0-AVX-INT:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "embree" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG ispc:ispc1.13.0 isa:AVX tasking:INT intensity:4
scripts/test.py build
scripts/test.py test
nightly-macosx-x64-Debug-CLANG-ISPC1_13_0-SSE2-TBB2019_9-STATIC:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "embree" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:CLANG ispc:ispc1.13.0 isa:SSE2 tasking:TBB2019.9 intensity:4 STATIC_LIB:ON
scripts/test.py build
scripts/test.py test
# ICC compilation and testing of different ISAs
# nightly-macosx-x64-Debug-ICC15-ISPC1_13_0-AVX-INT:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
# with:
# runs-on: '[ "macOS", "embree" ]'
# cmd: |
# scripts/test.py configure platform:x64 build:Debug compiler:ICC15 ispc:ispc1.13.0 isa:AVX tasking:INT intensity:4
# scripts/test.py build
# scripts/test.py test
# nightly-macosx-x64-Debug-ICC2019_4-ISPC1_13_0-AVX2-TBB2020_2:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
# with:
# runs-on: '[ "macOS", "avx2", "embree" ]'
# cmd: |
# scripts/test.py configure platform:x64 build:Debug compiler:ICC2019.4 ispc:ispc1.13.0 isa:AVX2 frequency_level:simd256 tasking:TBB2020.2 intensity:4
# scripts/test.py build
# scripts/test.py test
# nightly-macosx-x64-Debug-ICC2020_1-ISPC1_13_0-AVX2-TBB2019_9:
# secrets: inherit
# uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
# with:
# runs-on: '[ "macOS", "avx2", "embree" ]'
# cmd: |
# scripts/test.py configure platform:x64 build:Debug compiler:ICC2020.1 ispc:ispc1.13.0 isa:AVX2 frequency_level:simd128 tasking:TBB2019.9 intensity:4
# scripts/test.py build
# scripts/test.py test
nightly-macosx-x64-Debug-ICC2021_1_1-ISPC1_13_0-AVX2-TBB2021_1_1:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "avx2", "embree" ]'
cmd: |
scripts/test.py configure platform:x64 build:Debug compiler:ICC2021.1.1 ispc:ispc1.13.0 isa:AVX2 frequency_level:simd128 tasking:TBB2021.1.1 intensity:4
scripts/test.py build
scripts/test.py test
+85
View File
@@ -0,0 +1,85 @@
## Copyright 2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: release
on:
schedule:
- cron: '30 04 * * *'
workflow_dispatch:
jobs:
#####################################################################
# Release Builds
####################################################################
release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_windows.yml@main
with:
runs-on: '[ "Windows", "NAS", "build", "avx512" ]'
artifact-out: release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-path: ./build/*.zip
cmd: |
python scripts/test.py configure platform:x64 build:Release compiler:ICC19-VC141 ispc:ispc1.17.0 isas:SSE2-SSE42-AVX-AVX2-AVX512 tasking:TBB2021.2.0 intensity:4 package:ZIP
python scripts/test.py build
python scripts/test.py test
release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_macos.yml@main
with:
runs-on: '[ "macOS", "embree", "sign", "avx2" ]'
artifact-out: release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-path: ./build/*.zip
cmd: |
scripts/test.py configure platform:x64 build:Release compiler:ICC2021.1.1 ispc:ispc1.17.0 isas:SSE2-SSE42-AVX-AVX2 tasking:TBB2021.2.0 intensity:4 package:ZIP
scripts/test.py build
scripts/test.py test
release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/embree_docker.yml@main
with:
image: embree/centos:7.4
runs-on: '[ "Linux", "docker", "avx512" ]'
artifact-out: release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-path: ./build/*.tar.gz
cmd: |
scripts/test.py configure platform:x64 build:Release compiler:ICC2020.1 ispc:ispc1.17.0 isas:SSE2-SSE42-AVX-AVX2-AVX512 tasking:TBB2021.2.0 intensity:4 package:ZIP
scripts/test.py build
scripts/test.py test
#####################################################################
# Release binaries scans
#####################################################################
binary-analysis:
needs:
- release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
- release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
- release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
with:
project: embree
artifact-in-linux: release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-in-macos: release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-in-windows: release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
path: "build/*.zip build/*.gz"
antivirus-scan:
needs:
- release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
- release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
- release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
with:
project: embree
artifact-in-linux: release-windows-x64-Release-ICC19-VC141-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-in-macos: release-macosx-x64-Release-ICC2021_1_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
artifact-in-windows: release-linux-x64-Release-ICC2020_1-ISPC1_17_0-TBB2021_2_0-PACKAGE-ZIP
path: "build/*.zip build/*.gz"
-3
View File
@@ -9,6 +9,3 @@ kernels/config.h
kernels/hash.h
include/embree3/rtcore_config.h
build
models
tbb
doc/intelstyle
+609 -386
View File
File diff suppressed because it is too large Load Diff
+123 -21
View File
@@ -1,6 +1,108 @@
Version History
---------------
### Embree 3.13.5
- Fixed bug in bounding flat Catmull Rom curves of subdivision level 4.
- Improved self intersection avoidance for
RTC_GEOMETRY_TYPE_DISC_POINT geometry type. Intersections are
skipped if the ray origin lies inside the sphere defined by the
point primitive. Self intersection avoidance can get disabled at compile time
using the EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE cmake option.
- Fixed spatial splitting for non-planar quads.
### Embree 3.13.4
- Using 8-wide BVH and double pumped NEON instructions on Apple M1 gives 8% performance boost.
- Fixed binning related crash in SAH BVH builder.
- Added EMBREE_TBB_COMPONENT cmake option to define the component/library name of Intel® TBB (default: tbb).
- Embree supports now Intel® oneAPI DPC++/C++ Compiler 2022.0.0
### Embree 3.13.3
- Invalid multi segment motion blurred normal oriented curves are properly excluded from BVH build.
- Fixing issue with normal oriented curve construction when center curve curvature is very large.
Due to this change normal oriented curve shape changes slightly.
- Fixed crash caused by disabling a geometry and then detaching it from the scene.
- Bugfix in emulated ray packet intersection when EMBREE_RAY_PACKETS is turned off.
- Bugfix for linear quaternion interpolation fallback.
- Fixed issues with spaces in path to Embree build folder.
- Some fixes to compile Embree in SSE mode using WebAssembly.
- Bugfix for occlusion rays with grids and ray packets.
- We do no longer provide installers for Windows and macOS, please use the ZIP files instead.
- Upgrading to Intel® ISPC 1.17.0 for release build.
- Upgrading to Intel® oneTBB 2021.5.0 for release build.
### Embree 3.13.2
- Avoiding spatial split positions that are slightly out of geometry bounds.
- Introduced rtcGetGeometryThreadSafe function, which is a thread safe version of rtcGetGeometry.
- Using more accurate rcp implementation.
- Bugfix to rare corner case of high quality BVH builder.
### Embree 3.13.1
- Added support for Intel® ISPC ARM target.
- Releases upgrade to Intel® TBB 2021.3.0 and Intel® ISPC 1.16.1
### Embree 3.13.0
- Added support for Apple M1 CPUs.
- RTC_SUBDIVISION_MODE_NO_BOUNDARY now works properly for non-manifold edges.
- CMake target 'uninstall' is not defined if it already exists.
- Embree no longer reads the .embree3 config files, thus all configuration has
to get passed through the config string to rtcNewDevice.
- Releases upgrade to Intel® TBB 2021.2.0 and Intel® ISPC 1.15.0
- Intel® TBB dll is automatically copied into build folder after build on windows.
### Embree 3.12.2
- Fixed wrong uv and Ng for grid intersector in robust mode for AVX.
- Removed optimizations for Knights Landing.
- Upgrading release builds to use Intel® oneTBB 2021.1.1
### Embree 3.12.1
- Changed default frequency level to SIMD128 for Skylake, Cannon Lake, Comet Lake and Tiger Lake CPUs.
This change typically improves performance for renderers that just use SSE by maintaining higher
CPU frequencies. In case your renderer is AVX optimized you can get higher ray tracing performance
by configuring the frequency level to simd256 through passing frequency_level=simd256 to rtcNewDevice.
### Embree 3.12.0
- Added linear cone curve geometry support. In this mode a real geometric surface for curves
with linear basis is rendered using capped cones. They are discontinuous at edge boundaries.
- Enabled fast two level builder for instances when low quality build is requested.
- Bugfix for BVH build when geometries got disabled.
- Added EMBREE_BACKFACE_CULLING_CURVES cmake option. This allows for a cheaper round
linear curve intersection when correct internal tracking and back hits are not required.
The new cmake option defaults to OFF.
- User geometries with invalid bounds with lower>upper in some dimension will be ignored.
- Increased robustness for grid interpolation code and fixed returned out of range u/v
coordinates for grid primitive.
- Fixed handling of motion blur time range for sphere, discs, and oriented disc geometries.
- Fixed missing model data in releases.
- Ensure compatibility to newer versions of Intel® oneTBB.
- Motion blur BVH nodes no longer store NaN values.
### Embree 3.11.0
- Round linear curves now automatically check for the existence of left and right
connected segments if the flags buffer is empty. Left segments exist if the
segment(id-1) + 1 == segment(id) and similarly for right segments.
- Implemented the min-width feature for curves and points, which allows to increase the
radius in a distance dependent way, such that the curve or points thickness is n pixels wide.
- Round linear curves are closed now also at their start.
- Embree no longer supports Visual Studio 2013 starting with this release.
- Bugfix in subdivision tessellation level assignment for non-quad base primitives
- Small meshes are directly added to top level build phase of two-level builder to reduce memory consumption.
- Enabled fast two level builder for user geometries when low quality build is requested.
### Embree 3.10.0
- Added EMBREE_COMPACT_POLYS CMake option which enables double indexed triangle and quad
leaves to reduce memory consumption in compact mode by an additional 40% at about
15% performance impact. This new mode is disabled by default.
- Compile fix for Intel® oneTBB 2021.1-beta05
- Releases upgrade to Intel® TBB 2020.2
- Compile fix for Intel® ISPC v1.13.0
- Adding RPATH to libembree.so in releases
- Increased required CMake version to 3.1.0
- Made instID member for array of pointers ray stream layout optional again.
### Embree 3.9.0
- Added round linear curve geometry support. In this mode a real geometric surface for curves
@@ -8,7 +110,7 @@ Version History
the curve segments.
- Added rtcGetSceneDevice API function, that returns the device a scene got created in.
- Improved performance of round curve rendering by up to 1.8x.
- Bugfix to sphere intersection filter invokation for back hit.
- Bugfix to sphere intersection filter invocation for back hit.
- Fixed wrong assertion that triggered for invalid curves which anyway get filtered out.
- RelWithDebInfo mode no longer enables assertions.
- Fixed an issue in FindTBB.cmake that caused compile error with Debug build under Linux.
@@ -32,7 +134,7 @@ Version History
instantiate a motion blurred scene.
- In robust mode the depth test consistently uses tnear <= t <= tfar now in order
to robustly continue traversal at a previous hit point
in a way that guarentees reaching all hits, even hits at the same place.
in a way that guarantees reaching all hits, even hits at the same place.
- Fixed depth test in robust mode to be precise at tnear and tfar.
- Added next_hit tutorial to demonstrate robustly collecting all hits
along a ray using multiple ray queries.
@@ -43,18 +145,18 @@ Version History
for SAH heuristic were counted wrong due to some numerical issues.
- Fixed an accuracy issue with rendering very short fat curves.
- rtcCommitScene can now get called during rendering from multiple threads
to lazily build geometry. When TBB is used this causes a much lower overhead
to lazily build geometry. When Intel® TBB is used this causes a much lower overhead
than using rtcJoinCommitScene.
- Geometries can now get attached to multiple scenes at the same time, which
simplifies mapping general scene graphs to API.
- Updated to TBB 2019.9 for release builds.
- Updated to Intel® TBB 2019.9 for release builds.
- Fixed a bug in the BVH builder for Grid geometries.
- Added macOS Catalina support to Embree releases.
### New Features in Embree 3.6.1
- Restored binary compatibility between Embree 3.6 and 3.5 when single-level instancing is used.
- Fixed bug in subgrid intersector
- Removed point query alignment in ISPC header
- Removed point query alignment in Intel® ISPC header
### New Features in Embree 3.6
- Added Catmull-Rom curve types.
@@ -64,7 +166,7 @@ Version History
specified.
- Fixed bug in external BVH builder when configured for dynamic build.
- Added support for new config flag "user_threads=N" to device initialization
which sets the number of threads used by TBB but created by the user.
which sets the number of threads used by Intel® TBB but created by the user.
- Fixed automatic vertex buffer padding when using rtcSetNewGeometry API function.
### New Features in Embree 3.5.2
@@ -98,7 +200,7 @@ Version History
- Added point primitives (spheres, ray-oriented discs, normal-oriented discs).
- Fixed crash triggered by scenes with only invalid primitives.
- Improved robustness of quad/grid-based intersectors.
- Upgraded to TBB 2019.2 for release builds.
- Upgraded to Intel® TBB 2019.2 for release builds.
### New Features in Embree 3.3.0
- Added support for motion blur time range per geometry. This way geometries
@@ -256,7 +358,7 @@ Version History
by 5-15%.
- Fixed tbb_debug.lib linking error under Windows.
- Fast coherent ray stream and packet code paths now also work in robust mode.
- Using less agressive prefetching for large BVH nodes which
- Using less aggressive prefetching for large BVH nodes which
results in 1-2% higher ray tracing performance.
- Precompiled binaries have stack-protector enabled, except for
traversal kernels. BVH builders can be slightly slower due to this
@@ -267,7 +369,7 @@ Version History
fixed, and one can enable only AVX2 and still get best
performance by using an 8-wide BVH.
- Fixed rtcOccluded1 and rtcOccluded1Ex API functions which were
broken in ISPC.
broken in Intel® ISPC.
- Providing MSI installer for Windows.
### New Features in Embree 2.16.5
@@ -293,7 +395,7 @@ Version History
cracks when using displacement mapping but reduces performance
at irregular vertices.
- Fixed a bug where subdivision geometry was not properly updated
when modifying only the tesselation rate and vertex array.
when modifying only the tessellation rate and vertex array.
### New Features in Embree 2.16.2
- Fixed bug that caused NULL intersection context in intersection
@@ -456,14 +558,14 @@ Version History
If you use Embree v2.11.0 please upgrade to Embree v2.12.0.
- Reduced memory consumption for dynamic scenes containing small
meshes.
- Added support to start and affinitize TBB worker threads by passing
- Added support to start and affinitize Intel® TBB worker threads by passing
"`start_threads=1,set_affinity=1`" to `rtcNewDevice`. These settings
are recommended on systems with a high thread count.
- `rtcInterpolate2` can now be called within a displacement shader.
- Added initial support for Microsoft's Parallel Pattern Library (PPL)
as tasking system alternative (for optimal performance TBB is
as tasking system alternative (for optimal performance Intel® TBB is
highly recommended).
- Updated to TBB 2017 which is released under the Apache v2.0 license.
- Updated to Intel® TBB 2017 which is released under the Apache v2.0 license.
- Dropped support for Visual Studio 2012 Win32 compiler. Visual Studio
2012 x64 is still supported.
@@ -527,14 +629,14 @@ Version History
- Added support for quad geometry (replaces triangle-pairs feature).
- Added support for linear motion blur of user geometries.
- Improved performance through AVX-512 optimizations.
- Improved performance of lazy scene build (when using TBB 4.4 update
- Improved performance of lazy scene build (when using Intel® TBB 4.4 update
2).
- Improved performance through huge page support under linux.
### New Features in Embree 2.7.1
- Internal tasking system supports cancellation of build operations.
- ISPC mode for robust and compact scenes got significantly faster
- Intel® ISPC mode for robust and compact scenes got significantly faster
(implemented hybrid traversal for bvh4.triangle4v and
bvh4.triangle4i).
- Hair rendering got faster as we fixed some issues with the SAH
@@ -559,7 +661,7 @@ Version History
- Added device concept to Embree to allow different components of an
application to use Embree without interfering with each other.
- Fixed memory leak in twolevel builder used for dynamic scenes.
- Fixed bug in tesselation cache that caused crashes for subdivision
- Fixed bug in tessellation cache that caused crashes for subdivision
surfaces.
- Fixed bug in internal task scheduler that caused deadlocks when
using `rtcCommitThread`.
@@ -633,10 +735,10 @@ Version History
progress and cancel long build operations
- BVH builders can be used to build user defined hierarchies inside
the application (see tutorial [BVH Builder])
- Switched to TBB as default tasking system on Xeon to get even faster
- Switched to Intel® TBB as default tasking system on Xeon to get even faster
hierarchy build times and better integration for applications that
also use TBB
- `rtcCommit` can get called from multiple TBB threads to join the
also use Intel® TBB
- `rtcCommit` can get called from multiple Intel® TBB threads to join the
hierarchy build operations
### New Features in Embree 2.4
@@ -724,7 +826,7 @@ Version History
- Support for the Intel® Xeon Phi™ coprocessor platform
- Support for high-performance "packet" kernels on SSE, AVX, and Xeon
Phi
- Integration with the Intel® SPMD Program Compiler (ISPC)
- Integration with the Intel® Implicit SPMD Program Compiler (Intel® ISPC)
- Instantiation and fast BVH reconstruction
- Example photo-realistic rendering engine for both C++ and ISPC
- Example photo-realistic rendering engine for both C++ and Intel® ISPC
+232 -105
View File
@@ -1,9 +1,10 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
SET(EMBREE_VERSION_MAJOR 3)
SET(EMBREE_VERSION_MINOR 9)
SET(EMBREE_VERSION_PATCH 0)
SET(EMBREE_VERSION_MINOR 13)
SET(EMBREE_VERSION_PATCH 5)
SET(EMBREE_VERSION_NOTE "")
SET(EMBREE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}.${EMBREE_VERSION_PATCH})
@@ -12,13 +13,11 @@ SET(CPACK_RPM_PACKAGE_RELEASE 1)
PROJECT(embree${EMBREE_VERSION_MAJOR})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
# We use our own strip tool on macOS to sign during install. This is required as CMake modifies RPATH of the binary during install.
IF (APPLE AND EMBREE_SIGN_FILE)
SET(EMBREE_STRIP ${CMAKE_STRIP})
SET(CMAKE_STRIP ${PROJECT_BINARY_DIR}/post_install_target.sh)
CONFIGURE_FILE(scripts/post_install_target.sh.in ${PROJECT_BINARY_DIR}/post_install_target.sh @ONLY)
SET(CMAKE_STRIP "${PROJECT_BINARY_DIR}/post_install_target.sh")
CONFIGURE_FILE(scripts/post_install_target.sh.in "${PROJECT_BINARY_DIR}/post_install_target.sh" @ONLY)
ENDIF()
MACRO (SIGN_TARGET target)
@@ -31,7 +30,7 @@ MACRO (SIGN_TARGET target)
# on MacOSX we strip and sign here for testing purposes but also during install, as CMake modifies binary during install
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${EMBREE_STRIP} -x $<TARGET_FILE:${target}>
COMMAND ${EMBREE_SIGN_FILE} -o runtime -e ${CMAKE_SOURCE_DIR}/common/cmake/embree.entitlements $<TARGET_FILE:${target}>)
COMMAND ${EMBREE_SIGN_FILE} -o runtime -e "${CMAKE_SOURCE_DIR}/common/cmake/embree.entitlements" $<TARGET_FILE:${target}>)
ELSE()
# on Linux signing of binaries is not supported and stripping is done during install
ENDIF()
@@ -39,7 +38,7 @@ MACRO (SIGN_TARGET target)
ENDMACRO()
# find git version
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
FIND_PACKAGE(Git)
IF(GIT_FOUND)
EXECUTE_PROCESS(
@@ -61,7 +60,13 @@ IF(COMMAND cmake_policy)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0072)
cmake_policy(SET CMP0072 OLD)
cmake_policy(SET CMP0072 NEW)
endif()
if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW)
endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
ENDIF(COMMAND cmake_policy)
@@ -74,12 +79,19 @@ MARK_AS_ADVANCED(CMAKE_OSX_DEPLOYMENT_TARGET)
MARK_AS_ADVANCED(CMAKE_OSX_SYSROOT)
MARK_AS_ADVANCED(CLEAR CMAKE_CXX_COMPILER)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/common/cmake ${CMAKE_MODULE_PATH})
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake" ${CMAKE_MODULE_PATH})
IF (BUILD_TESTING)
INCLUDE(test)
ENDIF()
set(BUILD_DOC OFF CACHE INTERNAL "build documentation (internal only)")
IF (BUILD_DOC)
ADD_SUBDIRECTORY(doc)
ENDIF()
OPTION(EMBREE_TUTORIALS "Enable to build Embree tutorials" ON)
##############################################################
# Embree configuration
##############################################################
@@ -94,12 +106,16 @@ ELSE()
ENDIF()
IF (EMBREE_STATIC_LIB)
SET(EMBREE_LIB_TYPE STATIC)
ADD_DEFINITIONS(-DEMBREE_STATIC_LIB)
ELSE()
SET(EMBREE_LIB_TYPE SHARED)
ENDIF()
OPTION(EMBREE_ISPC_SUPPORT "Build Embree with support for ISPC applications." ON)
OPTION(EMBREE_TUTORIALS "Enable to build Embree tutorials" ON)
IF (EMSCRIPTEN)
SET(EMBREE_ISPC_SUPPORT OFF CACHE BOOL "Build Embree with support for ISPC applications." FORCE)
ENDIF()
SET(EMBREE_API_NAMESPACE "" CACHE STRING "C++ namespace to put API symbols into.")
SET(EMBREE_LIBRARY_NAME "embree${EMBREE_VERSION_MAJOR}" CACHE STRING "Name of the embree library file (default is embree${EMBREE_VERSION_MAJOR})")
@@ -110,6 +126,9 @@ ENDIF()
##############################################################################
# Configurations (add configurations also to common/cmake/embree-config.cmake)
OPTION(EMBREE_ZIP_MODE "Create Embree ZIP package" OFF)
MARK_AS_ADVANCED(EMBREE_ZIP_MODE)
OPTION(EMBREE_INSTALL_DEPENDENCIES "Install Embree dependencies in binary packages and install" OFF)
MARK_AS_ADVANCED(EMBREE_INSTALL_DEPENDENCIES)
@@ -120,6 +139,7 @@ OPTION(EMBREE_RAY_MASK "Enables ray mask support.")
OPTION(EMBREE_BACKFACE_CULLING "Enables backface culling.")
OPTION(EMBREE_FILTER_FUNCTION "Enables filter functions." ON)
OPTION(EMBREE_IGNORE_INVALID_RAYS "Ignores invalid rays." OFF) # FIXME: enable by default?
OPTION(EMBREE_COMPACT_POLYS "Enables double indexed poly layout." OFF)
OPTION(EMBREE_GEOMETRY_TRIANGLE "Enables support for triangle geometries." ON)
OPTION(EMBREE_GEOMETRY_QUAD "Enables support for quad geometries." ON)
@@ -133,8 +153,25 @@ OPTION(EMBREE_RAY_PACKETS "Enabled support for ray packets." ON)
SET(EMBREE_MAX_INSTANCE_LEVEL_COUNT 1 CACHE STRING "Maximum number of instance levels.")
SET(EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR 2.0 CACHE STRING "Self intersection avoidance factor for flat curves. Specify floating point value in range 0 to inf.")
OPTION(EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE "Enables self intersection avoidance for ray oriented discs." ON)
OPTION(EMBREE_MIN_WIDTH "Enables min-width feature to enlarge curve and point thickness to pixel width." OFF)
##############################################################
# Platform detection and defaults
##############################################################
# detect ARM compilation
IF (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64"))
MESSAGE(STATUS "Building for Apple silicon")
SET(EMBREE_ARM ON)
ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
MESSAGE(STATUS "Building for AArch64")
SET(EMBREE_ARM ON)
ENDIF()
SET(EMBREE_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system")
SET(EMBREE_TBB_COMPONENT "tbb" CACHE STRING "The TBB component/library name.")
IF (WIN32)
SET_PROPERTY(CACHE EMBREE_TASKING_SYSTEM PROPERTY STRINGS TBB INTERNAL PPL)
ELSE()
@@ -174,16 +211,32 @@ IF (WIN32)
ENDIF()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
IF (${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM" )
MESSAGE("CLANG detected")
#message ("CMAKE_GENERATOR_TOOLSET: ${CMAKE_GENERATOR_TOOLSET}")
#message ("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
#message ("CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
IF (${CMAKE_CXX_COMPILER} MATCHES ".*dpcpp")
message(FATAL_ERROR "DPCPP compiler not supported on Windows yet. Use ICX instead.")
ENDIF()
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "IntelLLVM" OR
(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND ${CMAKE_CXX_COMPILER} MATCHES ".*icx"))
MESSAGE("-- DPCPP detected")
INCLUDE(dpcpp)
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM")
MESSAGE("-- CLANG detected")
INCLUDE(clang)
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^Intel")
MESSAGE("Intel Compiler detected")
MESSAGE("-- Intel Compiler detected")
INCLUDE (intel)
ELSEIF(${CMAKE_CXX_COMPILER_FRONTEND_VARIANT} MATCHES "GNU")
MESSAGE("-- GNU-like Compiler detected")
INCLUDE(gnu)
ELSE()
IF (EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX)
IF (EMBREE_ISA_AVX512)
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
ENDIF()
MESSAGE("-- MSVC detected")
INCLUDE (msvc)
ENDIF()
@@ -191,8 +244,19 @@ ELSE (WIN32)
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
INCLUDE (crayprgenv)
ELSE()
GET_FILENAME_COMPONENT(CXX_COMPILER_NAME ${CMAKE_CXX_COMPILER} NAME)
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _LOWER_CXX_COMPILER_ID)
STRING(REPLACE "appleclang" "clang" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
STRING(REPLACE "intelllvm" "dpcpp" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
IF(${_LOWER_CXX_COMPILER_ID} MATCHES "clang" AND ${CXX_COMPILER_NAME} MATCHES "icpx")
STRING(REPLACE "clang" "dpcpp" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
ENDIF()
IF(${_LOWER_CXX_COMPILER_ID} MATCHES "clang" AND ${CXX_COMPILER_NAME} MATCHES "dpcpp")
STRING(REPLACE "clang" "dpcpp" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
ENDIF()
STRING(TOUPPER "${_LOWER_CXX_COMPILER_ID}" _UPPER_CXX_COMPILER_ID)
MESSAGE("-- ${_UPPER_CXX_COMPILER_ID} detected")
INCLUDE(${_LOWER_CXX_COMPILER_ID} OPTIONAL RESULT_VARIABLE COMPILER_FOUND)
IF (NOT COMPILER_FOUND)
MESSAGE(FATAL_ERROR "Unsupported compiler: " ${CMAKE_CXX_COMPILER_ID})
@@ -213,57 +277,92 @@ ENDIF (WIN32)
# ISA configuration
##############################################################
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
# just for compatibility with old naming
IF(DEFINED EMBREE_ISA_AVX512SKX)
UNSET(EMBREE_ISA_AVX512 CACHE)
SET(EMBREE_ISA_AVX512 ${EMBREE_ISA_AVX512SKX} CACHE BOOL "")
ENDIF()
TRY_COMPILE(COMPILER_SUPPORTS_ARM_NEON "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/common/cmake/check_arm_neon.cpp")
IF (COMPILER_SUPPORTS_ARM_NEON)
SET(EMBREE_ARM ON)
ENDIF()
IF (CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
SET(EMBREE_MAX_ISA "DEFAULT" CACHE STRING "Selects highest ISA to support.")
ELSEIF (EMSCRIPTEN)
SET(EMBREE_MAX_ISA "SSE2" CACHE STRING "Selects highest ISA to support.")
ELSE()
SET(EMBREE_MAX_ISA "NONE" CACHE STRING "Selects highest ISA to support.")
ENDIF()
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX DEFAULT)
IF (EMBREE_ARM)
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE NEON NEON2X)
ELSE()
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512 DEFAULT)
ENDIF()
IF (EMBREE_MAX_ISA STREQUAL "NONE")
TRY_COMPILE(COMPILER_SUPPORTS_AVX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX})
TRY_COMPILE(COMPILER_SUPPORTS_AVX2 ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX2})
TRY_COMPILE(COMPILER_SUPPORTS_AVX512KNL ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512KNL})
TRY_COMPILE(COMPILER_SUPPORTS_AVX512SKX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512SKX})
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA." ON)
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
IF (WIN32 OR APPLE)
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing." OFF)
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake." OFF)
IF (EMBREE_ARM)
IF (APPLE)
OPTION(EMBREE_ISA_NEON "Enables NEON ISA." OFF)
OPTION(EMBREE_ISA_NEON2X "Enables NEON ISA double pumped." ON)
ELSE()
OPTION(EMBREE_ISA_NEON "Enables NEON ISA." ON)
OPTION(EMBREE_ISA_NEON2X "Enables NEON ISA double pumped." OFF)
ENDIF()
ELSE()
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing." OFF) # compilation on GCC 8 broken
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake." ${COMPILER_SUPPORTS_AVX512SKX})
TRY_COMPILE(COMPILER_SUPPORTS_AVX "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp" COMPILE_DEFINITIONS ${FLAGS_AVX})
TRY_COMPILE(COMPILER_SUPPORTS_AVX2 "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp" COMPILE_DEFINITIONS ${FLAGS_AVX2})
TRY_COMPILE(COMPILER_SUPPORTS_AVX512 "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp" COMPILE_DEFINITIONS ${FLAGS_AVX512})
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA." ON)
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
IF (WIN32 OR APPLE)
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." OFF)
ELSE()
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." ${COMPILER_SUPPORTS_AVX512})
ENDIF()
ENDIF()
ELSEIF (EMBREE_MAX_ISA STREQUAL "DEFAULT")
UNSET(EMBREE_ISA_NEON CACHE)
UNSET(EMBREE_ISA_NEON2X CACHE)
UNSET(EMBREE_ISA_SSE2 CACHE)
UNSET(EMBREE_ISA_SSE42 CACHE)
UNSET(EMBREE_ISA_AVX CACHE)
UNSET(EMBREE_ISA_AVX2 CACHE)
UNSET(EMBREE_ISA_AVX512KNL CACHE)
UNSET(EMBREE_ISA_AVX512SKX CACHE)
UNSET(EMBREE_ISA_AVX512 CACHE)
SET(EMBREE_ISA_NEON OFF)
SET(EMBREE_ISA_NEON2X OFF)
SET(EMBREE_ISA_SSE2 OFF)
SET(EMBREE_ISA_SSE42 OFF)
SET(EMBREE_ISA_AVX OFF)
SET(EMBREE_ISA_AVX2 OFF)
SET(EMBREE_ISA_AVX512KNL OFF)
SET(EMBREE_ISA_AVX512SKX OFF)
SET(EMBREE_ISA_AVX512 OFF)
MESSAGE(STATUS "Detecting default ISA...")
INCLUDE(check_isa_default)
CHECK_ISA_DEFAULT(EMBREE_ISA_DEFAULT)
MESSAGE(STATUS "Detected default ISA: ${EMBREE_ISA_DEFAULT}")
SET(EMBREE_ISA_${EMBREE_ISA_DEFAULT} ON)
ELSE()
UNSET(EMBREE_ISA_NEON CACHE)
UNSET(EMBREE_ISA_NEON2X CACHE)
UNSET(EMBREE_ISA_SSE2 CACHE)
UNSET(EMBREE_ISA_SSE42 CACHE)
UNSET(EMBREE_ISA_AVX CACHE)
UNSET(EMBREE_ISA_AVX2 CACHE)
UNSET(EMBREE_ISA_AVX512KNL CACHE)
UNSET(EMBREE_ISA_AVX512SKX CACHE)
IF(EMBREE_MAX_ISA STREQUAL "SSE2")
UNSET(EMBREE_ISA_AVX512 CACHE)
IF(EMBREE_MAX_ISA STREQUAL "NEON")
SET(ISA 1)
ELSEIF(EMBREE_MAX_ISA STREQUAL "NEON2X")
SET(ISA 2)
ELSEIF(EMBREE_MAX_ISA STREQUAL "SSE2")
SET(ISA 1)
ELSEIF(EMBREE_MAX_ISA STREQUAL "SSE4.2")
SET(ISA 2)
@@ -271,39 +370,46 @@ ELSE()
SET(ISA 3)
ELSEIF(EMBREE_MAX_ISA STREQUAL "AVX2")
SET(ISA 4)
ELSEIF(EMBREE_MAX_ISA STREQUAL "AVX512KNL")
SET(ISA 5)
ELSEIF(EMBREE_MAX_ISA STREQUAL "AVX512SKX")
SET(ISA 6)
ELSEIF(EMBREE_MAX_ISA STREQUAL "AVX512")
SET(ISA 5)
ELSEIF(EMBREE_MAX_ISA STREQUAL "AVX512SKX") # just for compatibility
SET(ISA 5)
ELSE()
MESSAGE(FATAL_ERROR "Unsupported ISA specified: " ${EMBREE_MAX_ISA})
ENDIF()
SET(EMBREE_ISA_NEON OFF)
SET(EMBREE_ISA_NEON2X OFF)
SET(EMBREE_ISA_SSE2 OFF)
SET(EMBREE_ISA_SSE42 OFF)
SET(EMBREE_ISA_AVX OFF)
SET(EMBREE_ISA_AVX2 OFF)
SET(EMBREE_ISA_AVX512KNL OFF)
SET(EMBREE_ISA_AVX512SKX OFF)
SET(EMBREE_ISA_AVX512 OFF)
IF (ISA GREATER 0)
SET(EMBREE_ISA_SSE2 ON)
ENDIF ()
IF (ISA GREATER 1)
SET(EMBREE_ISA_SSE42 ON)
ENDIF ()
IF (ISA GREATER 2)
SET(EMBREE_ISA_AVX ON)
ENDIF ()
IF (ISA GREATER 3)
SET(EMBREE_ISA_AVX2 ON)
ENDIF ()
IF (ISA GREATER 4)
SET(EMBREE_ISA_AVX512KNL ON)
ENDIF ()
IF (ISA GREATER 5)
SET(EMBREE_ISA_AVX512SKX ON)
ENDIF ()
IF (EMBREE_ARM)
IF (ISA GREATER 0)
SET(EMBREE_ISA_NEON ON)
ENDIF ()
IF (ISA GREATER 1)
SET(EMBREE_ISA_NEON2X ON)
ENDIF ()
ELSE()
IF (ISA GREATER 0)
SET(EMBREE_ISA_SSE2 ON)
ENDIF ()
IF (ISA GREATER 1)
SET(EMBREE_ISA_SSE42 ON)
ENDIF ()
IF (ISA GREATER 2)
SET(EMBREE_ISA_AVX ON)
ENDIF ()
IF (ISA GREATER 3)
SET(EMBREE_ISA_AVX2 ON)
ENDIF ()
IF (ISA GREATER 4)
SET(EMBREE_ISA_AVX512 ON)
ENDIF ()
ENDIF()
ENDIF()
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
@@ -314,6 +420,12 @@ IF (APPLE AND EMBREE_STATIC_LIB)
# count number of set ISAs
SET(NUMISA 0)
IF (EMBREE_ISA_NEON)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
IF (EMBREE_ISA_NEON2X)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
IF (EMBREE_ISA_SSE2)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
@@ -326,17 +438,14 @@ IF (APPLE AND EMBREE_STATIC_LIB)
IF (EMBREE_ISA_AVX2)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
IF (EMBREE_ISA_AVX512KNL)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
IF (EMBREE_ISA_AVX512SKX)
IF (EMBREE_ISA_AVX512)
MATH(EXPR NUMISA "${NUMISA}+1")
ENDIF()
IF (NUMISA GREATER 1)
IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
IF (${CMAKE_CXX_COMPILER_VERSION} MATCHES "^9\\..*")
MESSAGE(FATAL_ERROR "Using Embree as static library is not supported with AppleClang 9.X when multiple ISAs are selected. Please either build a shared library or enable only one ISA.")
IF (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "9.0.0" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "9.0.0")
MESSAGE(FATAL_ERROR "Using Embree as static library is not supported with AppleClang >= 9.0 when multiple ISAs are selected. Please either build a shared library or enable only one ISA.")
ENDIF()
ENDIF()
ENDIF()
@@ -350,15 +459,36 @@ SET(SSE2 0)
SET(SSE42 1)
SET(AVX 2)
SET(AVX2 3)
SET(AVX512KNL 4)
SET(AVX512SKX 5)
SET(AVX512 4)
UNSET(FLAGS_LOWEST)
SET(ISA_LOWEST -1)
SET(ISA_LOWEST_AVX 2)
IF (EMBREE_ARM)
IF (EMBREE_ISA_NEON2X)
LIST(APPEND ISPC_TARGETS "neon-i32x8")
ELSEIF (EMBREE_ISA_NEON)
LIST(APPEND ISPC_TARGETS "neon-i32x4")
ENDIF()
ENDIF()
IF (EMBREE_ISA_NEON)
SET(EMBREE_ISA_SSE2 ON)
ENDIF()
IF (EMBREE_ISA_NEON2X)
SET(EMBREE_ISA_SSE2 OFF)
SET(EMBREE_ISA_SSE42 OFF)
SET(EMBREE_ISA_AVX OFF)
SET(EMBREE_ISA_AVX2 ON)
ENDIF()
IF (EMBREE_ISA_SSE2)
ADD_DEFINITIONS(-DEMBREE_TARGET_SSE2)
LIST(APPEND ISPC_TARGETS "sse2")
IF (NOT EMBREE_ARM)
LIST(APPEND ISPC_TARGETS "sse2")
ENDIF()
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${SSE2})
SET(FLAGS_LOWEST ${FLAGS_SSE2})
@@ -367,7 +497,9 @@ ENDIF()
IF (EMBREE_ISA_SSE42)
ADD_DEFINITIONS(-DEMBREE_TARGET_SSE42)
LIST(APPEND ISPC_TARGETS "sse4")
IF (NOT EMBREE_ARM)
LIST(APPEND ISPC_TARGETS "sse4")
ENDIF()
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${SSE42})
SET(FLAGS_LOWEST ${FLAGS_SSE42})
@@ -376,7 +508,9 @@ ENDIF ()
IF (EMBREE_ISA_AVX)
ADD_DEFINITIONS(-DEMBREE_TARGET_AVX)
LIST(APPEND ISPC_TARGETS "avx")
IF (NOT EMBREE_ARM)
LIST(APPEND ISPC_TARGETS "avx")
ENDIF()
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX})
SET(ISA_LOWEST_AVX ${AVX})
@@ -386,7 +520,9 @@ ENDIF ()
IF (EMBREE_ISA_AVX2)
ADD_DEFINITIONS(-DEMBREE_TARGET_AVX2)
LIST(APPEND ISPC_TARGETS "avx2")
IF (NOT EMBREE_ARM)
LIST(APPEND ISPC_TARGETS "avx2")
ENDIF()
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX2})
SET(ISA_LOWEST_AVX ${AVX2})
@@ -394,25 +530,21 @@ IF (EMBREE_ISA_AVX2)
ENDIF()
ENDIF ()
IF (EMBREE_ISA_AVX512KNL)
ADD_DEFINITIONS(-DEMBREE_TARGET_AVX512KNL)
LIST(APPEND ISPC_TARGETS "avx512knl-i32x16")
IF (EMBREE_ISA_AVX512)
ADD_DEFINITIONS(-DEMBREE_TARGET_AVX512)
IF (NOT EMBREE_ARM)
LIST(APPEND ISPC_TARGETS "avx512skx-i32x16")
ENDIF()
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX512KNL})
SET(ISA_LOWEST_AVX ${AVX512KNL})
SET(FLAGS_LOWEST ${FLAGS_AVX512KNL})
SET(ISA_LOWEST ${AVX512})
SET(ISA_LOWEST_AVX ${AVX512})
SET(FLAGS_LOWEST ${FLAGS_AVX512})
ENDIF()
ENDIF ()
IF (EMBREE_ISA_AVX512SKX)
ADD_DEFINITIONS(-DEMBREE_TARGET_AVX512SKX)
LIST(APPEND ISPC_TARGETS "avx512skx-i32x16")
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX512SKX})
SET(ISA_LOWEST_AVX ${AVX512SKX})
SET(FLAGS_LOWEST ${FLAGS_AVX512SKX})
ENDIF()
ENDIF ()
IF (ISA_LOWEST EQUAL -1)
MESSAGE(FATAL_ERROR "You have to enable at least one ISA!")
ENDIF()
INCLUDE (ispc)
@@ -448,13 +580,6 @@ CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/export.macosx.map"
)
##############################################################
# Search paths
##############################################################
IF (TASKING_TBB)
FIND_PACKAGE(TBB REQUIRED)
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS})
ENDIF()
##############################################################
# Output paths
@@ -477,15 +602,17 @@ ENDIF()
# Uninstall
##############################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/common/cmake/uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY)
IF (NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/common/cmake/uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake")
SET_PROPERTY(TARGET uninstall PROPERTY FOLDER CMakePredefinedTargets)
SET_PROPERTY(TARGET uninstall PROPERTY FOLDER CMakePredefinedTargets)
ENDIF()
##############################################################
# Has to be last
+2 -2
View File
@@ -1,5 +1,5 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
set(CTEST_PROJECT_NAME "Embree")
set(TEST_MODELS_HASH 9f7aa420e2f931c51c8a72a812da0631d04f9ed9)
set(TEST_MODELS_HASH 866df160e2cc1074d68677e1e6e4135f8c324995)
+681 -416
View File
File diff suppressed because it is too large Load Diff
+14
View File
@@ -0,0 +1,14 @@
Security Policy
===============
Intel is committed to rapidly addressing security vulnerabilities
affecting our customers and providing clear guidance on the solution,
impact, severity and mitigation.
Reporting a Vulnerability
-------------------------
Please [report any security vulnerabilities][guidelines] in this project
utilizing the [guidelines here][guidelines].
[guidelines]: https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html "Vulnerability Handling Guidelines"
+2 -3
View File
@@ -1,9 +1,8 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ADD_SUBDIRECTORY(sys)
ADD_SUBDIRECTORY(math)
ADD_SUBDIRECTORY(simd)
ADD_SUBDIRECTORY(lexers)
ADD_SUBDIRECTORY(tasking)
ADD_SUBDIRECTORY(algorithms)
ADD_SUBDIRECTORY(tasking)
-18
View File
@@ -1,18 +0,0 @@
## Copyright 2009-2020 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ADD_LIBRARY(algorithms OBJECT
parallel_for.cpp
parallel_reduce.cpp
parallel_prefix_sum.cpp
parallel_for_for.cpp
parallel_for_for_prefix_sum.cpp
parallel_partition.cpp
parallel_sort.cpp
parallel_set.cpp
parallel_map.cpp
parallel_filter.cpp
)
SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common)
SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
+41 -29
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -8,36 +8,48 @@
namespace embree
{
template<typename Index, class UnaryPredicate>
template<typename Index, class UnaryPredicate>
__forceinline bool parallel_any_of (Index first, Index last, UnaryPredicate pred)
{
bool ret = false;
{
bool ret = false;
#if defined(TASKING_TBB)
tbb::parallel_for(tbb::blocked_range<size_t>{first, last}, [&ret,pred](const tbb::blocked_range<size_t>& r) {
if (tbb::task::self().is_cancelled()) return;
for (size_t i = r.begin(); i != r.end(); ++i) {
if (pred(i)) {
ret = true;
tbb::task::self().cancel_group_execution();
}
}
});
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
tbb::parallel_for(tbb::blocked_range<size_t>{first, last}, [&ret,pred,&context](const tbb::blocked_range<size_t>& r) {
if (context.is_group_execution_cancelled()) return;
for (size_t i = r.begin(); i != r.end(); ++i) {
if (pred(i)) {
ret = true;
context.cancel_group_execution();
}
}
});
#else
ret = parallel_reduce (first, last, false,
[pred](const range<size_t>& r)->bool {
bool localret = false;
for (auto i=r.begin(); i<r.end(); ++i) {
localret |= pred(i);
}
return localret;
},
std::bit_or<bool>()
);
tbb::parallel_for(tbb::blocked_range<size_t>{first, last}, [&ret,pred](const tbb::blocked_range<size_t>& r) {
if (tbb::task::self().is_cancelled()) return;
for (size_t i = r.begin(); i != r.end(); ++i) {
if (pred(i)) {
ret = true;
tbb::task::self().cancel_group_execution();
}
}
});
#endif
return ret;
}
#else
ret = parallel_reduce (first, last, false, [pred](const range<size_t>& r)->bool {
bool localret = false;
for (auto i=r.begin(); i<r.end(); ++i) {
localret |= pred(i);
}
return localret;
},
std::bit_or<bool>()
);
#endif
return ret;
}
} // end namespace
-56
View File
@@ -1,56 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_filter.h"
#include "../sys/regression.h"
#include <map>
namespace embree
{
struct parallel_filter_regression_test : public RegressionTest
{
parallel_filter_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
auto pred = [&]( uint32_t v ) { return (v & 0x3) == 0; };
for (size_t N=10; N<1000000; N=size_t(2.1*N))
{
size_t N0 = rand() % N;
/* initialize array with random numbers */
std::vector<uint32_t> src(N);
std::map<uint32_t,int> m;
for (size_t i=0; i<N; i++) src[i] = rand();
/* count elements up */
for (size_t i=N0; i<N; i++)
if (pred(src[i]))
m[src[i]] = 0;
for (size_t i=N0; i<N; i++)
if (pred(src[i]))
m[src[i]]++;
/* filter array */
//size_t M = sequential_filter(src.data(),N0,N,pred);
size_t M = parallel_filter(src.data(),N0,N,size_t(1024),pred);
/* check if filtered data is correct */
for (size_t i=N0; i<M; i++) {
passed &= pred(src[i]);
m[src[i]]--;
}
for (size_t i=N0; i<M; i++)
passed &= (m[src[i]] == 0);
}
return passed;
}
};
parallel_filter_regression_test parallel_filter_regression("parallel_filter_regression");
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
-48
View File
@@ -1,48 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_for.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_for_regression_test : public RegressionTest
{
parallel_for_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
const size_t M = 10;
for (size_t N=10; N<10000000; N=size_t(2.1*N))
{
/* sequentially calculate sum of squares */
size_t sum0 = 0;
for (size_t i=0; i<N; i++) {
sum0 += i*i;
}
/* parallel calculation of sum of squares */
for (size_t m=0; m<M; m++)
{
std::atomic<size_t> sum1(0);
parallel_for( size_t(0), size_t(N), size_t(1024), [&](const range<size_t>& r)
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++)
s += i*i;
sum1 += s;
});
passed = sum0 == sum1;
}
}
return passed;
}
};
parallel_for_regression_test parallel_for_regression("parallel_for_regression_test");
}
+50 -15
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -23,13 +23,21 @@ namespace embree
if (!TaskScheduler::wait())
throw std::runtime_error("task cancelled");
}
#elif defined(TASKING_TBB)
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},context);
if (context.is_group_execution_cancelled())
throw std::runtime_error("task cancelled");
#else
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
});
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#endif
#elif defined(TASKING_PPL)
concurrency::parallel_for(Index(0),N,Index(1),[&](Index i) {
@@ -51,11 +59,20 @@ namespace embree
throw std::runtime_error("task cancelled");
#elif defined(TASKING_TBB)
tbb::parallel_for(tbb::blocked_range<Index>(first,last,minStepSize),[&](const tbb::blocked_range<Index>& r) {
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
tbb::parallel_for(tbb::blocked_range<Index>(first,last,minStepSize),[&](const tbb::blocked_range<Index>& r) {
func(range<Index>(r.begin(),r.end()));
},context);
if (context.is_group_execution_cancelled())
throw std::runtime_error("task cancelled");
#else
tbb::parallel_for(tbb::blocked_range<Index>(first,last,minStepSize),[&](const tbb::blocked_range<Index>& r) {
func(range<Index>(r.begin(),r.end()));
});
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#endif
#elif defined(TASKING_PPL)
concurrency::parallel_for(first, last, Index(1) /*minStepSize*/, [&](Index i) {
@@ -80,11 +97,20 @@ namespace embree
template<typename Index, typename Func>
__forceinline void parallel_for_static( const Index N, const Func& func)
{
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},tbb::simple_partitioner());
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},tbb::simple_partitioner(),context);
if (context.is_group_execution_cancelled())
throw std::runtime_error("task cancelled");
#else
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},tbb::simple_partitioner());
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#endif
}
typedef tbb::affinity_partitioner affinity_partitioner;
@@ -92,11 +118,20 @@ namespace embree
template<typename Index, typename Func>
__forceinline void parallel_for_affinity( const Index N, const Func& func, tbb::affinity_partitioner& ap)
{
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},ap);
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},ap,context);
if (context.is_group_execution_cancelled())
throw std::runtime_error("task cancelled");
#else
tbb::parallel_for(Index(0),N,Index(1),[&](Index i) {
func(i);
},ap);
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
#endif
}
#else
-63
View File
@@ -1,63 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_for_for.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_for_for_regression_test : public RegressionTest
{
parallel_for_for_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
/* create vector with random numbers */
size_t sum0 = 0;
size_t K = 0;
const size_t M = 1000;
std::vector<std::vector<size_t>* > array2(M);
for (size_t i=0; i<M; i++) {
const size_t N = rand() % 1024;
K+=N;
array2[i] = new std::vector<size_t>(N);
for (size_t j=0; j<N; j++)
sum0 += (*array2[i])[j] = rand();
}
/* array to test global index */
std::vector<atomic<size_t>> verify_k(K);
for (size_t i=0; i<K; i++) verify_k[i].store(0);
/* add all numbers using parallel_for_for */
std::atomic<size_t> sum1(0);
parallel_for_for( array2, size_t(1), [&](std::vector<size_t>* v, const range<size_t>& r, size_t k) -> size_t
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++) {
s += (*v)[i];
verify_k[k++]++;
}
sum1 += s;
return sum1;
});
passed &= (sum0 == sum1);
/* check global index */
for (size_t i=0; i<K; i++)
passed &= (verify_k[i] == 1);
/* delete vectors again */
for (size_t i=0; i<array2.size(); i++)
delete array2[i];
return passed;
}
};
parallel_for_for_regression_test parallel_for_for_regression("parallel_for_for_regression_test");
}
+18 -7
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -30,15 +30,20 @@ namespace embree
template<typename ArrayArray>
__forceinline ParallelForForState (ArrayArray& array2, const size_t minStepSize) {
init(array2,minStepSize);
}
template<typename SizeFunc>
__forceinline ParallelForForState (const size_t numArrays, const SizeFunc& getSize, const size_t minStepSize) {
init(numArrays,getSize,minStepSize);
}
template<typename ArrayArray>
__forceinline void init ( ArrayArray& array2, const size_t minStepSize )
template<typename SizeFunc>
__forceinline void init ( const size_t numArrays, const SizeFunc& getSize, const size_t minStepSize )
{
/* first calculate total number of elements */
size_t N = 0;
for (size_t i=0; i<array2.size(); i++) {
N += array2[i] ? array2[i]->size() : 0;
for (size_t i=0; i<numArrays; i++) {
N += getSize(i);
}
this->N = N;
@@ -54,8 +59,8 @@ namespace embree
size_t k0 = (++taskIndex)*N/taskCount;
for (size_t i=0, k=0; taskIndex < taskCount; i++)
{
assert(i<array2.size());
size_t j=0, M = array2[i] ? array2[i]->size() : 0;
assert(i<numArrays);
size_t j=0, M = getSize(i);
while (j<M && k+M-j >= k0 && taskIndex < taskCount) {
assert(taskIndex<taskCount);
i0[taskIndex] = i;
@@ -67,6 +72,12 @@ namespace embree
}
}
template<typename ArrayArray>
__forceinline void init ( ArrayArray& array2, const size_t minStepSize )
{
init(array2.size(),[&](size_t i) { return array2[i] ? array2[i]->size() : 0; },minStepSize);
}
__forceinline size_t size() const {
return N;
}
@@ -1,85 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_for_for_prefix_sum.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_for_for_prefix_sum_regression_test : public RegressionTest
{
parallel_for_for_prefix_sum_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
/* create vector with random numbers */
const size_t M = 10;
std::vector<atomic<size_t>> flattened;
typedef std::vector<std::vector<size_t>* > ArrayArray;
ArrayArray array2(M);
size_t K = 0;
for (size_t i=0; i<M; i++) {
const size_t N = rand() % 10;
K += N;
array2[i] = new std::vector<size_t>(N);
for (size_t j=0; j<N; j++)
(*array2[i])[j] = rand() % 10;
}
/* array to test global index */
std::vector<atomic<size_t>> verify_k(K);
for (size_t i=0; i<K; i++) verify_k[i].store(0);
ParallelForForPrefixSumState<size_t> state(array2,size_t(1));
/* dry run only counts */
size_t S = parallel_for_for_prefix_sum0( state, array2, size_t(0), [&](std::vector<size_t>* v, const range<size_t>& r, size_t k, size_t i) -> size_t
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++) {
s += (*v)[i];
verify_k[k++]++;
}
return s;
}, [](size_t v0, size_t v1) { return v0+v1; });
/* create properly sized output array */
flattened.resize(S);
for (auto& a : flattened) a.store(0);
/* now we actually fill the flattened array */
parallel_for_for_prefix_sum1( state, array2, size_t(0), [&](std::vector<size_t>* v, const range<size_t>& r, size_t k, size_t i, const size_t base) -> size_t
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++) {
for (size_t j=0; j<(*v)[i]; j++) {
flattened[base+s+j]++;
}
s += (*v)[i];
verify_k[k++]++;
}
return s;
}, [](size_t v0, size_t v1) { return v0+v1; });
/* check global index */
for (size_t i=0; i<K; i++)
passed &= (verify_k[i] == 2);
/* check if each element was assigned exactly once */
for (size_t i=0; i<flattened.size(); i++)
passed &= (flattened[i] == 1);
/* delete arrays again */
for (size_t i=0; i<array2.size(); i++)
delete array2[i];
return passed;
}
};
parallel_for_for_prefix_sum_regression_test parallel_for_for_prefix_sum_regression("parallel_for_for_prefix_sum_regression_test");
}
+70 -40
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -17,12 +17,56 @@ namespace embree
__forceinline ParallelForForPrefixSumState (ArrayArray& array2, const size_t minStepSize)
: ParallelForForState(array2,minStepSize) {}
template<typename SizeFunc>
__forceinline ParallelForForPrefixSumState (size_t numArrays, const SizeFunc& getSize, const size_t minStepSize)
: ParallelForForState(numArrays,getSize,minStepSize) {}
ParallelPrefixSumState<Value> prefix_state;
};
template<typename ArrayArray, typename Index, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum0( ParallelForForPrefixSumState<Value>& state, ArrayArray& array2, Index minStepSize,
const Value& identity, const Func& func, const Reduction& reduction)
template<typename SizeFunc, typename Index, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum0_( ParallelForForPrefixSumState<Value>& state, Index minStepSize,
const SizeFunc& getSize, const Value& identity, const Func& func, const Reduction& reduction)
{
/* calculate number of tasks to use */
const size_t taskCount = state.taskCount;
/* perform parallel prefix sum */
parallel_for(taskCount, [&](const size_t taskIndex)
{
const size_t k0 = (taskIndex+0)*state.size()/taskCount;
const size_t k1 = (taskIndex+1)*state.size()/taskCount;
size_t i0 = state.i0[taskIndex];
size_t j0 = state.j0[taskIndex];
/* iterate over arrays */
size_t k=k0;
Value N=identity;
for (size_t i=i0; k<k1; i++) {
const size_t size = getSize(i);
const size_t r0 = j0, r1 = min(size,r0+k1-k);
if (r1 > r0) N = reduction(N, func((Index)i,range<Index>((Index)r0,(Index)r1),(Index)k));
k+=r1-r0; j0 = 0;
}
state.prefix_state.counts[taskIndex] = N;
});
/* calculate prefix sum */
Value sum=identity;
for (size_t i=0; i<taskCount; i++)
{
const Value c = state.prefix_state.counts[i];
state.prefix_state.sums[i] = sum;
sum=reduction(sum,c);
}
return sum;
}
template<typename SizeFunc, typename Index, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum1_( ParallelForForPrefixSumState<Value>& state, Index minStepSize,
const SizeFunc& getSize,
const Value& identity, const Func& func, const Reduction& reduction)
{
/* calculate number of tasks to use */
const size_t taskCount = state.taskCount;
@@ -38,9 +82,9 @@ namespace embree
size_t k=k0;
Value N=identity;
for (size_t i=i0; k<k1; i++) {
const size_t size = array2[i] ? array2[i]->size() : 0;
const size_t size = getSize(i);
const size_t r0 = j0, r1 = min(size,r0+k1-k);
if (r1 > r0) N = reduction(N, func(array2[i],range<Index>((Index)r0,(Index)r1),(Index)k,(Index)i));
if (r1 > r0) N = reduction(N, func((Index)i,range<Index>((Index)r0,(Index)r1),(Index)k,reduction(state.prefix_state.sums[taskIndex],N)));
k+=r1-r0; j0 = 0;
}
state.prefix_state.counts[taskIndex] = N;
@@ -59,43 +103,29 @@ namespace embree
}
template<typename ArrayArray, typename Index, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum1( ParallelForForPrefixSumState<Value>& state, ArrayArray& array2, Index minStepSize,
const Value& identity, const Func& func, const Reduction& reduction)
__forceinline Value parallel_for_for_prefix_sum0( ParallelForForPrefixSumState<Value>& state,
ArrayArray& array2, Index minStepSize,
const Value& identity, const Func& func, const Reduction& reduction)
{
/* calculate number of tasks to use */
const size_t taskCount = state.taskCount;
/* perform parallel prefix sum */
parallel_for(taskCount, [&](const size_t taskIndex)
{
const size_t k0 = (taskIndex+0)*state.size()/taskCount;
const size_t k1 = (taskIndex+1)*state.size()/taskCount;
size_t i0 = state.i0[taskIndex];
size_t j0 = state.j0[taskIndex];
/* iterate over arrays */
size_t k=k0;
Value N=identity;
for (size_t i=i0; k<k1; i++) {
const size_t size = array2[i] ? array2[i]->size() : 0;
const size_t r0 = j0, r1 = min(size,r0+k1-k);
if (r1 > r0) N = reduction(N, func(array2[i],range<Index>((Index)r0,(Index)r1),(Index)k,(Index)i,reduction(state.prefix_state.sums[taskIndex],N)));
k+=r1-r0; j0 = 0;
}
state.prefix_state.counts[taskIndex] = N;
});
/* calculate prefix sum */
Value sum=identity;
for (size_t i=0; i<taskCount; i++)
{
const Value c = state.prefix_state.counts[i];
state.prefix_state.sums[i] = sum;
sum=reduction(sum,c);
}
return sum;
return parallel_for_for_prefix_sum0_(state,minStepSize,
[&](Index i) { return array2[i] ? array2[i]->size() : 0; },
identity,
[&](Index i, const range<Index>& r, Index k) { return func(array2[i], r, k, i); },
reduction);
}
template<typename ArrayArray, typename Index, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum1( ParallelForForPrefixSumState<Value>& state,
ArrayArray& array2, Index minStepSize,
const Value& identity, const Func& func, const Reduction& reduction)
{
return parallel_for_for_prefix_sum1_(state,minStepSize,
[&](Index i) { return array2[i] ? array2[i]->size() : 0; },
identity,
[&](Index i, const range<Index>& r, Index k, const Value& base) { return func(array2[i], r, k, i, base); },
reduction);
}
template<typename ArrayArray, typename Value, typename Func, typename Reduction>
__forceinline Value parallel_for_for_prefix_sum0( ParallelForForPrefixSumState<Value>& state, ArrayArray& array2,
const Value& identity, const Func& func, const Reduction& reduction)
-47
View File
@@ -1,47 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_map.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_map_regression_test : public RegressionTest
{
parallel_map_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
/* create key/value vectors with random numbers */
const size_t N = 10000;
std::vector<uint32_t> keys(N);
std::vector<uint32_t> vals(N);
for (size_t i=0; i<N; i++) keys[i] = 2*unsigned(i)*647382649;
for (size_t i=0; i<N; i++) std::swap(keys[i],keys[rand()%N]);
for (size_t i=0; i<N; i++) vals[i] = 2*rand();
/* create map */
parallel_map<uint32_t,uint32_t> map;
map.init(keys,vals);
/* check that all keys are properly mapped */
for (size_t i=0; i<N; i++) {
const uint32_t* val = map.lookup(keys[i]);
passed &= val && (*val == vals[i]);
}
/* check that these keys are not in the map */
for (size_t i=0; i<N; i++) {
passed &= !map.lookup(keys[i]+1);
}
return passed;
}
};
parallel_map_regression_test parallel_map_regression("parallel_map_regression_test");
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
-53
View File
@@ -1,53 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_partition.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_partition_regression_test : public RegressionTest
{
parallel_partition_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
for (size_t i=0; i<100; i++)
{
/* create random permutation */
size_t N = std::rand() % 1000000;
std::vector<unsigned> array(N);
for (unsigned i=0; i<N; i++) array[i] = i;
for (auto& v : array) std::swap(v,array[std::rand()%array.size()]);
size_t split = std::rand() % (N+1);
/* perform parallel partitioning */
size_t left_sum = 0, right_sum = 0;
size_t mid = parallel_partitioning(array.data(),0,array.size(),0,left_sum,right_sum,
[&] ( size_t i ) { return i < split; },
[] ( size_t& sum, unsigned v) { sum += v; },
[] ( size_t& sum, size_t v) { sum += v; },
128);
/*serial_partitioning(array.data(),0,array.size(),left_sum,right_sum,
[&] ( size_t i ) { return i < split; },
[] ( size_t& left_sum, int v) { left_sum += v; });*/
/* verify result */
passed &= mid == split;
passed &= left_sum == split*(split-1)/2;
passed &= right_sum == N*(N-1)/2-left_sum;
for (size_t i=0; i<split; i++) passed &= array[i] < split;
for (size_t i=split; i<N; i++) passed &= array[i] >= split;
}
return passed;
}
};
parallel_partition_regression_test parallel_partition_regression("parallel_partition_regression_test");
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
-48
View File
@@ -1,48 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_prefix_sum.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_prefix_sum_regression_test : public RegressionTest
{
parallel_prefix_sum_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
const size_t M = 10;
for (size_t N=10; N<10000000; N=size_t(2.1*N))
{
/* initialize array with random numbers */
uint32_t sum0 = 0;
std::vector<uint32_t> src(N);
for (size_t i=0; i<N; i++) {
sum0 += src[i] = rand();
}
/* calculate parallel prefix sum */
std::vector<uint32_t> dst(N);
for (auto& v : dst) v = 0;
for (size_t i=0; i<M; i++) {
uint32_t sum1 = parallel_prefix_sum(src,dst,N,0,std::plus<uint32_t>());
passed &= (sum0 == sum1);
}
/* check if prefix sum is correct */
for (size_t i=0, sum=0; i<N; sum+=src[i++])
passed &= ((uint32_t)sum == dst[i]);
}
return passed;
}
};
parallel_prefix_sum_regression_test parallel_prefix_sum_regression("parallel_prefix_sum_regression");
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
-49
View File
@@ -1,49 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_reduce.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_reduce_regression_test : public RegressionTest
{
parallel_reduce_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
const size_t M = 10;
for (size_t N=10; N<10000000; N=size_t(2.1*N))
{
/* sequentially calculate sum of squares */
size_t sum0 = 0;
for (size_t i=0; i<N; i++) {
sum0 += i*i;
}
/* parallel calculation of sum of squares */
for (size_t m=0; m<M; m++)
{
size_t sum1 = parallel_reduce( size_t(0), size_t(N), size_t(1024), size_t(0), [&](const range<size_t>& r) -> size_t
{
size_t s = 0;
for (size_t i=r.begin(); i<r.end(); i++)
s += i*i;
return s;
},
[](const size_t v0, const size_t v1) {
return v0+v1;
});
passed = sum0 == sum1;
}
}
return passed;
}
};
parallel_reduce_regression_test parallel_reduce_regression("parallel_reduce_regression_test");
}
+12 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -26,7 +26,7 @@ namespace embree
const Index threadCount = (Index) TaskScheduler::threadCount();
taskCount = min(taskCount,threadCount,maxTasks);
/* parallel invokation of all tasks */
/* parallel invocation of all tasks */
dynamic_large_stack_array(Value,values,taskCount,8192); // consumes at most 8192 bytes on the stack
parallel_for(taskCount, [&](const Index taskIndex) {
const Index k0 = first+(taskIndex+0)*(last-first)/taskCount;
@@ -53,12 +53,22 @@ namespace embree
return parallel_reduce_internal(taskCount,first,last,minStepSize,identity,func,reduction);
#elif defined(TASKING_TBB)
#if TBB_INTERFACE_VERSION >= 12002
tbb::task_group_context context;
const Value v = tbb::parallel_reduce(tbb::blocked_range<Index>(first,last,minStepSize),identity,
[&](const tbb::blocked_range<Index>& r, const Value& start) { return reduction(start,func(range<Index>(r.begin(),r.end()))); },
reduction,context);
if (context.is_group_execution_cancelled())
throw std::runtime_error("task cancelled");
return v;
#else
const Value v = tbb::parallel_reduce(tbb::blocked_range<Index>(first,last,minStepSize),identity,
[&](const tbb::blocked_range<Index>& r, const Value& start) { return reduction(start,func(range<Index>(r.begin(),r.end()))); },
reduction);
if (tbb::task::self().is_cancelled())
throw std::runtime_error("task cancelled");
return v;
#endif
#else // TASKING_PPL
struct AlignedValue
{
-43
View File
@@ -1,43 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_set.h"
#include "../sys/regression.h"
namespace embree
{
struct parallel_set_regression_test : public RegressionTest
{
parallel_set_regression_test(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
/* create vector with random numbers */
const size_t N = 10000;
std::vector<uint32_t> unsorted(N);
for (size_t i=0; i<N; i++) unsorted[i] = 2*rand();
/* created set from numbers */
parallel_set<uint32_t> sorted;
sorted.init(unsorted);
/* check that all elements are in the set */
for (size_t i=0; i<N; i++) {
passed &= sorted.lookup(unsorted[i]);
}
/* check that these elements are not in the set */
for (size_t i=0; i<N; i++) {
passed &= !sorted.lookup(unsorted[i]+1);
}
return passed;
}
};
parallel_set_regression_test parallel_set_regression("parallel_set_regression_test");
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
-50
View File
@@ -1,50 +0,0 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "parallel_sort.h"
#include "../sys/regression.h"
namespace embree
{
template<typename Key>
struct RadixSortRegressionTest : public RegressionTest
{
RadixSortRegressionTest(const char* name) : RegressionTest(name) {
registerRegressionTest(this);
}
bool run ()
{
bool passed = true;
const size_t M = 10;
for (size_t N=10; N<1000000; N=size_t(2.1*N))
{
std::vector<Key> src(N); memset(src.data(),0,N*sizeof(Key));
std::vector<Key> tmp(N); memset(tmp.data(),0,N*sizeof(Key));
for (size_t i=0; i<N; i++) src[i] = uint64_t(rand())*uint64_t(rand());
/* calculate checksum */
Key sum0 = 0; for (size_t i=0; i<N; i++) sum0 += src[i];
/* sort numbers */
for (size_t i=0; i<M; i++) {
radix_sort<Key>(src.data(),tmp.data(),N);
}
/* calculate checksum */
Key sum1 = 0; for (size_t i=0; i<N; i++) sum1 += src[i];
if (sum0 != sum1) passed = false;
/* check if numbers are sorted */
for (size_t i=1; i<N; i++)
passed &= src[i-1] <= src[i];
}
return passed;
}
};
RadixSortRegressionTest<uint32_t> test_u32("RadixSortRegressionTestU32");
RadixSortRegressionTest<uint64_t> test_u64("RadixSortRegressionTestU64");
}
+3 -3
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -320,7 +320,7 @@ namespace embree
#pragma nounroll
#endif
for (size_t i=startID; i<endID; i++) {
#if defined(__X86_64__)
#if defined(__64BIT__)
const size_t index = ((size_t)(Key)src[i] >> (size_t)shift) & (size_t)mask;
#else
const Key index = ((Key)src[i] >> shift) & mask;
@@ -382,7 +382,7 @@ namespace embree
#endif
for (size_t i=startID; i<endID; i++) {
const Ty elt = src[i];
#if defined(__X86_64__)
#if defined(__64BIT__)
const size_t index = ((size_t)(Key)src[i] >> (size_t)shift) & (size_t)mask;
#else
const size_t index = ((Key)src[i] >> shift) & mask;
+2 -2
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF (NOT OPENIMAGEIO_ROOT)
@@ -36,7 +36,7 @@ FIND_PATH(OPENIMAGEIO_ROOT include/OpenImageIO/imageio.h
DOC "Root of OpenImageIO installation"
HINTS ${OPENIMAGEIO_ROOT}
PATHS
${PROJECT_SOURCE_DIR}/oiio
"${PROJECT_SOURCE_DIR}/oiio"
/usr/local
/usr
/
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
FIND_PATH( PNG_INCLUDE_DIR NAMES png.h )
+437 -295
View File
@@ -1,49 +1,297 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
#===============================================================================
# This script will attempt to find TBB and set up a TBB target.
#
# The user may specify a version and lists of required and optional components:
#
# find_package(TBB 2017.0 EXACT REQUIRED
# tbb tbbmalloc
# OPTIONAL_COMPONENTS tbbmalloc_proxy
# QUIET)
#
# If this target exists already, the script will attempt to re-use it, but fail
# if version or components do not match the user-specified requirements.
#
# If all the required component targets (e.g. TBB::tbb) exist, the script will
# attempt to create a target TBB and link existing component targets to it.
# It will fail if the component target version does not match the user-specified
# requirements.
#
# The user may specify the following variables to help the search process:
# - TBB_ROOT
# - TBB_INCLUDE_DIR
#
# After the script has run successfully, there is a target TBB, as well as
# component targets TBB::<COMPONENT>, e.g. TBB::tbbmalloc.
#
# The targets will attempt to link to release versions of TBB in release mode,
# and debug versions in debug mode.
#
# In addition to the targets, the script defines:
#
# TBB_FOUND
# TBB_INCLUDE_DIRS
#
#===============================================================================
macro(find_tbb TARGET
ROOT_VAR
INCLUDE_DIR_VAR
BIN_DIR_VAR
LIB_DIR_VAR
TBB_LIBRARY_VAR
TBBMALLOC_LIBRARY_VAR
TBB_LIBRARY_NAME
TBBMALLOC_LIBRARY_NAME)
# We use INTERFACE libraries, which are only supported in 3.x
cmake_minimum_required(VERSION 3.1)
if(${ROOT_VAR})
message(STATUS "Looking for ${TARGET} (${TBB_LIBRARY_NAME}, ${TBBMALLOC_LIBRARY_NAME})"
" in ${${ROOT_VAR}}")
# These two are used to automatically find the root and include directories.
set(_TBB_INCLUDE_SUBDIR "include")
set(_TBB_HEADER "tbb/tbb.h")
# Initialize cache variable; but use existing non-cache variable as the default,
# and fall back to the environment variable.
if (NOT TBB_ROOT)
set(TBB_ROOT "$ENV{TBB_ROOT}")
endif()
set(TBB_ROOT "${TBB_ROOT}" CACHE PATH "The root path of TBB.")
#===============================================================================
# Error messages that respect the user's wishes about peace and quiet.
#===============================================================================
function(rk_tbb_status)
if (NOT TBB_FIND_QUIETLY)
message(STATUS "${ARGV}")
endif()
endfunction()
function(rk_tbb_warning)
if (NOT TBB_FIND_QUIETLY)
message(WARNING "${ARGV}")
endif()
endfunction()
macro(rk_tbb_error)
if (TBB_FIND_REQUIRED)
message(FATAL_ERROR "${ARGV}")
else()
message(STATUS "Looking for ${TARGET} (${TBB_LIBRARY_NAME}, ${TBBMALLOC_LIBRARY_NAME})"
" in standard locations")
rk_tbb_warning("${ARGV}")
endif()
return()
endmacro()
#===============================================================================
# Extract a list of required and optional components.
#===============================================================================
macro(rk_tbb_list_components)
# cmake provides the TBB_FIND_COMPONENTS and
# TBB_FIND_REQUIRED_<C> variables based on the invocation
# of find_package.
if (TBB_FIND_COMPONENTS STREQUAL "")
set(_REQUIRED_COMPONENTS "tbb")
set(_OPTIONAL_COMPONENTS "tbbmalloc"
"tbbmalloc_proxy"
"tbbbind"
"tbbpreview")
else()
set(_REQUIRED_COMPONENTS "")
set(_OPTIONAL_COMPONENTS "")
foreach (C IN LISTS TBB_FIND_COMPONENTS)
if (${TBB_FIND_REQUIRED_${C}})
list(APPEND _REQUIRED_COMPONENTS ${C})
else()
list(APPEND _OPTIONAL_COMPONENTS ${C})
endif()
endforeach()
endif()
if(WIN32)
# workaround for parentheses in variable name / CMP0053
set(PROGRAMFILESx86 "PROGRAMFILES(x86)")
set(PROGRAMFILES32 "$ENV{${PROGRAMFILESx86}}")
if(NOT PROGRAMFILES32)
set(PROGRAMFILES32 "$ENV{PROGRAMFILES}")
endif()
if(NOT PROGRAMFILES32)
set(PROGRAMFILES32 "C:/Program Files (x86)")
endif()
find_path(${ROOT_VAR} include/tbb/tbb.h
DOC "Root of ${TBB_LIBRARY_NAME} installation"
PATHS ${PROJECT_SOURCE_DIR}/tbb
NO_DEFAULT_PATH
)
find_path(${ROOT_VAR} include/tbb/tbb.h
DOC "Root of ${TBB_LIBRARY_NAME} installation"
PATHS
${PROJECT_SOURCE_DIR}/../tbb
"${PROGRAMFILES32}/IntelSWTools/compilers_and_libraries/windows/tbb"
"${PROGRAMFILES32}/Intel/Composer XE/tbb"
"${PROGRAMFILES32}/Intel/compilers_and_libraries/windows/tbb"
)
rk_tbb_status("Looking for TBB components ${_REQUIRED_COMPONENTS}"
" (${_OPTIONAL_COMPONENTS})")
endmacro()
#===============================================================================
# List components that are available, and check if any REQUIRED components
# are missing.
#===============================================================================
macro(rk_tbb_check_components)
set(_TBB_MISSING_COMPONENTS "")
set(_TBB_AVAILABLE_COMPONENTS "")
foreach (C IN LISTS _REQUIRED_COMPONENTS)
if (TARGET TBB::${C})
list(APPEND _TBB_AVAILABLE_COMPONENTS ${C})
else()
list(APPEND _TBB_MISSING_COMPONENTS ${C})
endif()
endforeach()
foreach (C IN LISTS _OPTIONAL_COMPONENTS)
if (TARGET TBB::${C})
list(APPEND _TBB_AVAILABLE_COMPONENTS ${C})
endif()
endforeach()
endmacro()
#===============================================================================
# Check the version of the TBB root we found.
#===============================================================================
macro(rk_tbb_check_version)
# Extract the version we found in our root.
if(EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
set(_TBB_VERSION_HEADER "oneapi/tbb/version.h")
elseif(EXISTS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
set(_TBB_VERSION_HEADER "tbb/tbb_stddef.h")
elseif(EXISTS "${TBB_INCLUDE_DIR}/tbb/version.h")
set(_TBB_VERSION_HEADER "tbb/version.h")
else()
rk_tbb_error("Missing TBB version information. Could not find"
"tbb/tbb_stddef.h or tbb/version.h in ${TBB_INCLUDE_DIR}")
endif()
file(READ "${TBB_INCLUDE_DIR}/${_TBB_VERSION_HEADER}" VERSION_HEADER_CONTENT)
string(REGEX MATCH "#define TBB_VERSION_MAJOR ([0-9]+)" DUMMY "${VERSION_HEADER_CONTENT}")
set(TBB_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "#define TBB_VERSION_MINOR ([0-9]+)" DUMMY "${VERSION_HEADER_CONTENT}")
set(TBB_VERSION_MINOR ${CMAKE_MATCH_1})
set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}")
set(TBB_VERSION_STRING "${TBB_VERSION}")
# If the user provided information about required versions, check them!
if (TBB_FIND_VERSION)
if (${TBB_FIND_VERSION_EXACT} AND NOT
TBB_VERSION VERSION_EQUAL ${TBB_FIND_VERSION})
rk_tbb_error("Requested exact TBB version ${TBB_FIND_VERSION},"
" but found ${TBB_VERSION}")
elseif(TBB_VERSION VERSION_LESS ${TBB_FIND_VERSION})
rk_tbb_error("Requested minimum TBB version ${TBB_FIND_VERSION},"
" but found ${TBB_VERSION}")
endif()
endif()
rk_tbb_status("Found TBB version ${TBB_VERSION} at ${TBB_ROOT}")
endmacro()
#===============================================================================
# Reuse existing targets.
# NOTE: This must be a macro, as we rely on return() to exit this script.
#===============================================================================
macro(rk_tbb_reuse_existing_target_components)
rk_tbb_check_components()
if (_TBB_MISSING_COMPONENTS STREQUAL "")
rk_tbb_status("Found existing TBB component targets: ${_TBB_AVAILABLE_COMPONENTS}")
# Get TBB_INCLUDE_DIR if not already set to check for the version of the
# existing component targets (making the assumption that they all have
# the same version)
if (NOT TBB_INCLUDE_DIR)
list(GET _TBB_AVAILABLE_COMPONENTS 0 first_target)
get_target_property(TBB_INCLUDE_DIR TBB::${first_target} INTERFACE_INCLUDE_DIRECTORIES)
foreach(TGT IN LISTS _TBB_AVAILABLE_COMPONENTS)
get_target_property(_TGT_INCLUDE_DIR TBB::${TGT} INTERFACE_INCLUDE_DIRECTORIES)
if (NOT _TGT_INCLUDE_DIR STREQUAL "${TBB_INCLUDE_DIR}")
rk_tbb_error("Existing TBB component targets have inconsistent include directories.")
endif()
endforeach()
endif()
find_path(TBB_INCLUDE_DIR
NAMES "${_TBB_HEADER}"
PATHS "${TBB_INCLUDE_DIRS}")
# Extract TBB_ROOT from the include path so that rk_tbb_check_version
# prints the correct tbb location
string(REPLACE "/${_TBB_INCLUDE_SUBDIR}" "" TBB_ROOT "${TBB_INCLUDE_DIR}")
rk_tbb_check_version()
# Add target TBB and link all available components
if (NOT TARGET TBB)
add_library(TBB INTERFACE)
foreach(C IN LISTS _TBB_AVAILABLE_COMPONENTS)
target_link_libraries(TBB INTERFACE TBB::${C})
endforeach()
endif()
set(TBB_FOUND TRUE)
set(TBB_INCLUDE_DIRS "${TBB_INCLUDE_DIR}")
return()
elseif ((TARGET TBB) OR (NOT _TBB_AVAILABLE_COMPONENTS STREQUAL ""))
rk_tbb_error("Ignoring existing TBB targets because required components are missing: ${_TBB_MISSING_COMPONENTS}")
endif()
endmacro()
#===============================================================================
# Find the root directory if a manual override is not specified.
# Sets TBB_ROOT in the parent scope, but does not check for failure.
#===============================================================================
function(rk_tbb_find_root)
if (NOT TBB_ROOT OR TBB_ROOT STREQUAL "")
set(TBB_HINTS "")
set(TBB_PATHS "")
if (WIN32)
# workaround for parentheses in variable name / CMP0053
set(PROGRAMFILESx86 "PROGRAMFILES(x86)")
set(PROGRAMFILES32 "$ENV{${PROGRAMFILESx86}}")
if(NOT PROGRAMFILES32)
set(PROGRAMFILES32 "$ENV{PROGRAMFILES}")
endif()
if(NOT PROGRAMFILES32)
set(PROGRAMFILES32 "C:/Program Files (x86)")
endif()
set(TBB_PATHS
"${PROJECT_SOURCE_DIR}/../tbb"
"${PROGRAMFILES32}/IntelSWTools/compilers_and_libraries/windows/tbb"
"${PROGRAMFILES32}/Intel/Composer XE/tbb"
"${PROGRAMFILES32}/Intel/compilers_and_libraries/windows/tbb")
else()
set(TBB_HINTS "/usr/local")
set(TBB_PATHS
"${PROJECT_SOURCE_DIR}/tbb"
"/opt/intel/composerxe/tbb"
"/opt/intel/compilers_and_libraries/tbb"
"/opt/intel/compilers_and_libraries/linux/tbb"
"/opt/intel/tbb")
endif()
set(TBB_ROOT "TBB_ROOT-NOTFOUND")
find_path(TBB_ROOT
NAMES "${_TBB_INCLUDE_SUBDIR}/${_TBB_HEADER}"
HINTS ${TBB_HINTS}
PATHS ${TBB_PATHS}
NO_PACKAGE_ROOT_PATH)
endif()
endfunction()
#===============================================================================
# Find the include directory if a manual override is not specified.
# Assumes TBB_ROOT to be set.
#===============================================================================
function(rk_tbb_find_include_directory)
find_path(TBB_INCLUDE_DIR
NAMES "${_TBB_HEADER}"
HINTS "${TBB_ROOT}/${_TBB_INCLUDE_SUBDIR}"
NO_PACKAGE_ROOT_PATH)
endfunction()
#===============================================================================
# Find a specific library and create a target for it.
#===============================================================================
function(rk_tbb_find_library COMPONENT_NAME BUILD_CONFIG)
set(LIB_VAR "${COMPONENT_NAME}_LIBRARY_${BUILD_CONFIG}")
set(BIN_DIR_VAR "${COMPONENT_NAME}_BIN_DIR_${BUILD_CONFIG}")
set(DLL_VAR "${COMPONENT_NAME}_DLL_${BUILD_CONFIG}")
if (BUILD_CONFIG STREQUAL "DEBUG")
set(LIB_NAME "${COMPONENT_NAME}_debug")
else()
set(LIB_NAME "${COMPONENT_NAME}")
endif()
unset(LIB_PATHS)
if (WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(TBB_ARCH intel64)
else()
@@ -60,281 +308,175 @@ macro(find_tbb TARGET
set(TBB_VCVER vc14)
endif()
if(${ROOT_VAR} STREQUAL "")
find_path(${INCLUDE_DIR_VAR} tbb/task_scheduler_init.h)
find_path(${BIN_DIR_VAR} "${TBB_LIBRARY_NAME}.dll")
find_library(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_NAME})
find_library(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_NAME})
else()
set(${INCLUDE_DIR_VAR} ${INCLUDE_DIR_VAR}-NOTFOUND)
set(${BIN_DIR_VAR} ${BIN_DIR_VAR}-NOTFOUND)
set(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_VAR}-NOTFOUND)
set(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_VAR}-NOTFOUND)
find_path(${INCLUDE_DIR_VAR} tbb/task_scheduler_init.h PATHS ${${ROOT_VAR}}/include NO_DEFAULT_PATH)
find_path(${BIN_DIR_VAR} "${TBB_LIBRARY_NAME}.dll"
HINTS
${${ROOT_VAR}}/bin/${TBB_ARCH}/${TBB_VCVER}
${${ROOT_VAR}}/bin
${${ROOT_VAR}}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}
${${ROOT_VAR}}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}
NO_DEFAULT_PATH
)
set(${LIB_DIR_VAR} ${${ROOT_VAR}}/lib/${TBB_ARCH}/${TBB_VCVER})
find_library(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_NAME}
PATHS
${${LIB_DIR_VAR}}
${${ROOT_VAR}}/lib
NO_DEFAULT_PATH)
find_library(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_NAME}
PATHS
${${LIB_DIR_VAR}}
${${ROOT_VAR}}/lib
NO_DEFAULT_PATH)
endif()
else()
find_path(${ROOT_VAR} include/tbb/tbb.h
DOC "Root of ${TBB_LIBRARY_NAME} installation"
PATHS ${PROJECT_SOURCE_DIR}/tbb
NO_DEFAULT_PATH
set(LIB_PATHS
${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER}
${TBB_ROOT}/lib
)
find_path(${ROOT_VAR} include/tbb/tbb.h
DOC "Root of ${TBB_LIBRARY_NAME} installation"
HINTS ${${ROOT_VAR}}
# On window, also search the DLL so that the client may install it.
set(DLL_NAME "${LIB_NAME}.dll")
# lib name with version suffix to handle oneTBB tbb12.dll
set(LIB_NAME_VERSION "")
if (${COMPONENT_NAME} STREQUAL "tbb")
if (BUILD_CONFIG STREQUAL "DEBUG")
set(LIB_NAME_VERSION "tbb12_debug")
else()
set(LIB_NAME_VERSION "tbb12")
endif()
endif()
set(DLL_NAME_VERSION "${LIB_NAME_VERSION}.dll")
find_file(BIN_FILE
NAMES ${DLL_NAME} ${DLL_NAME_VERSION}
PATHS
${PROJECT_SOURCE_DIR}/tbb
/opt/intel/composerxe/tbb
/opt/intel/compilers_and_libraries/tbb
/opt/intel/tbb
)
if(${ROOT_VAR} STREQUAL "")
find_path(${INCLUDE_DIR_VAR} tbb/task_scheduler_init.h)
find_library(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_NAME})
find_library(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_NAME})
elseif(EXISTS ${${ROOT_VAR}}/cmake/TBBBuild.cmake AND EXISTS ${${ROOT_VAR}}/src/tbb/tbb_version.h)
option(TBB_STATIC_LIB "Build TBB as a static library (building TBB as a static library is NOT recommended)")
if(TBB_STATIC_LIB)
include(${${ROOT_VAR}}/cmake/TBBBuild.cmake)
tbb_build(TBB_ROOT ${${ROOT_VAR}} CONFIG_DIR TBB_DIR MAKE_ARGS extra_inc=big_iron.inc)
set(${INCLUDE_DIR_VAR} ${${ROOT_VAR}}/include)
set(${TBB_LIBRARY_VAR} ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/lib${TBB_LIBRARY_NAME}.a)
set(${TBBMALLOC_LIBRARY_VAR} ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/lib${TBBMALLOC_LIBRARY_NAME}.a)
else()
include(${${ROOT_VAR}}/cmake/TBBBuild.cmake)
tbb_build(TBB_ROOT ${${ROOT_VAR}} CONFIG_DIR TBB_DIR)
set(${INCLUDE_DIR_VAR} ${${ROOT_VAR}}/include)
set(${TBB_LIBRARY_VAR} ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/lib${TBB_LIBRARY_NAME}.so.2)
set(${TBBMALLOC_LIBRARY_VAR} ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/lib${TBBMALLOC_LIBRARY_NAME}.so.2)
endif()
else()
set(${INCLUDE_DIR_VAR} ${INCLUDE_DIR_VAR}-NOTFOUND)
set(${BIN_DIR_VAR} ${BIN_DIR_VAR}-NOTFOUND)
set(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_VAR}-NOTFOUND)
set(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_VAR}-NOTFOUND)
if(APPLE)
find_path(${INCLUDE_DIR_VAR} tbb/task_scheduler_init.h PATHS ${${ROOT_VAR}}/include NO_DEFAULT_PATH)
find_library(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_NAME} PATHS ${${ROOT_VAR}}/lib NO_DEFAULT_PATH)
find_library(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_NAME} PATHS ${${ROOT_VAR}}/lib NO_DEFAULT_PATH)
else()
find_path(${INCLUDE_DIR_VAR} tbb/task_scheduler_init.h PATHS ${${ROOT_VAR}}/include NO_DEFAULT_PATH)
file(GLOB ALL_HINTS PATHS ${${ROOT_VAR}}/lib/intel64/gcc*)
list(REVERSE ALL_HINTS)
set(ALL_HINTS
HINTS
${ALL_HINTS}
${${ROOT_VAR}}/lib
${${ROOT_VAR}}/lib/x86_64-linux-gnu
${${ROOT_VAR}}/lib64
${${ROOT_VAR}}/libx86_64-linux-gnu
NO_DEFAULT_PATH)
find_library(${TBB_LIBRARY_VAR} ${TBB_LIBRARY_NAME} ${ALL_HINTS})
find_library(${TBBMALLOC_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_NAME} ${ALL_HINTS})
endif()
endif()
"${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}"
"${TBB_ROOT}/bin"
"${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}"
"${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}"
"${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}"
NO_DEFAULT_PATH)
get_filename_component(${BIN_DIR_VAR} ${BIN_FILE} DIRECTORY)
set(${DLL_VAR} "${BIN_FILE}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
elseif(APPLE)
set(LIB_PATHS ${TBB_ROOT}/lib)
else()
file(GLOB LIB_PATHS PATHS ${TBB_ROOT}/lib/intel64/gcc*)
list(REVERSE LIB_PATHS)
list(APPEND LIB_PATHS
${TBB_ROOT}/lib
${TBB_ROOT}/lib/x86_64-linux-gnu
${TBB_ROOT}/lib64
${TBB_ROOT}/libx86_64-linux-gnu)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(${TARGET}
DEFAULT_MSG ${INCLUDE_DIR_VAR} ${TBB_LIBRARY_VAR} ${TBBMALLOC_LIBRARY_VAR})
# We prefer finding the versioned file on Unix so that the library path
# variable will not point to a symlink. This makes installing TBB as a
# dependency easier.
if (UNIX)
set(LIB_NAME lib${LIB_NAME}.so.2 ${LIB_NAME})
endif()
# Do not display these variables in GUIs unless the advanced flag is on.
mark_as_advanced(${INCLUDE_DIR_VAR})
mark_as_advanced(${BIN_DIR_VAR})
mark_as_advanced(${LIB_DIR_VAR})
mark_as_advanced(${TBB_LIBRARY_VAR})
mark_as_advanced(${TBBMALLOC_LIBRARY_VAR})
find_library(${LIB_VAR}
NAMES ${LIB_NAME}
PATHS ${LIB_PATHS}
NO_DEFAULT_PATH)
# Create an imported library target for TBB.
if(${TARGET}_FOUND)
add_library(${TARGET}::tbb SHARED IMPORTED)
set_target_properties(${TARGET}::tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${${INCLUDE_DIR_VAR}}
# Hide this variable if we found something, otherwise display it for
# easy override.
if(${LIB_VAR})
mark_as_advanced(${LIB_VAR})
endif()
if(${BIN_DIR_VAR})
mark_as_advanced(${BIN_DIR_VAR})
endif()
if(${DLL_VAR})
mark_as_advanced(${DLL_VAR})
endif()
endfunction()
#===============================================================================
# Find the given component.
# This macro attempts to find both release and debug versions, and falls back
# appropriately if only one can be found.
# On success, it creates a target ${TARGET}::${COMPONENT_NAME} and links
# it to the overall ${TARGET}.
#
# For more information on the variables set here, see
# https://cmake.org/cmake/help/v3.17/manual/cmake-developer.7.html#a-sample-find-module
#===============================================================================
function(rk_tbb_find_and_link_component COMPONENT_NAME)
set(COMPONENT_TARGET "TBB::${COMPONENT_NAME}")
rk_tbb_find_library("${COMPONENT_NAME}" RELEASE)
rk_tbb_find_library("${COMPONENT_NAME}" DEBUG)
if (${COMPONENT_NAME}_LIBRARY_RELEASE OR ${COMPONENT_NAME}_LIBRARY_DEBUG)
# Note: We *must* use SHARED here rather than UNKNOWN as our
# IMPORTED_NO_SONAME trick a few lines down does not work with
# UNKNOWN.
add_library(${COMPONENT_TARGET} SHARED IMPORTED)
if (${COMPONENT_NAME}_LIBRARY_RELEASE)
set_property(TARGET ${COMPONENT_TARGET} APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
if(WIN32)
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_LOCATION_RELEASE "${${COMPONENT_NAME}_DLL_RELEASE}")
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_IMPLIB_RELEASE "${${COMPONENT_NAME}_LIBRARY_RELEASE}")
else()
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_LOCATION_RELEASE "${${COMPONENT_NAME}_LIBRARY_RELEASE}")
endif()
endif()
if (${COMPONENT_NAME}_LIBRARY_DEBUG)
set_property(TARGET ${COMPONENT_TARGET} APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
if(WIN32)
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_LOCATION_DEBUG "${${COMPONENT_NAME}_DLL_DEBUG}")
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_IMPLIB_DEBUG "${${COMPONENT_NAME}_LIBRARY_DEBUG}")
else()
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_LOCATION_DEBUG "${${COMPONENT_NAME}_LIBRARY_DEBUG}")
endif()
endif()
set_target_properties(${COMPONENT_TARGET} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${TBB_INCLUDE_DIR}"
INTERFACE_COMPILE_DEFINITIONS "__TBB_NO_IMPLICIT_LINKAGE=1"
)
add_library(${TARGET}::tbbmalloc SHARED IMPORTED)
set_target_properties(${TARGET}::tbbmalloc PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "__TBBMALLOC_NO_IMPLICIT_LINKAGE=1"
)
if(WIN32)
set_target_properties(${TARGET}::tbb PROPERTIES
IMPORTED_IMPLIB ${${TBB_LIBRARY_VAR}}
)
set_target_properties(${TARGET}::tbbmalloc PROPERTIES
IMPORTED_IMPLIB ${${TBBMALLOC_LIBRARY_VAR}}
)
else()
if(NOT WIN32)
# Note: IMPORTED_NO_SONAME must be set or cmake will attempt
# to link to the full path of libtbb.so. Instead, we
# rely on the linker to find libtbb.so.2.
set_target_properties(${TARGET}::tbb PROPERTIES
IMPORTED_LOCATION ${${TBB_LIBRARY_VAR}}
IMPORTED_NO_SONAME TRUE
)
set_target_properties(${TARGET}::tbbmalloc PROPERTIES
IMPORTED_LOCATION ${${TBBMALLOC_LIBRARY_VAR}}
set_target_properties(${COMPONENT_TARGET} PROPERTIES
IMPORTED_NO_SONAME TRUE
)
endif()
get_filename_component(${LIB_DIR_VAR} ${${TBB_LIBRARY_VAR}} DIRECTORY)
message(STATUS "FOUND ${TARGET} AT ${${LIB_DIR_VAR}}")
target_link_libraries(TBB INTERFACE ${COMPONENT_TARGET})
endif()
endmacro()
endfunction()
#===============================================================================
# User configuration.
#===============================================================================
SET(EMBREE_TBB_ROOT "" CACHE PATH "Sets the root path of the release version of TBB.")
SET(EMBREE_TBB_DEBUG_ROOT "" CACHE PATH "Sets the root path of the debug version of TBB.")
SET(EMBREE_TBB_POSTFIX "" CACHE STRING "Link to tbb<EMBREE_TBB_POSTFIX>.(dll,lib,so) in release mode.")
SET(EMBREE_TBB_DEBUG_POSTFIX "_debug" CACHE STRING "Link to tbb<EMBREE_TBB_DEBUG_POSTFIX>.(dll,lib,so) in debug mode.")
# Note: The order of these is important.
# Some of these macros create variables that are used in later calls.
rk_tbb_list_components()
rk_tbb_reuse_existing_target_components()
if (NOT EMBREE_TBB_ROOT)
set(EMBREE_TBB_ROOT $ENV{EMBREE_TBB_ROOT})
if(NOT EMBREE_TBB_ROOT)
set(EMBREE_TBB_ROOT $ENV{EMBREE_TBBROOT})
endif()
rk_tbb_find_root()
if (NOT EXISTS "${TBB_ROOT}")
rk_tbb_error("Unable to find root directory ${TBB_ROOT}")
endif()
mark_as_advanced(TBB_ROOT) # Hide, we found something.
rk_tbb_find_include_directory()
if (NOT EXISTS "${TBB_INCLUDE_DIR}")
rk_tbb_error("Unable to find include directory ${TBB_INCLUDE_DIR}")
endif()
mark_as_advanced(TBB_INCLUDE_DIR) # Hide, we found something.
rk_tbb_check_version()
add_library(TBB INTERFACE)
foreach(C IN LISTS _REQUIRED_COMPONENTS _OPTIONAL_COMPONENTS)
rk_tbb_find_and_link_component(${C})
endforeach()
rk_tbb_check_components()
if (_TBB_MISSING_COMPONENTS)
rk_tbb_error("Cannot find required components: "
"${_TBB_MISSING_COMPONENTS}")
endif()
# For the debug root we fall back to TBB_ROOT!
if (NOT EMBREE_TBB_DEBUG_ROOT)
set(EMBREE_TBB_DEBUG_ROOT $ENV{EMBREE_TBB_DEBUG_ROOT})
if(NOT EMBREE_TBB_DEBUG_ROOT)
set(EMBREE_TBB_DEBUG_ROOT $ENV{EMBREE_TBBDEBUGROOT})
if(NOT EMBREE_TBB_DEBUG_ROOT)
set(EMBREE_TBB_DEBUG_ROOT ${EMBREE_TBB_ROOT})
endif()
endif()
endif()
if (NOT EMBREE_TBB_LIBRARY_NAME)
set(EMBREE_TBB_LIBRARY_NAME $ENV{EMBREE_TBB_LIBRARY_NAME})
if (NOT EMBREE_TBB_LIBRARY_NAME)
set(EMBREE_TBB_LIBRARY_NAME "tbb${EMBREE_TBB_POSTFIX}")
endif()
endif()
if (NOT EMBREE_TBBMALLOC_LIBRARY_NAME)
set(EMBREE_TBBMALLOC_LIBRARY_NAME $ENV{EMBREE_TBBMALLOC_LIBRARY_NAME})
if (NOT EMBREE_TBBMALLOC_LIBRARY_NAME)
set(EMBREE_TBBMALLOC_LIBRARY_NAME "tbbmalloc${EMBREE_TBB_POSTFIX}")
endif()
endif()
if (NOT EMBREE_TBB_DEBUG_LIBRARY_NAME)
set(EMBREE_TBB_DEBUG_LIBRARY_NAME $ENV{EMBREE_TBB_DEBUG_LIBRARY_NAME})
if (NOT EMBREE_TBB_DEBUG_LIBRARY_NAME)
set(EMBREE_TBB_DEBUG_LIBRARY_NAME "tbb${EMBREE_TBB_DEBUG_POSTFIX}")
endif()
endif()
if (NOT EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME)
set(EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME $ENV{EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME})
if (NOT EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME)
set(EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME "tbbmalloc${EMBREE_TBB_DEBUG_POSTFIX}")
endif()
endif()
find_tbb(TBB
EMBREE_TBB_ROOT
EMBREE_TBB_INCLUDE_DIR
EMBREE_TBB_BIN_DIR
EMBREE_TBB_LIB_DIR
EMBREE_TBB_LIBRARY
EMBREE_TBBMALLOC_LIBRARY
${EMBREE_TBB_LIBRARY_NAME}
${EMBREE_TBBMALLOC_LIBRARY_NAME})
find_tbb(TBB_DEBUG
EMBREE_TBB_DEBUG_ROOT
EMBREE_TBB_DEBUG_INCLUDE_DIR
EMBREE_TBB_DEBUG_BIN_DIR
EMBREE_TBB_DEBUG_LIB_DIR
EMBREE_TBB_DEBUG_LIBRARY
EMBREE_TBBMALLOC_DEBUG_LIBRARY
${EMBREE_TBB_DEBUG_LIBRARY_NAME}
${EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME})
#===============================================================================
# For linking, attempt to differentiate between release and debug builds,
# but fall back if possible to avoid breaking existing build pipelines.
#===============================================================================
if(TBB_FOUND AND TBB_DEBUG_FOUND)
set(TBB_LIBRARIES
optimized TBB::tbbmalloc
optimized TBB::tbb
debug TBB_DEBUG::tbbmalloc
debug TBB_DEBUG::tbb)
set(TBB_INCLUDE_DIRS ${EMBREE_TBB_INCLUDE_DIR} ${EMBREE_TBB_DEBUG_INCLUDE_DIR})
elseif(TBB_FOUND)
# This is a status message only because there is no performance penalty in
# falling back to the release version of TBB. This fallback is quite likely
# to happen because users may use tbb as provided by their OS distribution.
message(STATUS "Could not find TBB_DEBUG. Falling back to TBB in Debug mode. Consider setting EMBREE_TBB_DEBUG_ROOT or EMBREE_TBB_DEBUG_POSTIFX.")
set(TBB_LIBRARIES TBB::tbbmalloc TBB::tbb)
set(TBB_INCLUDE_DIRS ${EMBREE_TBB_INCLUDE_DIR})
elseif(TBB_DEBUG_FOUND)
# Warn in this case because we are falling back to debug mode!
message(WARNING "Could not find TBB. Falling back to TBB_DEBUG in Release mode. Consider setting EMBREE_TBB_ROOT or EMBREE_TBB_POSTIFX.")
set(TBB_LIBRARIES TBB_DEBUG::tbbmalloc TBB_DEBUG::tbb)
set(TBB_INCLUDE_DIRS ${EMBREE_TBB_DEBUG_INCLUDE_DIR})
else()
message(FATAL_ERROR "Could not find TBB or TBB_DEBUG. Consider setting EMBREE_TBB_ROOT and EMBREE_TBB_DEBUG_ROOT.")
endif()
##############################################################
# Install TBB
##############################################################
IF (EMBREE_INSTALL_DEPENDENCIES)
IF (TBB_FOUND)
IF (WIN32)
INSTALL(PROGRAMS ${EMBREE_TBB_BIN_DIR}/${EMBREE_TBB_LIBRARY_NAME}.dll ${EMBREE_TBB_BIN_DIR}/${EMBREE_TBBMALLOC_LIBRARY_NAME}.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(PROGRAMS ${EMBREE_TBB_LIB_DIR}/${EMBREE_TBB_LIBRARY_NAME}.lib ${EMBREE_TBB_LIB_DIR}/${EMBREE_TBBMALLOC_LIBRARY_NAME}.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSEIF (APPLE)
INSTALL(PROGRAMS ${EMBREE_TBB_LIBRARY} ${EMBREE_TBBMALLOC_LIBRARY} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSE()
INSTALL(PROGRAMS ${EMBREE_TBB_LIBRARY}.2 ${EMBREE_TBBMALLOC_LIBRARY}.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ENDIF()
ENDIF()
IF (TBB_DEBUG_FOUND)
IF (WIN32)
INSTALL(PROGRAMS ${EMBREE_TBB_BIN_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.dll ${EMBREE_TBB_DEBUG_BIN_DIR}/${EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME}.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(PROGRAMS ${EMBREE_TBB_LIB_DIR}/${EMBREE_TBB_DEBUG_LIBRARY_NAME}.lib ${EMBREE_TBB_DEBUG_LIB_DIR}/${EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME}.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSEIF (APPLE)
INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY} ${EMBREE_TBBMALLOC_DEBUG_LIBRARY} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSE()
INSTALL(PROGRAMS ${EMBREE_TBB_DEBUG_LIBRARY}.2 ${EMBREE_TBBMALLOC_DEBUG_LIBRARY}.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ENDIF()
ENDIF()
ENDIF()
set(TBB_FOUND TRUE)
set(TBB_INCLUDE_DIRS "${TBB_INCLUDE_DIR}")
+13
View File
@@ -0,0 +1,13 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#if !defined(__ARM_NEON)
#error "No ARM Neon support"
#endif
#include <arm_neon.h>
int main()
{
return vaddvq_s32(vdupq_n_s32(1));
}
+2 -2
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF (WIN32 OR APPLE)
@@ -12,7 +12,7 @@ foreach (line ${output})
if ("${line}" MATCHES "O .bss")
if (NOT "${line}" MATCHES "std::__ioinit" AND # this is caused by iostream initialization and is likely also ok
NOT "${line}" MATCHES "\\(\\)::" AND # this matches a static inside a function which is fine
NOT "${line}" MATCHES "function_local_static_" AND # static variable inside a function (explicitely named)
NOT "${line}" MATCHES "function_local_static_" AND # static variable inside a function (explicitly named)
NOT "${line}" MATCHES "__\\$U") # ICC generated locks for static variable inside a function
message(WARNING "\nProblematic global variable in non-SSE code:\n" ${line})
endif()
+1 -5
View File
@@ -17,11 +17,7 @@
#if \
defined(__AVX512F__) && defined(__AVX512CD__) && \
defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VL__)
char const *info_isa = "ISA" ":" "AVX512SKX";
#elif \
defined(__AVX512F__) && defined(__AVX512CD__) && \
defined(__AVX512ER__) && defined(__AVX512PF__)
char const *info_isa = "ISA" ":" "AVX512KNL";
char const *info_isa = "ISA" ":" "AVX512";
#elif defined(__AVX2__)
char const *info_isa = "ISA" ":" "AVX2";
#elif defined(__AVX__)
+16 -6
View File
@@ -14,19 +14,29 @@
## limitations under the License. ##
## ======================================================================== ##
SET(CHECK_ISA_DIR ${CMAKE_CURRENT_LIST_DIR})
SET(CHECK_ISA_DIR "${CMAKE_CURRENT_LIST_DIR}")
FUNCTION(CHECK_ISA_DEFAULT OUTVAR)
SET(ISA_DEFAULT_BIN ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_isa_default.bin)
SET(SRC ${CHECK_ISA_DIR}/check_isa.cpp)
TRY_COMPILE(COMPILER_SUPPORTS_ARM_NEON "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/common/cmake/check_arm_neon.cpp")
IF (COMPILER_SUPPORTS_ARM_NEON)
SET(ISA_DEFAULT "NEON")
SET(${OUTVAR} ${ISA_DEFAULT} PARENT_SCOPE)
RETURN()
ENDIF()
SET(ISA_DEFAULT_BIN "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/check_isa_default.bin")
SET(SRC "${CHECK_ISA_DIR}/check_isa.cpp")
TRY_COMPILE(ISA_DEFAULT_COMPILE
${CMAKE_BINARY_DIR}
${SRC}
COPY_FILE ${ISA_DEFAULT_BIN}
"${CMAKE_BINARY_DIR}"
"${SRC}"
COPY_FILE "${ISA_DEFAULT_BIN}"
)
IF(NOT ISA_DEFAULT_COMPILE)
SET(ISA_DEFAULT "SSE2")
SET(${OUTVAR} ${ISA_DEFAULT} PARENT_SCOPE)
RETURN()
ENDIF()
FILE(STRINGS ${ISA_DEFAULT_BIN} ISA_DEFAULT REGEX "^ISA:")
STRING(REPLACE "ISA:" "" ISA_DEFAULT "${ISA_DEFAULT}")
SET(${OUTVAR} ${ISA_DEFAULT} PARENT_SCOPE)
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF (WIN32 OR APPLE)
+27 -12
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
MACRO(_SET_IF_EMPTY VAR VALUE)
@@ -7,12 +7,19 @@ MACRO(_SET_IF_EMPTY VAR VALUE)
ENDIF()
ENDMACRO()
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512KNL "-march=knl")
_SET_IF_EMPTY(FLAGS_AVX512SKX "-march=skx")
IF (EMBREE_ARM)
SET(FLAGS_SSE2 "-D__SSE__ -D__SSE2__")
SET(FLAGS_SSE42 "-D__SSE4_2__ -D__SSE4_1__")
SET(FLAGS_AVX "-D__AVX__ -D__SSE4_2__ -D__SSE4_1__ -D__BMI__ -D__BMI2__ -D__LZCNT__")
SET(FLAGS_AVX2 "-D__AVX2__ -D__AVX__ -D__SSE4_2__ -D__SSE4_1__ -D__BMI__ -D__BMI2__ -D__LZCNT__")
ELSE ()
# for `thread` keyword
_SET_IF_EMPTY(FLAGS_SSE2 "-msse -msse2 -mno-sse4.2")
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512 "-march=skx")
ENDIF ()
IF (WIN32)
@@ -62,7 +69,6 @@ IF (WIN32)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SECURE_LINKER_FLAGS}")
INCLUDE(msvc_post)
ELSE()
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
@@ -74,6 +80,7 @@ ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") # treat char as signed on all processors, including ARM
IF (NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
ENDIF()
@@ -98,6 +105,12 @@ ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls")
ENDIF()
IF (EMSCRIPTEN)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") # enable exceptions
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") # enable threads
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msimd128") # enable SIMD intrinsics
ENDIF()
SET(CMAKE_CXX_FLAGS_DEBUG "")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enable assertions
@@ -119,11 +132,13 @@ ELSE()
ELSE(APPLE)
IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
IF (NOT EMSCRIPTEN)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
ENDIF()
ENDIF()
ENDIF(APPLE)
+1 -2
View File
@@ -17,8 +17,7 @@ SET(FLAGS_SSE2 "-target-cpu=x86_64")
SET(FLAGS_SSE42 "NOT_SUPPORTED")
SET(FLAGS_AVX "-target-cpu=sandybridge")
SET(FLAGS_AVX2 "-target-cpu=haswell")
SET(FLAGS_AVX512KNL "-target-cpu=mic-knl")
SET(FLAGS_AVX512SKX "-target-cpu=x86-skylake")
SET(FLAGS_AVX512 "-target-cpu=x86-skylake")
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _lower_compiler_id)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/${_lower_compiler_id}.cmake" OPTIONAL)
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
file(WRITE ${dst} "#include \"${src}\"\n")
+138
View File
@@ -0,0 +1,138 @@
## Copyright 2009-2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
MACRO(_SET_IF_EMPTY VAR VALUE)
IF(NOT ${VAR})
SET(${VAR} "${VALUE}")
ENDIF()
ENDMACRO()
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512 "-march=skx")
IF (WIN32)
SET(COMMON_CXX_FLAGS "")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /EHsc") # catch C++ exceptions only and extern "C" functions never throw a C++ exception
# SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /MP") # compile source files in parallel
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GR") # enable runtime type information (on by default)
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -Xclang -fcxx-exceptions") # enable C++ exceptions in Clang
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /w") # disable all warnings
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Gy") # package individual functions
IF (EMBREE_STACK_PROTECTOR)
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS") # protects against return address overrides
ELSE()
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-") # do not protect against return address overrides
ENDIF()
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
IF (EMBREE_STACK_PROTECTOR)
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "/GS-")
ENDIF()
ENDMACRO()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DDEBUG") # enables assertions
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /DTBB_USE_DEBUG") # configures TBB in debug mode
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Ox") # enable full optimizations
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Oi") # inline intrinsic functions
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG") # generate debug information
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi") # inline intrinsic functions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Oi") # inline intrinsic functions
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG") # generate debug information
SET(SECURE_LINKER_FLAGS "")
SET(SECURE_LINKER_FLAGS "${SECURE_LINKER_FLAGS} /NXCompat") # compatible with data execution prevention (on by default)
SET(SECURE_LINKER_FLAGS "${SECURE_LINKER_FLAGS} /DynamicBase") # random rebase of executable at load time
IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(SECURE_LINKER_FLAGS "${SECURE_LINKER_FLAGS} /SafeSEH") # invoke known exception handlers (Win32 only, x64 exception handlers are safe by design)
ENDIF()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SECURE_LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SECURE_LINKER_FLAGS}")
INCLUDE(msvc_post)
# workaround for file encoding problems of kernels/embree.rc found here https://gitlab.kitware.com/cmake/cmake/-/issues/18311
set(CMAKE_NINJA_CMCLDEPS_RC OFF)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise") # dpcpp has fp-model fast as default
ELSE()
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
OPTION(EMBREE_ADDRESS_SANITIZER "Enabled CLANG address sanitizer." OFF)
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
SET(CMAKE_CXX_FLAGS "")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") # treat char as signed on all processors, including ARM
IF (NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # enables C++11 features
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # makes all symbols hidden by default
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") # makes all inline symbols hidden by default
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") # disables strict aliasing rules
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
IF (EMBREE_STACK_PROTECTOR)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector") # protects against return address overrides
ENDIF()
MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
IF (EMBREE_STACK_PROTECTOR)
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "-fno-stack-protector")
ENDIF()
ENDMACRO()
IF (EMBREE_ADDRESS_SANITIZER)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls")
ENDIF()
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel") # links intel runtime statically
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-intel") # links intel runtime statically
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-model=precise") # dpcpp has fp-model fast as default
SET(CMAKE_CXX_FLAGS_DEBUG "")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enable assertions
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG") # configure TBB in debug mode
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
IF (APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # link against libc++ which supports C++11 features
ELSE(APPLE)
IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
ENDIF()
ENDIF(APPLE)
ENDIF()
+2 -2
View File
@@ -1,8 +1,8 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
# use default install config
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/embree-config-install.cmake)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/embree-config-install.cmake")
# and override path variables to match for build directory
SET(EMBREE_INCLUDE_DIRS @PROJECT_SOURCE_DIR@/include)
+11 -10
View File
@@ -1,15 +1,16 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
SET(PACKAGE_VERSION @EMBREE_VERSION@)
IF (${PACKAGE_FIND_VERSION_MAJOR} EQUAL @EMBREE_VERSION_MAJOR@)
IF (${PACKAGE_FIND_VERSION} VERSION_LESS @EMBREE_VERSION@)
SET(PACKAGE_VERSION_COMPATIBLE 1)
ENDIF()
IF (${PACKAGE_FIND_VERSION} VERSION_EQUAL @EMBREE_VERSION@)
SET(PACKAGE_VERSION_EXACT 1)
ENDIF()
ELSE()
SET(PACKAGE_VERSION_UNSUITABLE 1)
SET(PACKAGE_VERSION_EXACT 0)
SET(PACKAGE_VERSION_COMPATIBLE 0)
IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
SET(PACKAGE_VERSION_EXACT 1)
SET(PACKAGE_VERSION_COMPATIBLE 1)
ENDIF()
IF (PACKAGE_FIND_VERSION_MAJOR EQUAL @EMBREE_VERSION_MAJOR@ AND PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION)
SET(PACKAGE_VERSION_COMPATIBLE 1)
ENDIF()
+41 -14
View File
@@ -1,15 +1,13 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
SET(EMBREE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIV_ROOT_DIR@)
SET(EMBREE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/@EMBREE_RELATIVE_ROOT_DIR@")
GET_FILENAME_COMPONENT(EMBREE_ROOT_DIR "${EMBREE_ROOT_DIR}" ABSOLUTE)
SET(EMBREE_INCLUDE_DIRS ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@)
SET(EMBREE_LIBRARY ${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@)
SET(EMBREE_INCLUDE_DIRS "${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
SET(EMBREE_LIBRARY "${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@/@EMBREE_LIBRARY_FULLNAME@")
SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY})
MARK_AS_ADVANCED(embree_DIR)
SET(EMBREE_VERSION @EMBREE_VERSION@)
SET(EMBREE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@)
SET(EMBREE_VERSION_MINOR @EMBREE_VERSION_MINOR@)
@@ -21,8 +19,9 @@ SET(EMBREE_ISA_SSE2 @EMBREE_ISA_SSE2@)
SET(EMBREE_ISA_SSE42 @EMBREE_ISA_SSE42@)
SET(EMBREE_ISA_AVX @EMBREE_ISA_AVX@)
SET(EMBREE_ISA_AVX2 @EMBREE_ISA_AVX2@)
SET(EMBREE_ISA_AVX512KNL @EMBREE_ISA_AVX512KNL@)
SET(EMBREE_ISA_AVX512SKX @EMBREE_ISA_AVX512SKX@)
SET(EMBREE_ISA_AVX512 @EMBREE_ISA_AVX512@)
SET(EMBREE_ISA_AVX512SKX @EMBREE_ISA_AVX512@) # just for compatibility
SET(EMBREE_ISA_NEON @EMBREE_ISA_NEON@)
SET(EMBREE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
SET(EMBREE_ISPC_SUPPORT @EMBREE_ISPC_SUPPORT@)
@@ -35,6 +34,8 @@ SET(EMBREE_BACKFACE_CULLING @EMBREE_BACKFACE_CULLING@)
SET(EMBREE_FILTER_FUNCTION @EMBREE_FILTER_FUNCTION@)
SET(EMBREE_IGNORE_INVALID_RAYS @EMBREE_IGNORE_INVALID_RAYS@)
SET(EMBREE_TASKING_SYSTEM @EMBREE_TASKING_SYSTEM@)
SET(EMBREE_TBB_COMPONENT @EMBREE_TBB_COMPONENT@)
SET(EMBREE_COMPACT_POLYS @EMBREE_COMPACT_POLYS@)
SET(EMBREE_GEOMETRY_TRIANGLE @EMBREE_GEOMETRY_TRIANGLE@)
SET(EMBREE_GEOMETRY_QUAD @EMBREE_GEOMETRY_QUAD@)
@@ -45,11 +46,37 @@ SET(EMBREE_GEOMETRY_POINT @EMBREE_GEOMETRY_POINT@)
SET(EMBREE_RAY_PACKETS @EMBREE_RAY_PACKETS@)
SET(EMBREE_MAX_INSTANCE_LEVEL_COUNT @EMBREE_MAX_INSTANCE_LEVEL_COUNT@)
SET(EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR @EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR@)
SET(EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE @EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE@)
SET(EMBREE_MIN_WIDTH @EMBREE_MIN_WIDTH@)
IF(EMBREE_STATIC_LIB)
FILE(GLOB CONFIG_FILES "${EMBREE_ROOT_DIR}/@EMBREE_CMAKECONFIG_DIR@/*-targets.cmake")
FOREACH(f ${CONFIG_FILES})
INCLUDE(${f})
ENDFOREACH()
LINK_DIRECTORIES(${EMBREE_ROOT_DIR}/@CMAKE_INSTALL_LIBDIR@)
IF (EMBREE_TASKING_SYSTEM STREQUAL "TBB")
FIND_PACKAGE(TBB REQUIRED ${EMBREE_TBB_COMPONENT})
ENDIF()
IF (EMBREE_STATIC_LIB)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/sys-targets.cmake")
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/math-targets.cmake")
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/simd-targets.cmake")
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/lexers-targets.cmake")
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/tasking-targets.cmake")
IF (EMBREE_ISA_SSE42)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_sse42-targets.cmake")
ENDIF()
IF (EMBREE_ISA_AVX)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx-targets.cmake")
ENDIF()
IF (EMBREE_ISA_AVX2)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx2-targets.cmake")
ENDIF()
IF (EMBREE_ISA_AVX512)
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree_avx512-targets.cmake")
ENDIF()
ENDIF()
INCLUDE("${EMBREE_ROOT_DIR}/@EMBREE_CMAKEEXPORT_DIR@/embree-targets.cmake")
+53 -20
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
MACRO(_SET_IF_EMPTY VAR VALUE)
@@ -7,27 +7,49 @@ MACRO(_SET_IF_EMPTY VAR VALUE)
ENDIF()
ENDMACRO()
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mprefer-vector-width=256")
IF (EMBREE_ARM)
SET(FLAGS_SSE2 "-D__SSE__ -D__SSE2__")
SET(FLAGS_SSE42 "-D__SSE4_2__ -D__SSE4_1__")
SET(FLAGS_AVX "-D__AVX__ -D__SSE4_2__ -D__SSE4_1__ -D__BMI__ -D__BMI2__ -D__LZCNT__")
SET(FLAGS_AVX2 "-D__AVX2__ -D__AVX__ -D__SSE4_2__ -D__SSE4_1__ -D__BMI__ -D__BMI2__ -D__LZCNT__")
ELSE ()
_SET_IF_EMPTY(FLAGS_SSE2 "-msse2")
_SET_IF_EMPTY(FLAGS_SSE42 "-msse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-mavx")
_SET_IF_EMPTY(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
_SET_IF_EMPTY(FLAGS_AVX512 "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mprefer-vector-width=256")
ENDIF ()
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
SET(CMAKE_CXX_FLAGS "")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
IF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") # treat 'char' as 'signed char'
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flax-vector-conversions") # allow lax vector type conversions
ENDIF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess") # disables clearing an object of type ‘XXX’ with no trivial copy-assignment; use assignment or value-initialization instead
IF (NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
# these prevent compile to optimize away security checks
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-overflow") # assume that signed overflow occurs
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks") # keep all checks for NULL pointers
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwrapv") # this option instructs the compiler to assume that signed arithmetic overflow warps around.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") # treat char as signed on all processors, including ARM
IF (NOT WIN32)
IF (NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") # generate position independent code suitable for shared libraries
ENDIF ()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # enables C++11 features
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") # makes all symbols hidden by default
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") # makes all inline symbols hidden by default
@@ -44,29 +66,40 @@ MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
ENDMACRO()
SET(CMAKE_CXX_FLAGS_DEBUG "")
IF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsigned-char") # treat 'char' as 'signed char'
ENDIF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG") # enable assertions
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG") # configure TBB in debug mode
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "")
IF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fsigned-char") # treat 'char' as 'signed char'
ENDIF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
IF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fsigned-char") # treat 'char' as 'signed char'
ENDIF (EMBREE_ARM)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
IF (APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # link against libc++ which supports C++11 features
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # link against libc++ which supports C++11 features
ELSE(APPLE)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
IF (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") # we do not need an executable stack
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now") # re-arranges data sections to increase security
ENDIF ()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # enables position independent execution for executable
ENDIF(APPLE)
+24
View File
@@ -0,0 +1,24 @@
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS TBB EXPORT TBB-targets)
INSTALL(EXPORT TBB-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()
IF (EMBREE_INSTALL_DEPENDENCIES)
IF (TARGET TBB::${EMBREE_TBB_COMPONENT})
GET_TARGET_PROPERTY(LIB_PATH TBB::${EMBREE_TBB_COMPONENT} IMPORTED_LOCATION_RELEASE)
IF(WIN32)
INSTALL(FILES "${LIB_PATH}" DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples)
GET_TARGET_PROPERTY(IMPLIB_PATH TBB::${EMBREE_TBB_COMPONENT} IMPORTED_IMPLIB_RELEASE)
INSTALL(FILES "${IMPLIB_PATH}" DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
ELSE()
GET_FILENAME_COMPONENT(LIB_DIR "${LIB_PATH}" DIRECTORY)
FILE(GLOB LIB_FILES ${LIB_DIR}/libtbb.*)
INSTALL(FILES ${LIB_FILES} DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
ENDIF()
ELSE()
MESSAGE(SEND_ERROR "Target TBB::${EMBREE_TBB_COMPONENT} not found during install.")
ENDIF()
ENDIF()
+14 -5
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
MACRO(_SET_IF_EMPTY VAR VALUE)
@@ -13,8 +13,7 @@ IF (WIN32)
_SET_IF_EMPTY(FLAGS_SSE42 "/QxSSE4.2")
_SET_IF_EMPTY(FLAGS_AVX "/arch:AVX")
_SET_IF_EMPTY(FLAGS_AVX2 "/QxCORE-AVX2")
_SET_IF_EMPTY(FLAGS_AVX512KNL "/QxMIC-AVX512")
_SET_IF_EMPTY(FLAGS_AVX512SKX "/QxCORE-AVX512")
_SET_IF_EMPTY(FLAGS_AVX512 "/QxCORE-AVX512")
SET(COMMON_CXX_FLAGS "")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /EHsc") # catch C++ exceptions only and extern "C" functions never throw a C++ exception
@@ -76,12 +75,17 @@ IF (WIN32)
# remove libmmd dependency
IF (NOT EMBREE_STATIC_RUNTIME)
# Use the default math library instead of libmmd[d]
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:libmmdd.lib")
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO " /nodefaultlib:libmmd.lib")
STRING(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /nodefaultlib:libmmd.lib")
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG " /nodefaultlib:libmmdd.lib")
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO " /nodefaultlib:libmmd.lib")
STRING(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " /nodefaultlib:libmmd.lib")
# Link the static version of SVML
string(APPEND CMAKE_EXE_LINKER_FLAGS " /defaultlib:svml_dispmt.lib")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " /defaultlib:svml_dispmt.lib")
ENDIF()
ELSE()
@@ -94,8 +98,7 @@ ELSE()
_SET_IF_EMPTY(FLAGS_SSE42 "-xsse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-xAVX")
_SET_IF_EMPTY(FLAGS_AVX2 "-xCORE-AVX2")
_SET_IF_EMPTY(FLAGS_AVX512KNL "-xMIC-AVX512")
_SET_IF_EMPTY(FLAGS_AVX512SKX "-xCORE-AVX512")
_SET_IF_EMPTY(FLAGS_AVX512 "-xCORE-AVX512")
OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
@@ -105,6 +108,12 @@ ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
# these prevent compile to optimize away security checks
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-overflow") # assume that signed overflow occurs
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks") # keep all checks for NULL pointers
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwrapv") # this option instructs the compiler to assume that signed arithmetic overflow warps around.
IF (NOT APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE") # enables support for more secure position independent execution
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftls-model=local-dynamic") # otherwise ICC2019 cannot compile code with -fPIE enabled
+14 -13
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
# ##################################################################
@@ -12,7 +12,7 @@ ENDMACRO ()
IF (EMBREE_ISPC_SUPPORT)
# ISPC versions to look for, in decending order (newest first)
# ISPC versions to look for, in descending order (newest first)
SET(ISPC_VERSION_WORKING "1.9.1" "1.9.0" "1.8.3" "1.8.2")
LIST(GET ISPC_VERSION_WORKING -1 ISPC_VERSION_REQUIRED)
@@ -32,7 +32,7 @@ IF (NOT EMBREE_ISPC_EXECUTABLE)
ENDIF()
FOREACH(ver ${ISPC_VERSION_WORKING})
FOREACH(suffix ${ISPC_DIR_SUFFIX})
LIST(APPEND ISPC_DIR_HINT ${PROJECT_SOURCE_DIR}/../ispc-v${ver}-${suffix})
LIST(APPEND ISPC_DIR_HINT "${PROJECT_SOURCE_DIR}/../ispc-v${ver}-${suffix}")
ENDFOREACH()
ENDFOREACH()
@@ -73,12 +73,16 @@ MACRO (ISPC_COMPILE)
STRING(REPLACE ";" "," ISPC_TARGET_ARGS "${ISPC_TARGETS}")
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ISPC_ARCHITECTURE "x86-64")
IF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64|aarch64")
SET(ISPC_ARCHITECTURE "aarch64")
ELSE()
SET(ISPC_ARCHITECTURE "x86-64")
ENDIF()
ELSE()
SET(ISPC_ARCHITECTURE "x86")
ENDIF()
SET(ISPC_TARGET_DIR ${CMAKE_CURRENT_BINARY_DIR})
SET(ISPC_TARGET_DIR "${CMAKE_CURRENT_BINARY_DIR}")
IF(ISPC_INCLUDE_DIR)
STRING(REPLACE ";" ";-I;" ISPC_INCLUDE_DIR_PARMS "${ISPC_INCLUDE_DIR}")
@@ -104,7 +108,7 @@ MACRO (ISPC_COMPILE)
GET_FILENAME_COMPONENT(dir ${src} PATH)
SET(outdir "${ISPC_TARGET_DIR}/${dir}")
SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src})
SET(input "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
SET(deps "")
IF (EXISTS ${outdir}/${fname}.dev.idep)
@@ -125,10 +129,7 @@ MACRO (ISPC_COMPILE)
LIST(LENGTH ISPC_TARGETS NUM_TARGETS)
IF (NUM_TARGETS GREATER 1)
FOREACH(target ${ISPC_TARGETS})
# in v1.9.0 ISPC changed the ISA suffix of avx512knl-i32x16 to just 'avx512knl'
IF (${target} STREQUAL "avx512knl-i32x16" AND NOT ISPC_VERSION VERSION_LESS "1.9.0")
SET(target "avx512knl")
ELSEIF (${target} STREQUAL "avx512skx-i32x16")
IF (${target} STREQUAL "avx512skx-i32x16")
SET(target "avx512skx")
ENDIF()
SET(results ${results} "${outdir}/${fname}.dev_${target}${ISPC_TARGET_EXT}")
@@ -136,10 +137,10 @@ MACRO (ISPC_COMPILE)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${results} ${ISPC_TARGET_DIR}/${fname}_ispc.h
OUTPUT ${results} "${ISPC_TARGET_DIR}/${fname}_ispc.h"
COMMAND ${CMAKE_COMMAND} -E make_directory ${outdir}
COMMAND ${EMBREE_ISPC_EXECUTABLE}
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I "${CMAKE_CURRENT_SOURCE_DIR}"
${ISPC_INCLUDE_DIR_PARMS}
${ISPC_DEFINITIONS}
--arch=${ISPC_ARCHITECTURE}
@@ -149,7 +150,7 @@ MACRO (ISPC_COMPILE)
--woff
--opt=fast-math
${ISPC_ADDITIONAL_ARGS}
-h ${ISPC_TARGET_DIR}/${fname}_ispc.h
-h "${ISPC_TARGET_DIR}/${fname}_ispc.h"
-MMM ${outdir}/${fname}.dev.idep
-o ${outdir}/${fname}.dev${ISPC_TARGET_EXT}
${input}
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
SET(FLAGS_SSE2 "/D__SSE__ /D__SSE2__")
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
# optionally use static runtime library
+73 -117
View File
@@ -1,35 +1,42 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
INCLUDE(GNUInstallDirs)
if (NOT DEFINED EMBREE_ZIP_MODE)
set(EMBREE_ZIP_MODE OFF)
endif()
IF (NOT EMBREE_ZIP_MODE AND NOT WIN32 AND NOT APPLE)
SET(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}/embree${EMBREE_VERSION_MAJOR})
SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_FULL_BINDIR}/embree${EMBREE_VERSION_MAJOR})
SET(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}/embree${EMBREE_VERSION_MAJOR}")
SET(CMAKE_INSTALL_FULL_BINDIR "${CMAKE_INSTALL_FULL_BINDIR}/embree${EMBREE_VERSION_MAJOR}")
ENDIF()
# use full absolute path as install name
IF (NOT EMBREE_ZIP_MODE)
SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
ELSE()
IF(APPLE)
SET(CMAKE_INSTALL_RPATH "@loader_path/../lib")
SET(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}")
ELSE()
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
ENDIF()
ENDIF()
##############################################################
# Install MSVC runtime
##############################################################
IF (WIN32)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
INCLUDE(InstallRequiredSystemLibraries)
LIST(FILTER CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS INCLUDE REGEX ".*msvcp[0-9]+\.dll|.*vcruntime[0-9]+\.dll|.*vcruntime[0-9]+_[0-9]+\.dll")
INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT lib)
ENDIF()
##############################################################
# Install Headers
##############################################################
INSTALL(DIRECTORY include/embree3 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
INSTALL(DIRECTORY include/embree3 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT devel)
IF (NOT WIN32)
INSTALL(DIRECTORY man/man3 DESTINATION ${CMAKE_INSTALL_MANDIR} COMPONENT devel)
INSTALL(DIRECTORY man/man3 DESTINATION "${CMAKE_INSTALL_MANDIR}" COMPONENT devel)
ENDIF()
##############################################################
@@ -44,12 +51,12 @@ ENDIF()
# Install Documentation
##############################################################
INSTALL(FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/README.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/readme.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/third-party-programs.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES ${PROJECT_SOURCE_DIR}/third-party-programs-TBB.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/LICENSE.txt" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/CHANGELOG.md" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/readme.pdf" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/third-party-programs.txt" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
INSTALL(FILES "${PROJECT_SOURCE_DIR}/third-party-programs-TBB.txt" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT lib)
##############################################################
# Install scripts to set embree paths
@@ -58,15 +65,15 @@ INSTALL(FILES ${PROJECT_SOURCE_DIR}/third-party-programs-TBB.txt DESTINATION ${C
IF (EMBREE_ZIP_MODE)
IF (WIN32)
ELSEIF(APPLE)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.sh embree-vars.sh @ONLY)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.csh embree-vars.csh @ONLY)
INSTALL(FILES ${PROJECT_BINARY_DIR}/embree-vars.sh DESTINATION "." COMPONENT lib)
INSTALL(FILES ${PROJECT_BINARY_DIR}/embree-vars.csh DESTINATION "." COMPONENT lib)
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.sh" embree-vars.sh @ONLY)
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_macosx/embree-vars.csh" embree-vars.csh @ONLY)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-vars.sh" DESTINATION "." COMPONENT lib)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-vars.csh" DESTINATION "." COMPONENT lib)
ELSE()
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/scripts/install_linux/embree-vars.sh embree-vars.sh @ONLY)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/scripts/install_linux/embree-vars.csh embree-vars.csh @ONLY)
INSTALL(FILES ${PROJECT_BINARY_DIR}/embree-vars.sh DESTINATION "." COMPONENT lib)
INSTALL(FILES ${PROJECT_BINARY_DIR}/embree-vars.csh DESTINATION "." COMPONENT lib)
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_linux/embree-vars.sh" embree-vars.sh @ONLY)
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/scripts/install_linux/embree-vars.csh" embree-vars.csh @ONLY)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-vars.sh" DESTINATION "." COMPONENT lib)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-vars.csh" DESTINATION "." COMPONENT lib)
ENDIF()
ENDIF()
@@ -80,11 +87,6 @@ ELSE()
SET(EMBREE_CONFIG_VERSION ${EMBREE_VERSION_MAJOR})
ENDIF()
IF (APPLE AND NOT EMBREE_ZIP_MODE)
CONFIGURE_FILE(scripts/install_macosx/uninstall.command uninstall.command @ONLY)
INSTALL(PROGRAMS "${PROJECT_BINARY_DIR}/uninstall.command" DESTINATION ${CMAKE_INSTALL_BINDIR}/.. COMPONENT lib)
ENDIF()
# why does this have to be so complicated...
IF (EMBREE_STATIC_LIB)
SET(EMBREE_LIBRARY_FULLNAME ${CMAKE_STATIC_LIBRARY_PREFIX}${EMBREE_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
@@ -98,38 +100,45 @@ ELSE()
ENDIF()
ENDIF()
IF (WIN32 OR EMBREE_ZIP_MODE)
#IF (WIN32 OR EMBREE_ZIP_MODE)
# for local "installs" and on Windows we want the cmake config files placed
# in the install root, such that users can point the CMake variable
# embree_DIR just to the install folder
SET(EMBREE_CMAKECONFIG_DIR ".")
SET(EMBREE_RELATIV_ROOT_DIR ".")
# SET(EMBREE_CMAKECONFIG_DIR ".")
# SET(EMBREE_CMAKEEXPORT_DIR "cmake")
# SET(EMBREE_RELATIVE_ROOT_DIR ".")
#ELSE()
SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
SET(EMBREE_CMAKEEXPORT_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
IF (WIN32)
SET(EMBREE_RELATIVE_ROOT_DIR "../../../")
ELSE()
SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
FILE(RELATIVE_PATH EMBREE_RELATIVE_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
ENDIF()
#ENDIF()
CONFIGURE_FILE(common/cmake/embree-config.cmake embree-config-install.cmake @ONLY)
CONFIGURE_FILE(common/cmake/embree-config-version.cmake embree-config-version.cmake @ONLY)
# create a config file for the build directory
CONFIGURE_FILE(common/cmake/embree-config-builddir.cmake embree-config.cmake @ONLY)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} RENAME "embree-config.cmake" COMPONENT devel)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-install.cmake" DESTINATION "${EMBREE_CMAKECONFIG_DIR}" RENAME "embree-config.cmake" COMPONENT devel)
INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION "${EMBREE_CMAKECONFIG_DIR}" COMPONENT devel)
##############################################################
# CPack specific stuff
##############################################################
SET(CPACK_PACKAGE_NAME "Embree Ray Tracing Kernels")
SET(CPACK_PACKAGE_NAME "Intel(R) Embree Ray Tracing Kernels")
SET(CPACK_PACKAGE_FILE_NAME "embree-${EMBREE_VERSION}")
#SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png)
#SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png")
#SET(CPACK_PACKAGE_RELOCATABLE TRUE)
SET(CPACK_STRIP_FILES TRUE)
SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${EMBREE_VERSION_PATCH})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Embree: High Performance Ray Tracing Kernels")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Intel(R) Embree implements high performance ray tracing kernels including acceleration structure construction and traversal.")
SET(CPACK_PACKAGE_VENDOR "Intel Corporation")
SET(CPACK_PACKAGE_CONTACT embree_support@intel.com)
@@ -148,8 +157,8 @@ SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Tutorials demonstrating how to use Emb
#SET(CPACK_COMPONENT_LIB_REQUIRED ON) # always install the libs
# point to readme and license files
SET(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
SET(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
# Windows specific settings
IF(WIN32)
@@ -168,92 +177,39 @@ IF(WIN32)
SET(VCVER vc14)
ENDIF()
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_GENERATOR WIX)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\Embree${EMBREE_VERSION_MAJOR} ${ARCH}")
SET(CPACK_WIX_PRODUCT_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_NUMBER}")
SET(CPACK_WIX_UPGRADE_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_MAJOR}0000") # upgrade as long as major version is the same
SET(CPACK_WIX_CMAKE_PACKAGE_REGISTRY TRUE)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.msi ${EMBREE_SIGN_FILE})
ENDIF()
ELSE()
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}.windows")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.zip)
ENDIF()
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}.windows")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND "${PROJECT_SOURCE_DIR}/scripts/package_win.bat" ${CMAKE_BUILD_TYPE} "${CPACK_PACKAGE_FILE_NAME}.zip")
ENDIF()
# MacOSX specific settings
ELSEIF(APPLE)
CONFIGURE_FILE(README.md README.txt)
SET(CPACK_RESOURCE_FILE_README ${PROJECT_BINARY_DIR}/README.txt)
SET(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/README.txt")
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
SET(CPACK_GENERATOR productbuild)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
SET(CPACK_COMPONENTS_ALL lib devel examples)
#SET(CPACK_MONOLITHIC_INSTALL 1)
SET(CPACK_PACKAGE_NAME embree-${EMBREE_VERSION})
SET(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.embree3.xxx in pkgutil
SET(CPACK_OSX_PACKAGE_VERSION 10.7)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.pkg ${EMBREE_SIGN_FILE})
ENDIF()
ELSE()
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.zip ${EMBREE_SIGN_FILE})
ENDIF()
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND "${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh" ${CMAKE_BUILD_TYPE} "${CPACK_PACKAGE_FILE_NAME}.zip" "${EMBREE_SIGN_FILE}")
ENDIF()
# Linux specific settings
ELSE()
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_GENERATOR RPM)
SET(CPACK_RPM_PACKAGE_NAME "embree${EMBREE_VERSION_MAJOR}")
SET(CPACK_COMPONENTS_ALL devel lib examples)
SET(CPACK_RPM_COMPONENT_INSTALL ON)
SET(CPACK_RPM_FILE_NAME RPM-DEFAULT)
SET(CPACK_RPM_devel_PACKAGE_ARCHITECTURE noarch)
SET(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") # Apache Software License, Version 2.0
SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
IF (CMAKE_VERSION VERSION_LESS "3.7.0")
EXECUTE_PROCESS(COMMAND date "+%a %b %d %Y" OUTPUT_VARIABLE CHANGELOG_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
ENDIF()
SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
SET(CPACK_RPM_PACKAGE_URL http://embree.github.io/)
SET(CPACK_RPM_DEFAULT_DIR_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # otherwise cmake directory has wrong 775 permissions
# post install and uninstall scripts
SET(CPACK_RPM_lib_POST_INSTALL_SCRIPT_FILE ${PROJECT_SOURCE_DIR}/common/cmake/rpm_ldconfig.sh)
SET(CPACK_RPM_lib_POST_UNINSTALL_SCRIPT_FILE ${PROJECT_SOURCE_DIR}/common/cmake/rpm_ldconfig.sh)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh
${EMBREE_ZIP_MODE} ${EMBREE_LIBRARY_NAME} ${EMBREE_VERSION} ${EMBREE_VERSION_MAJOR} ${EMBREE_SIGN_FILE})
ENDIF()
ELSE()
SET(CPACK_GENERATOR TGZ)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh
${EMBREE_ZIP_MODE} ${EMBREE_LIBRARY_NAME} ${EMBREE_VERSION} ${EMBREE_VERSION_MAJOR} ${EMBREE_SIGN_FILE})
ENDIF()
SET(CPACK_GENERATOR TGZ)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND "${PROJECT_SOURCE_DIR}/scripts/package_linux.sh"
${EMBREE_ZIP_MODE} ${EMBREE_LIBRARY_NAME} ${EMBREE_VERSION} ${EMBREE_VERSION_MAJOR} "${EMBREE_SIGN_FILE}")
ENDIF()
ENDIF()
IF (EMBREE_TESTING_PACKAGE)
SET_TESTS_PROPERTIES(BuildPackage PROPERTIES TIMEOUT 1200)
ENDIF()
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
/sbin/ldconfig
+34 -29
View File
@@ -1,10 +1,14 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
INCLUDE(CTest)
IF (WIN32)
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
IF(${CMAKE_CXX_COMPILER} MATCHES ".*icx")
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
ELSE()
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
ENDIF()
ELSE()
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
ENDIF()
@@ -27,31 +31,28 @@ SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb h
SET(EMBREE_MODEL_DIR "none")
IF (EMBREE_TESTING_MODEL_DIR)
SET(EMBREE_MODEL_DIR ${EMBREE_TESTING_MODEL_DIR})
SET(EMBREE_MODEL_DIR "${EMBREE_TESTING_MODEL_DIR}")
ENDIF()
MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
MACRO (ADD_EMBREE_NORMAL_CPP_TEST name reference executable args)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND ${executable} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
ENDIF()
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}_ispc
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND ${executable}_ispc --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
ENDIF()
WORKING_DIRECTORY "${MY_PROJECT_BINARY_DIR}"
COMMAND ${executable} --compare "${EMBREE_MODEL_DIR}/reference/${reference}.tga" ${args})
ENDIF()
ENDMACRO()
MACRO (ADD_EMBREE_TEST_WITHOUT_ISPC name)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND ${executable} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
ENDIF()
MACRO (ADD_EMBREE_NORMAL_ISPC_TEST name reference executable args)
IF (BUILD_TESTING AND EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
ADD_TEST(NAME ${name}_ispc
WORKING_DIRECTORY "${MY_PROJECT_BINARY_DIR}"
COMMAND ${executable}_ispc --compare "${EMBREE_MODEL_DIR}/reference/${reference}.tga" ${args})
ENDIF()
ENDMACRO()
MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
ADD_EMBREE_NORMAL_CPP_TEST(${name} ${reference} ${executable} "${args}")
ADD_EMBREE_NORMAL_ISPC_TEST(${name} ${reference} ${executable} "${args}")
ENDMACRO()
MACRO (ADD_EMBREE_TEST name)
@@ -65,15 +66,15 @@ ENDMACRO()
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND ${executable} -c ${EMBREE_MODEL_DIR}/${model} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
WORKING_DIRECTORY "${MY_PROJECT_BINARY_DIR}"
COMMAND ${executable} -c "${EMBREE_MODEL_DIR}/${model}" --compare "${EMBREE_MODEL_DIR}/reference/${reference}.tga" ${args})
ENDIF()
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}_ispc
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND COMMAND ${executable}_ispc -c ${EMBREE_MODEL_DIR}/${model} --compare ${EMBREE_MODEL_DIR}/reference/${reference}.tga ${args})
WORKING_DIRECTORY "${MY_PROJECT_BINARY_DIR}"
COMMAND COMMAND ${executable}_ispc -c "${EMBREE_MODEL_DIR}/${model}" --compare "${EMBREE_MODEL_DIR}/reference/${reference}.tga" ${args})
ENDIF()
ENDIF()
ENDMACRO()
@@ -81,7 +82,7 @@ ENDMACRO()
MACRO (ADD_EMBREE_MODELS_TEST model_list_file name reference executable)
IF (BUILD_TESTING)
SET(full_model_list_file ${EMBREE_TESTING_MODEL_DIR}/${model_list_file})
SET(full_model_list_file "${EMBREE_TESTING_MODEL_DIR}/${model_list_file}")
IF(NOT EXISTS "${full_model_list_file}")
MESSAGE(FATAL_ERROR "File ${EMBREE_TESTING_MODEL_DIR}/${model_list_file} does not exist!")
@@ -91,7 +92,11 @@ MACRO (ADD_EMBREE_MODELS_TEST model_list_file name reference executable)
STRING(REGEX REPLACE "\n" ";" models "${models}")
FOREACH (model ${models})
STRING(REGEX REPLACE "/" "_" modelname "${model}")
IF (model MATCHES "^#")
CONTINUE()
ENDIF()
STRING(REGEX REPLACE " .*" "" modelname "${model}")
STRING(REGEX REPLACE "/" "_" modelname "${modelname}")
STRING(REGEX REPLACE ".ecs" "" modelname "${modelname}")
ADD_EMBREE_MODEL_TEST(${name}_${modelname} ${reference}_${modelname} ${executable} "${ARGN}" ${model})
ENDFOREACH()
@@ -100,8 +105,8 @@ ENDMACRO()
# add klocwork test
IF (EMBREE_TESTING_KLOCWORK)
ADD_TEST(NAME Klocwork-Build WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork_build.sh)
ADD_TEST(NAME Klocwork-Check WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork_check.sh)
ADD_TEST(NAME Klocwork-Build WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND "${PROJECT_SOURCE_DIR}/scripts/klocwork_build.sh")
ADD_TEST(NAME Klocwork-Check WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMAND "${PROJECT_SOURCE_DIR}/scripts/klocwork_check.sh")
SET_TESTS_PROPERTIES(Klocwork-Build PROPERTIES TIMEOUT 2400)
SET_TESTS_PROPERTIES(Klocwork-Check PROPERTIES TIMEOUT 300)
ENDIF()
@@ -116,6 +121,6 @@ IF (EMBREE_TESTING_MEMCHECK)
FUNCTION(ADD_MEMCHECK_TEST name binary)
set(memcheck_command "${EMBREE_MEMORYCHECK_COMMAND} ${EMBREE_MEMORYCHECK_COMMAND_OPTIONS}")
separate_arguments(memcheck_command)
add_test(NAME ${name} COMMAND ${memcheck_command} ${MY_PROJECT_BINARY_DIR}/${binary} ${ARGN})
add_test(NAME ${name} COMMAND ${memcheck_command} "${MY_PROJECT_BINARY_DIR}/${binary}" ${ARGN})
ENDFUNCTION()
ENDIF()
+3 -3
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
# additional parameters (beyond the name) are treated as additional dependencies
@@ -9,7 +9,7 @@ MACRO (ADD_TUTORIAL TUTORIAL_NAME)
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree image tutorial noise ${ADDITIONAL_LIBRARIES})
SET_PROPERTY(TARGET ${TUTORIAL_NAME} PROPERTY FOLDER tutorials/single)
SET_PROPERTY(TARGET ${TUTORIAL_NAME} APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
INSTALL(TARGETS ${TUTORIAL_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(TARGETS ${TUTORIAL_NAME} DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples)
SIGN_TARGET(${TUTORIAL_NAME})
ENDMACRO ()
@@ -19,7 +19,7 @@ MACRO (ADD_TUTORIAL_ISPC TUTORIAL_NAME)
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree image tutorial_ispc noise noise_ispc)
SET_PROPERTY(TARGET ${TUTORIAL_NAME}_ispc PROPERTY FOLDER tutorials/ispc)
SET_PROPERTY(TARGET ${TUTORIAL_NAME}_ispc APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
INSTALL(TARGETS ${TUTORIAL_NAME}_ispc DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(TARGETS ${TUTORIAL_NAME}_ispc DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples)
SIGN_TARGET(${TUTORIAL_NAME}_ispc)
ENDIF()
ENDMACRO ()
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+5 -4
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ADD_LIBRARY(lexers STATIC
@@ -10,7 +10,8 @@ SET_PROPERTY(TARGET lexers PROPERTY FOLDER common)
SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
INSTALL(EXPORT lexers-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel)
SIGN_TARGET(lexers)
INSTALL(TARGETS lexers EXPORT lexers-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(EXPORT lexers-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+9 -3
View File
@@ -1,10 +1,12 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "stringstream.h"
namespace embree
{
static const std::string stringChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _.,+-=:/*\\";
/* creates map for fast categorization of characters */
static void createCharMap(bool map[256], const std::string& chrs) {
for (size_t i=0; i<256; i++) map[i] = false;
@@ -16,6 +18,7 @@ namespace embree
: cin(cin), endl(endl), multiLine(multiLine)
{
createCharMap(isSepMap,seps);
createCharMap(isValidCharMap,stringChars);
}
std::string StringStream::next()
@@ -34,8 +37,11 @@ namespace embree
/* parse everything until the next separator */
std::vector<char> str; str.reserve(64);
while (cin->peek() != EOF && !isSeparator(cin->peek()))
str.push_back((char)cin->get());
while (cin->peek() != EOF && !isSeparator(cin->peek())) {
int c = cin->get();
if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input");
str.push_back((char)c);
}
str.push_back(0);
return std::string(str.data());
}
+4 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -17,10 +17,12 @@ namespace embree
ParseLocation location() { return cin->loc(); }
std::string next();
private:
__forceinline bool isSeparator(int c) const { return c<256 && isSepMap[c]; }
__forceinline bool isSeparator(unsigned int c) const { return c<256 && isSepMap[c]; }
__forceinline bool isValidChar(unsigned int c) const { return c<256 && isValidCharMap[c]; }
private:
Ref<Stream<int> > cin; /*! source character stream */
bool isSepMap[256]; /*! map for fast classification of separators */
bool isValidCharMap[256]; /*! map for valid characters */
std::string endl; /*! the token of the end of line */
bool multiLine; /*! whether to parse lines wrapped with \ */
};
+8 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "tokenstream.h"
@@ -11,6 +11,7 @@ namespace embree
const std::string TokenStream::ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const std::string TokenStream::numbers = "0123456789";
const std::string TokenStream::separators = "\n\t\r ";
const std::string TokenStream::stringChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 _.,+-=:/*\\";
/* creates map for fast categorization of characters */
static void createCharMap(bool map[256], const std::string& chrs) {
@@ -27,6 +28,7 @@ namespace embree
{
createCharMap(isAlphaMap,alpha);
createCharMap(isSepMap,seps);
createCharMap(isStringCharMap,stringChars);
}
bool TokenStream::decDigits(std::string& str_o)
@@ -136,7 +138,11 @@ namespace embree
std::string str;
if (cin->peek() != '\"') return false;
cin->drop();
while (cin->peek() != '\"') str += (char)cin->get();
while (cin->peek() != '\"') {
const int c = cin->get();
if (!isStringChar(c)) THROW_RUNTIME_ERROR("invalid string character "+std::string(1,c)+" at "+loc.str());
str += (char)c;
}
cin->drop();
token = Token(str,Token::TY_STRING,loc);
return true;
+10 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -120,6 +120,7 @@ namespace embree
static const std::string ALPHA;
static const std::string numbers;
static const std::string separators;
static const std::string stringChars;
public:
TokenStream(const Ref<Stream<int> >& cin,
@@ -144,16 +145,20 @@ namespace embree
Ref<Stream<int> > cin;
bool isSepMap[256];
bool isAlphaMap[256];
bool isStringCharMap[256];
std::vector<std::string> symbols;
/*! checks if a character is a separator */
__forceinline bool isSeparator(int c) const { return c<256 && isSepMap[c]; }
__forceinline bool isSeparator(unsigned int c) const { return c<256 && isSepMap[c]; }
/*! checks if a character is a number */
__forceinline bool isDigit(int c) const { return c >= '0' && c <= '9';}
__forceinline bool isDigit(unsigned int c) const { return c >= '0' && c <= '9'; }
/*! checks if a character is valid inside a string */
__forceinline bool isStringChar(unsigned int c) const { return c<256 && isStringCharMap[c]; }
/*! checks if a character is legal for an identifier */
__forceinline bool isAlpha(int c) const { return c<256 && isAlphaMap[c]; }
__forceinline bool isAlphaNum(int c) const { return isAlpha(c) || isDigit(c); }
__forceinline bool isAlpha(unsigned int c) const { return c<256 && isAlphaMap[c]; }
__forceinline bool isAlphaNum(unsigned int c) const { return isAlpha(c) || isDigit(c); }
};
}
+3 -4
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ADD_LIBRARY(math STATIC constants.cpp)
@@ -6,8 +6,7 @@ SET_PROPERTY(TARGET math PROPERTY FOLDER common)
SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
INSTALL(EXPORT math-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel)
SIGN_TARGET(math)
INSTALL(TARGETS math EXPORT math-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(EXPORT math-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()
+12 -10
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -72,7 +72,7 @@ namespace embree
// template specialization to get correct identity matrix for type AffineSpace3fa
template<>
__forceinline AffineSpaceT<LinearSpace3fa>::AffineSpaceT( OneTy ) : l(one), p(0.f, 0.f, 0.f, 1.f) {}
__forceinline AffineSpaceT<LinearSpace3ff>::AffineSpaceT( OneTy ) : l(one), p(0.f, 0.f, 0.f, 1.f) {}
////////////////////////////////////////////////////////////////////////////////
// Unary Operators
@@ -147,6 +147,8 @@ namespace embree
typedef AffineSpaceT<LinearSpace2f> AffineSpace2f;
typedef AffineSpaceT<LinearSpace3f> AffineSpace3f;
typedef AffineSpaceT<LinearSpace3fa> AffineSpace3fa;
typedef AffineSpaceT<LinearSpace3fx> AffineSpace3fx;
typedef AffineSpaceT<LinearSpace3ff> AffineSpace3ff;
typedef AffineSpaceT<Quaternion3f > OrthonormalSpace3f;
template<int N> using AffineSpace3vf = AffineSpaceT<LinearSpace3<Vec3<vfloat<N>>>>;
@@ -154,7 +156,7 @@ namespace embree
typedef AffineSpaceT<LinearSpace3<Vec3<vfloat<8>>>> AffineSpace3vf8;
typedef AffineSpaceT<LinearSpace3<Vec3<vfloat<16>>>> AffineSpace3vf16;
template<int N> using AffineSpace3vfa = AffineSpaceT<LinearSpace3<Vec4<vfloat<N>>>>;
template<int N> using AffineSpace3vff = AffineSpaceT<LinearSpace3<Vec4<vfloat<N>>>>;
typedef AffineSpaceT<LinearSpace3<Vec4<vfloat<4>>>> AffineSpace3vfa4;
typedef AffineSpaceT<LinearSpace3<Vec4<vfloat<8>>>> AffineSpace3vfa8;
typedef AffineSpaceT<LinearSpace3<Vec4<vfloat<16>>>> AffineSpace3vfa16;
@@ -196,8 +198,8 @@ namespace embree
// this is a specialized version for Vec3fa because that does
// not play along nicely with the other templated Vec3/Vec4 types
__forceinline AffineSpace3fa slerp(const AffineSpace3fa& M0,
const AffineSpace3fa& M1,
__forceinline AffineSpace3fa slerp(const AffineSpace3ff& M0,
const AffineSpace3ff& M1,
const float& t)
{
Quaternion3f q0(M0.p.w, M0.l.vx.w, M0.l.vy.w, M0.l.vz.w);
@@ -217,7 +219,7 @@ namespace embree
return D * R * S;
}
__forceinline AffineSpace3fa quaternionDecompositionToAffineSpace(const AffineSpace3fa& qd)
__forceinline AffineSpace3fa quaternionDecompositionToAffineSpace(const AffineSpace3ff& qd)
{
// compute affine transform from quaternion decomposition
Quaternion3f q(qd.p.w, qd.l.vx.w, qd.l.vy.w, qd.l.vz.w);
@@ -233,7 +235,7 @@ namespace embree
return D * R * M;
}
__forceinline void quaternionDecomposition(const AffineSpace3fa& qd, Vec3fa& T, Quaternion3f& q, AffineSpace3fa& S)
__forceinline void quaternionDecomposition(const AffineSpace3ff& qd, Vec3fa& T, Quaternion3f& q, AffineSpace3fa& S)
{
q = Quaternion3f(qd.p.w, qd.l.vx.w, qd.l.vy.w, qd.l.vz.w);
S = qd;
@@ -245,9 +247,9 @@ namespace embree
S.l.vy.z = 0;
}
__forceinline AffineSpace3fa quaternionDecomposition(Vec3fa const& T, Quaternion3f const& q, AffineSpace3fa const& S)
__forceinline AffineSpace3fx quaternionDecomposition(Vec3fa const& T, Quaternion3f const& q, AffineSpace3fa const& S)
{
AffineSpace3fa M = S;
AffineSpace3ff M = S;
M.l.vx.w = q.i;
M.l.vy.w = q.j;
M.l.vz.w = q.k;
@@ -278,7 +280,7 @@ namespace embree
float translation_z = 0.f;
};
__forceinline QuaternionDecomposition quaternionDecomposition(AffineSpace3fa const& M)
__forceinline QuaternionDecomposition quaternionDecomposition(AffineSpace3ff const& M)
{
QuaternionDecomposition qd;
qd.scale_x = M.l.vx.x;
+24 -6
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -25,7 +25,8 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline BBox ( ) { }
__forceinline BBox ( const BBox& other ) { lower = other.lower; upper = other.upper; }
template<typename T1>
__forceinline BBox ( const BBox<T1>& other ) : lower(other.lower), upper(other.upper) {}
__forceinline BBox& operator=( const BBox& other ) { lower = other.lower; upper = other.upper; return *this; }
__forceinline BBox ( const T& v ) : lower(v), upper(v) {}
@@ -76,10 +77,13 @@ namespace embree
return lower > upper;
}
#if defined(__SSE__)
#if defined(__SSE__) || defined(__ARM_NEON)
template<> __forceinline bool BBox<Vec3fa>::empty() const {
return !all(le_mask(lower,upper));
}
template<> __forceinline bool BBox<Vec3fx>::empty() const {
return !all(le_mask(lower,upper));
}
#endif
/*! tests if box is finite */
@@ -87,6 +91,11 @@ namespace embree
return all(gt_mask(v.lower,Vec3fa_t(-FLT_LARGE)) & lt_mask(v.upper,Vec3fa_t(+FLT_LARGE)));
}
/*! tests if box is finite and non-empty*/
__forceinline bool isvalid_non_empty( const BBox<Vec3fa>& v ) {
return all(gt_mask(v.lower,Vec3fa_t(-FLT_LARGE)) & lt_mask(v.upper,Vec3fa_t(+FLT_LARGE)) & le_mask(v.lower,v.upper));
}
/*! tests if box has finite entries */
__forceinline bool is_finite( const BBox<Vec3fa>& b) {
return is_finite(b.lower) && is_finite(b.upper);
@@ -115,6 +124,9 @@ namespace embree
__forceinline float halfArea( const BBox<Vec3fa>& b ) { return halfArea(b.size()); }
__forceinline float area( const BBox<Vec3fa>& b ) { return 2.0f*halfArea(b); }
__forceinline float halfArea( const BBox<Vec3fx>& b ) { return halfArea(b.size()); }
__forceinline float area( const BBox<Vec3fx>& b ) { return 2.0f*halfArea(b); }
template<typename Vec> __forceinline float safeArea( const BBox<Vec>& b ) { if (b.empty()) return 0.0f; else return area(b); }
template<typename T> __forceinline float expectedApproxHalfArea(const BBox<T>& box) {
@@ -184,7 +196,11 @@ namespace embree
}
template<> __inline bool subset( const BBox<Vec3fa>& a, const BBox<Vec3fa>& b ) {
return all(ge_mask(a.lower,b.lower)) & all(le_mask(a.upper,b.upper));
return all(ge_mask(a.lower,b.lower)) && all(le_mask(a.upper,b.upper));
}
template<> __inline bool subset( const BBox<Vec3fx>& a, const BBox<Vec3fx>& b ) {
return all(ge_mask(a.lower,b.lower)) && all(le_mask(a.upper,b.upper));
}
/*! blending */
@@ -204,17 +220,19 @@ namespace embree
typedef BBox<Vec2fa> BBox2fa;
typedef BBox<Vec3f> BBox3f;
typedef BBox<Vec3fa> BBox3fa;
typedef BBox<Vec3fx> BBox3fx;
typedef BBox<Vec3ff> BBox3ff;
}
////////////////////////////////////////////////////////////////////////////////
/// SSE / AVX / MIC specializations
////////////////////////////////////////////////////////////////////////////////
#if defined __SSE__
#if defined (__SSE__) || defined(__ARM_NEON)
#include "../simd/sse.h"
#endif
#if defined __AVX__
#if defined (__AVX__)
#include "../simd/avx.h"
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+19 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -152,21 +152,38 @@ namespace embree
}
__forceinline const Color rcp ( const Color& a )
{
#if defined(__aarch64__)
__m128 reciprocal = _mm_rcp_ps(a.m128);
reciprocal = vmulq_f32(vrecpsq_f32(a.m128, reciprocal), reciprocal);
reciprocal = vmulq_f32(vrecpsq_f32(a.m128, reciprocal), reciprocal);
return (const Color)reciprocal;
#else
#if defined(__AVX512VL__)
const Color r = _mm_rcp14_ps(a.m128);
#else
const Color r = _mm_rcp_ps(a.m128);
#endif
return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
return _mm_add_ps(r,_mm_mul_ps(r, _mm_sub_ps(_mm_set1_ps(1.0f), _mm_mul_ps(a, r)))); // computes r + r * (1 - a * r)
#endif //defined(__aarch64__)
}
__forceinline const Color rsqrt( const Color& a )
{
#if defined(__aarch64__)
__m128 r = _mm_rsqrt_ps(a.m128);
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
return r;
#else
#if defined(__AVX512VL__)
__m128 r = _mm_rsqrt14_ps(a.m128);
#else
__m128 r = _mm_rsqrt_ps(a.m128);
#endif
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
#endif //defined(__aarch64__)
}
__forceinline const Color sqrt ( const Color& a ) { return _mm_sqrt_ps(a.m128); }
+1 -20
View File
@@ -1,27 +1,8 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "constants.h"
namespace embree
{
TrueTy True;
FalseTy False;
ZeroTy zero;
OneTy one;
NegInfTy neg_inf;
PosInfTy inf;
PosInfTy pos_inf;
NaNTy nan;
UlpTy ulp;
PiTy pi;
OneOverPiTy one_over_pi;
TwoPiTy two_pi;
OneOverTwoPiTy one_over_two_pi;
FourPiTy four_pi;
OneOverFourPiTy one_over_four_pi;
StepTy step;
ReverseStepTy reverse_step;
EmptyTy empty;
UndefinedTy undefined;
}
+34 -22
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -24,13 +24,13 @@ namespace embree
__forceinline operator bool( ) const { return true; }
};
extern MAYBE_UNUSED TrueTy True;
const constexpr TrueTy True = TrueTy();
struct FalseTy {
__forceinline operator bool( ) const { return false; }
};
extern MAYBE_UNUSED FalseTy False;
const constexpr FalseTy False = FalseTy();
struct ZeroTy
{
@@ -48,7 +48,7 @@ namespace embree
__forceinline operator unsigned char ( ) const { return 0; }
};
extern MAYBE_UNUSED ZeroTy zero;
const constexpr ZeroTy zero = ZeroTy();
struct OneTy
{
@@ -66,7 +66,7 @@ namespace embree
__forceinline operator unsigned char ( ) const { return 1; }
};
extern MAYBE_UNUSED OneTy one;
const constexpr OneTy one = OneTy();
struct NegInfTy
{
@@ -85,7 +85,7 @@ namespace embree
};
extern MAYBE_UNUSED NegInfTy neg_inf;
const constexpr NegInfTy neg_inf = NegInfTy();
struct PosInfTy
{
@@ -103,8 +103,8 @@ namespace embree
__forceinline operator unsigned char ( ) const { return std::numeric_limits<unsigned char>::max(); }
};
extern MAYBE_UNUSED PosInfTy inf;
extern MAYBE_UNUSED PosInfTy pos_inf;
const constexpr PosInfTy inf = PosInfTy();
const constexpr PosInfTy pos_inf = PosInfTy();
struct NaNTy
{
@@ -112,15 +112,15 @@ namespace embree
__forceinline operator float ( ) const { return std::numeric_limits<float>::quiet_NaN(); }
};
extern MAYBE_UNUSED NaNTy nan;
const constexpr NaNTy nan = NaNTy();
struct UlpTy
{
__forceinline operator double( ) const { return std::numeric_limits<double>::epsilon(); }
__forceinline operator float ( ) const { return std::numeric_limits<float>::epsilon(); }
};
extern MAYBE_UNUSED UlpTy ulp;
const constexpr UlpTy ulp = UlpTy();
struct PiTy
{
@@ -128,7 +128,7 @@ namespace embree
__forceinline operator float ( ) const { return float(M_PI); }
};
extern MAYBE_UNUSED PiTy pi;
const constexpr PiTy pi = PiTy();
struct OneOverPiTy
{
@@ -136,7 +136,7 @@ namespace embree
__forceinline operator float ( ) const { return float(M_1_PI); }
};
extern MAYBE_UNUSED OneOverPiTy one_over_pi;
const constexpr OneOverPiTy one_over_pi = OneOverPiTy();
struct TwoPiTy
{
@@ -144,7 +144,7 @@ namespace embree
__forceinline operator float ( ) const { return float(2.0*M_PI); }
};
extern MAYBE_UNUSED TwoPiTy two_pi;
const constexpr TwoPiTy two_pi = TwoPiTy();
struct OneOverTwoPiTy
{
@@ -152,7 +152,7 @@ namespace embree
__forceinline operator float ( ) const { return float(0.5*M_1_PI); }
};
extern MAYBE_UNUSED OneOverTwoPiTy one_over_two_pi;
const constexpr OneOverTwoPiTy one_over_two_pi = OneOverTwoPiTy();
struct FourPiTy
{
@@ -160,7 +160,7 @@ namespace embree
__forceinline operator float ( ) const { return float(4.0*M_PI); }
};
extern MAYBE_UNUSED FourPiTy four_pi;
const constexpr FourPiTy four_pi = FourPiTy();
struct OneOverFourPiTy
{
@@ -168,30 +168,42 @@ namespace embree
__forceinline operator float ( ) const { return float(0.25*M_1_PI); }
};
extern MAYBE_UNUSED OneOverFourPiTy one_over_four_pi;
const constexpr OneOverFourPiTy one_over_four_pi = OneOverFourPiTy();
struct StepTy {
__forceinline operator double ( ) const { return 0; }
__forceinline operator float ( ) const { return 0; }
__forceinline operator long long( ) const { return 0; }
__forceinline operator unsigned long long( ) const { return 0; }
__forceinline operator long ( ) const { return 0; }
__forceinline operator unsigned long ( ) const { return 0; }
__forceinline operator int ( ) const { return 0; }
__forceinline operator unsigned int ( ) const { return 0; }
__forceinline operator short ( ) const { return 0; }
__forceinline operator unsigned short ( ) const { return 0; }
__forceinline operator char ( ) const { return 0; }
__forceinline operator unsigned char ( ) const { return 0; }
};
extern MAYBE_UNUSED StepTy step;
const constexpr StepTy step = StepTy();
struct ReverseStepTy {
};
extern MAYBE_UNUSED ReverseStepTy reverse_step;
const constexpr ReverseStepTy reverse_step = ReverseStepTy();
struct EmptyTy {
};
extern MAYBE_UNUSED EmptyTy empty;
const constexpr EmptyTy empty = EmptyTy();
struct FullTy {
};
extern MAYBE_UNUSED FullTy full;
const constexpr FullTy full = FullTy();
struct UndefinedTy {
};
extern MAYBE_UNUSED UndefinedTy undefined;
const constexpr UndefinedTy undefined = UndefinedTy();
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+16 -7
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -23,9 +23,10 @@ namespace embree
public:
__forceinline LBBox () {}
__forceinline LBBox ( const LBBox& other ) {
bounds0 = other.bounds0; bounds1 = other.bounds1;
}
template<typename T1>
__forceinline LBBox ( const LBBox<T1>& other )
: bounds0(other.bounds0), bounds1(other.bounds1) {}
__forceinline LBBox& operator= ( const LBBox& other ) {
bounds0 = other.bounds0; bounds1 = other.bounds1; return *this;
}
@@ -221,9 +222,11 @@ namespace embree
}
/*! Comparison Operators */
template<typename TT> friend __forceinline bool operator==( const LBBox<TT>& a, const LBBox<TT>& b ) { return a.bounds0 == b.bounds0 && a.bounds1 == b.bounds1; }
template<typename TT> friend __forceinline bool operator!=( const LBBox<TT>& a, const LBBox<TT>& b ) { return a.bounds0 != b.bounds0 || a.bounds1 != b.bounds1; }
//template<typename TT> friend __forceinline bool operator==( const LBBox<TT>& a, const LBBox<TT>& b ) { return a.bounds0 == b.bounds0 && a.bounds1 == b.bounds1; }
//template<typename TT> friend __forceinline bool operator!=( const LBBox<TT>& a, const LBBox<TT>& b ) { return a.bounds0 != b.bounds0 || a.bounds1 != b.bounds1; }
friend __forceinline bool operator==( const LBBox& a, const LBBox& b ) { return a.bounds0 == b.bounds0 && a.bounds1 == b.bounds1; }
friend __forceinline bool operator!=( const LBBox& a, const LBBox& b ) { return a.bounds0 != b.bounds0 || a.bounds1 != b.bounds1; }
/*! output operator */
friend __forceinline embree_ostream operator<<(embree_ostream cout, const LBBox& box) {
return cout << "LBBox { " << box.bounds0 << "; " << box.bounds1 << " }";
@@ -238,6 +241,11 @@ namespace embree
__forceinline bool isvalid( const LBBox<T>& v ) {
return isvalid(v.bounds0) && isvalid(v.bounds1);
}
template<typename T>
__forceinline bool isvalid_non_empty( const LBBox<T>& v ) {
return isvalid_non_empty(v.bounds0) && isvalid_non_empty(v.bounds1);
}
template<typename T>
__forceinline T expectedArea(const T& a0, const T& a1, const T& b0, const T& b1)
@@ -277,4 +285,5 @@ namespace embree
typedef LBBox<Vec2f> LBBox2f;
typedef LBBox<Vec3f> LBBox3f;
typedef LBBox<Vec3fa> LBBox3fa;
typedef LBBox<Vec3fx> LBBox3fx;
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+12 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -171,6 +171,15 @@ namespace embree
return LinearSpace3<T>(select(s,t.vx,f.vx),select(s,t.vy,f.vy),select(s,t.vz,f.vz));
}
/*! blending */
template<typename T>
__forceinline LinearSpace3<T> lerp(const LinearSpace3<T>& l0, const LinearSpace3<T>& l1, const float t)
{
return LinearSpace3<T>(lerp(l0.vx,l1.vx,t),
lerp(l0.vy,l1.vy,t),
lerp(l0.vz,l1.vz,t));
}
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
@@ -182,6 +191,8 @@ namespace embree
/*! Shortcuts for common linear spaces. */
typedef LinearSpace3<Vec3f> LinearSpace3f;
typedef LinearSpace3<Vec3fa> LinearSpace3fa;
typedef LinearSpace3<Vec3fx> LinearSpace3fx;
typedef LinearSpace3<Vec3ff> LinearSpace3ff;
template<int N> using LinearSpace3vf = LinearSpace3<Vec3<vfloat<N>>>;
typedef LinearSpace3<Vec3<vfloat<4>>> LinearSpace3vf4;
+113 -10
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -8,12 +8,16 @@
#include "constants.h"
#include <cmath>
#if defined(__ARM_NEON)
#include "../simd/arm/emulation.h"
#else
#include <emmintrin.h>
#include <xmmintrin.h>
#include <immintrin.h>
#endif
#if defined(__WIN32__)
#if (__MSV_VER <= 1700)
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
namespace std
{
__forceinline bool isinf ( const float x ) { return _finite(x) == 0; }
@@ -49,6 +53,16 @@ namespace embree
__forceinline float rcp ( const float x )
{
#if defined(__aarch64__)
// Move scalar to vector register and do rcp.
__m128 a;
a[0] = x;
float32x4_t reciprocal = vrecpeq_f32(a);
reciprocal = vmulq_f32(vrecpsq_f32(a, reciprocal), reciprocal);
reciprocal = vmulq_f32(vrecpsq_f32(a, reciprocal), reciprocal);
return reciprocal[0];
#else
const __m128 a = _mm_set_ss(x);
#if defined(__AVX512VL__)
@@ -62,31 +76,74 @@ namespace embree
#else
return _mm_cvtss_f32(_mm_mul_ss(r,_mm_sub_ss(_mm_set_ss(2.0f), _mm_mul_ss(r, a))));
#endif
#endif //defined(__aarch64__)
}
__forceinline float signmsk ( const float x ) {
#if defined(__aarch64__)
// FP and Neon shares same vector register in arm64
__m128 a;
__m128i b;
a[0] = x;
b[0] = 0x80000000;
a = _mm_and_ps(a, vreinterpretq_f32_s32(b));
return a[0];
#else
return _mm_cvtss_f32(_mm_and_ps(_mm_set_ss(x),_mm_castsi128_ps(_mm_set1_epi32(0x80000000))));
#endif
}
__forceinline float xorf( const float x, const float y ) {
#if defined(__aarch64__)
// FP and Neon shares same vector register in arm64
__m128 a;
__m128 b;
a[0] = x;
b[0] = y;
a = _mm_xor_ps(a, b);
return a[0];
#else
return _mm_cvtss_f32(_mm_xor_ps(_mm_set_ss(x),_mm_set_ss(y)));
#endif
}
__forceinline float andf( const float x, const unsigned y ) {
#if defined(__aarch64__)
// FP and Neon shares same vector register in arm64
__m128 a;
__m128i b;
a[0] = x;
b[0] = y;
a = _mm_and_ps(a, vreinterpretq_f32_s32(b));
return a[0];
#else
return _mm_cvtss_f32(_mm_and_ps(_mm_set_ss(x),_mm_castsi128_ps(_mm_set1_epi32(y))));
#endif
}
__forceinline float rsqrt( const float x )
{
#if defined(__aarch64__)
// FP and Neon shares same vector register in arm64
__m128 a;
a[0] = x;
__m128 value = _mm_rsqrt_ps(a);
value = vmulq_f32(value, vrsqrtsq_f32(vmulq_f32(a, value), value));
value = vmulq_f32(value, vrsqrtsq_f32(vmulq_f32(a, value), value));
return value[0];
#else
const __m128 a = _mm_set_ss(x);
#if defined(__AVX512VL__)
const __m128 r = _mm_rsqrt14_ss(_mm_set_ss(0.0f),a);
__m128 r = _mm_rsqrt14_ss(_mm_set_ss(0.0f),a);
#else
const __m128 r = _mm_rsqrt_ss(a);
__m128 r = _mm_rsqrt_ss(a);
#endif
const __m128 c = _mm_add_ss(_mm_mul_ss(_mm_set_ss(1.5f), r),
_mm_mul_ss(_mm_mul_ss(_mm_mul_ss(a, _mm_set_ss(-0.5f)), r), _mm_mul_ss(r, r)));
return _mm_cvtss_f32(c);
#endif
}
#if defined(__WIN32__) && (__MSC_VER <= 1700)
#if defined(__WIN32__) && defined(_MSC_VER) && (_MSC_VER <= 1700)
__forceinline float nextafter(float x, float y) { if ((x<y) == (x>0)) return x*(1.1f+float(ulp)); else return x*(0.9f-float(ulp)); }
__forceinline double nextafter(double x, double y) { return _nextafter(x, y); }
__forceinline int roundf(float f) { return (int)(f + 0.5f); }
@@ -140,7 +197,17 @@ namespace embree
__forceinline double floor( const double x ) { return ::floor (x); }
__forceinline double ceil ( const double x ) { return ::ceil (x); }
#if defined(__SSE4_1__)
#if defined(__aarch64__)
__forceinline float mini(float a, float b) {
// FP and Neon shares same vector register in arm64
__m128 x;
__m128 y;
x[0] = a;
y[0] = b;
x = _mm_min_ps(x, y);
return x[0];
}
#elif defined(__SSE4_1__)
__forceinline float mini(float a, float b) {
const __m128i ai = _mm_castps_si128(_mm_set_ss(a));
const __m128i bi = _mm_castps_si128(_mm_set_ss(b));
@@ -149,7 +216,17 @@ namespace embree
}
#endif
#if defined(__SSE4_1__)
#if defined(__aarch64__)
__forceinline float maxi(float a, float b) {
// FP and Neon shares same vector register in arm64
__m128 x;
__m128 y;
x[0] = a;
y[0] = b;
x = _mm_max_ps(x, y);
return x[0];
}
#elif defined(__SSE4_1__)
__forceinline float maxi(float a, float b) {
const __m128i ai = _mm_castps_si128(_mm_set_ss(a));
const __m128i bi = _mm_castps_si128(_mm_set_ss(b));
@@ -166,9 +243,12 @@ namespace embree
__forceinline int64_t min(int64_t a, int64_t b) { return a<b ? a:b; }
__forceinline float min(float a, float b) { return a<b ? a:b; }
__forceinline double min(double a, double b) { return a<b ? a:b; }
#if defined(__X86_64__)
#if defined(__64BIT__) || defined(__EMSCRIPTEN__)
__forceinline size_t min(size_t a, size_t b) { return a<b ? a:b; }
#endif
#if defined(__EMSCRIPTEN__)
__forceinline long min(long a, long b) { return a<b ? a:b; }
#endif
template<typename T> __forceinline T min(const T& a, const T& b, const T& c) { return min(min(a,b),c); }
template<typename T> __forceinline T min(const T& a, const T& b, const T& c, const T& d) { return min(min(a,b),min(c,d)); }
@@ -183,9 +263,12 @@ namespace embree
__forceinline int64_t max(int64_t a, int64_t b) { return a<b ? b:a; }
__forceinline float max(float a, float b) { return a<b ? b:a; }
__forceinline double max(double a, double b) { return a<b ? b:a; }
#if defined(__X86_64__)
#if defined(__64BIT__) || defined(__EMSCRIPTEN__)
__forceinline size_t max(size_t a, size_t b) { return a<b ? b:a; }
#endif
#if defined(__EMSCRIPTEN__)
__forceinline long max(long a, long b) { return a<b ? b:a; }
#endif
template<typename T> __forceinline T max(const T& a, const T& b, const T& c) { return max(max(a,b),c); }
template<typename T> __forceinline T max(const T& a, const T& b, const T& c, const T& d) { return max(max(a,b),max(c,d)); }
@@ -225,6 +308,15 @@ namespace embree
__forceinline float msub ( const float a, const float b, const float c) { return _mm_cvtss_f32(_mm_fmsub_ss(_mm_set_ss(a),_mm_set_ss(b),_mm_set_ss(c))); }
__forceinline float nmadd ( const float a, const float b, const float c) { return _mm_cvtss_f32(_mm_fnmadd_ss(_mm_set_ss(a),_mm_set_ss(b),_mm_set_ss(c))); }
__forceinline float nmsub ( const float a, const float b, const float c) { return _mm_cvtss_f32(_mm_fnmsub_ss(_mm_set_ss(a),_mm_set_ss(b),_mm_set_ss(c))); }
#elif defined (__aarch64__) && defined(__clang__)
#pragma clang fp contract(fast)
__forceinline float madd ( const float a, const float b, const float c) { return a*b + c; }
__forceinline float msub ( const float a, const float b, const float c) { return a*b - c; }
__forceinline float nmadd ( const float a, const float b, const float c) { return c - a*b; }
__forceinline float nmsub ( const float a, const float b, const float c) { return -(c + a*b); }
#pragma clang fp contract(on)
#else
__forceinline float madd ( const float a, const float b, const float c) { return a*b+c; }
__forceinline float msub ( const float a, const float b, const float c) { return a*b-c; }
@@ -273,6 +365,17 @@ namespace embree
/*! exchange */
template<typename T> __forceinline void xchg ( T& a, T& b ) { const T tmp = a; a = b; b = tmp; }
/* load/store */
template<typename Ty> struct mem;
template<> struct mem<float> {
static __forceinline float load (bool mask, const void* ptr) { return mask ? *(float*)ptr : 0.0f; }
static __forceinline float loadu(bool mask, const void* ptr) { return mask ? *(float*)ptr : 0.0f; }
static __forceinline void store (bool mask, void* ptr, const float v) { if (mask) *(float*)ptr = v; }
static __forceinline void storeu(bool mask, void* ptr, const float v) { if (mask) *(float*)ptr = v; }
};
/*! bit reverse operation */
template<class T>
__forceinline T bitReverse(const T& vin)
@@ -309,7 +412,7 @@ namespace embree
return x | (y << 1) | (z << 2);
}
#if defined(__AVX2__)
#if defined(__AVX2__) && !defined(__aarch64__)
template<>
__forceinline unsigned int bitInterleave(const unsigned int &xi, const unsigned int& yi, const unsigned int& zi)
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+9 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -242,13 +242,17 @@ namespace embree
T cosTheta = dot(q0, q1_);
QuaternionT<T> q1 = select(cosTheta < 0.f, -q1_, q1_);
cosTheta = select(cosTheta < 0.f, -cosTheta, cosTheta);
if (unlikely(all(cosTheta > 0.9995f))) {
return normalize(lerp(q0, q1, t));
}
// spherical linear interpolation
const T phi = t * fastapprox::acos(cosTheta);
T sinPhi, cosPhi;
fastapprox::sincos(phi, sinPhi, cosPhi);
QuaternionT<T> qperp = sinPhi * normalize(msub(cosTheta, q0, q1));
return msub(cosPhi, q0, qperp);
QuaternionT<T> qslerp = msub(cosPhi, q0, qperp);
// regular linear interpolation as fallback
QuaternionT<T> qlerp = normalize(lerp(q0, q1, t));
return select(cosTheta > 0.9995f, qlerp, qslerp);
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+5 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -27,7 +27,7 @@ __forceinline T sin(const T &v)
// Reduced range version of x
auto x = v - kReal * piOverTwoVec;
auto kMod4 = k & 3;
auto sinUseCos = (kMod4 == 1 | kMod4 == 3);
auto sinUseCos = (kMod4 == 1) | (kMod4 == 3);
auto flipSign = (kMod4 > 1);
// These coefficients are from sollya with fpminimax(sin(x)/x, [|0, 2,
@@ -76,8 +76,8 @@ __forceinline T cos(const T &v)
auto x = v - kReal * piOverTwoVec;
auto kMod4 = k & 3;
auto cosUseCos = (kMod4 == 0 | kMod4 == 2);
auto flipSign = (kMod4 == 1 | kMod4 == 2);
auto cosUseCos = (kMod4 == 0) | (kMod4 == 2);
auto flipSign = (kMod4 == 1) | (kMod4 == 2);
const float sinC2 = -0.16666667163372039794921875;
const float sinC4 = +8.333347737789154052734375e-3;
@@ -418,7 +418,7 @@ __forceinline void __rangeReduceLog(const T &input,
}
template <typename T> struct ExponentType { };
template <int N> struct ExponentType<vfloat<N>> { typedef vint<N> Ty; };
template <int N> struct ExponentType<vfloat_impl<N>> { typedef vint<N> Ty; };
template <> struct ExponentType<float> { typedef int Ty; };
template <typename T>
+5 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -144,7 +144,7 @@ namespace embree
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline T dot ( const Vec2<T>& a, const Vec2<T>& b ) { return madd(a.x,b.x,a.y*b.y); }
@@ -205,11 +205,11 @@ namespace embree
#include "vec2fa.h"
#if defined __SSE__
#if defined(__SSE__) || defined(__ARM_NEON)
#include "../simd/sse.h"
#endif
#if defined __AVX__
#if defined(__AVX__)
#include "../simd/avx.h"
#endif
@@ -221,7 +221,7 @@ namespace embree
{
template<> __forceinline Vec2<float>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#if defined(__SSE__)
#if defined(__SSE__) || defined(__ARM_NEON)
template<> __forceinline Vec2<vfloat4>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#endif
+29 -8
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -97,6 +97,12 @@ namespace embree
__forceinline Vec2fa rcp ( const Vec2fa& a )
{
#if defined(__aarch64__)
__m128 reciprocal = _mm_rcp_ps(a.m128);
reciprocal = vmulq_f32(vrecpsq_f32(a.m128, reciprocal), reciprocal);
reciprocal = vmulq_f32(vrecpsq_f32(a.m128, reciprocal), reciprocal);
return (const Vec2fa)reciprocal;
#else
#if defined(__AVX512VL__)
const Vec2fa r = _mm_rcp14_ps(a.m128);
#else
@@ -104,13 +110,15 @@ namespace embree
#endif
#if defined(__AVX2__)
const Vec2fa res = _mm_mul_ps(r,_mm_fnmadd_ps(r, a, vfloat4(2.0f)));
const Vec2fa h_n = _mm_fnmadd_ps(a, r, vfloat4(1.0)); // First, compute 1 - a * r (which will be very close to 0)
const Vec2fa res = _mm_fmadd_ps(r, h_n, r); // Then compute r + r * h_n
#else
const Vec2fa res = _mm_mul_ps(r,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r, a)));
//return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
const Vec2fa h_n = _mm_sub_ps(vfloat4(1.0f), _mm_mul_ps(a, r)); // First, compute 1 - a * r (which will be very close to 0)
const Vec2fa res = _mm_add_ps(r,_mm_mul_ps(r, h_n)); // Then compute r + r * h_n
#endif
return res;
#endif //defined(__aarch64__)
}
__forceinline Vec2fa sqrt ( const Vec2fa& a ) { return _mm_sqrt_ps(a.m128); }
@@ -118,12 +126,21 @@ namespace embree
__forceinline Vec2fa rsqrt( const Vec2fa& a )
{
#if defined(__aarch64__)
__m128 r = _mm_rsqrt_ps(a.m128);
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
return r;
#else
#if defined(__AVX512VL__)
__m128 r = _mm_rsqrt14_ps(a.m128);
#else
__m128 r = _mm_rsqrt_ps(a.m128);
#endif
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
#endif
}
__forceinline Vec2fa zero_fix(const Vec2fa& a) {
@@ -156,7 +173,7 @@ namespace embree
__forceinline Vec2fa min( const Vec2fa& a, const Vec2fa& b ) { return _mm_min_ps(a.m128,b.m128); }
__forceinline Vec2fa max( const Vec2fa& a, const Vec2fa& b ) { return _mm_max_ps(a.m128,b.m128); }
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec2fa mini(const Vec2fa& a, const Vec2fa& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
@@ -165,7 +182,7 @@ namespace embree
}
#endif
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec2fa maxi(const Vec2fa& a, const Vec2fa& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
@@ -227,7 +244,7 @@ namespace embree
__forceinline bool operator !=( const Vec2fa& a, const Vec2fa& b ) { return (_mm_movemask_ps(_mm_cmpneq_ps(a.m128, b.m128)) & 3) != 0; }
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__SSE4_1__)
@@ -275,7 +292,11 @@ namespace embree
/// Rounding Functions
////////////////////////////////////////////////////////////////////////////////
#if defined (__SSE4_1__)
#if defined(__aarch64__)
//__forceinline Vec2fa trunc(const Vec2fa& a) { return vrndq_f32(a); }
__forceinline Vec2fa floor(const Vec2fa& a) { return vrndmq_f32(a); }
__forceinline Vec2fa ceil (const Vec2fa& a) { return vrndpq_f32(a); }
#elif defined (__SSE4_1__)
//__forceinline Vec2fa trunc( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
__forceinline Vec2fa floor( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline Vec2fa ceil ( const Vec2fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
+7 -21
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -197,7 +197,7 @@ namespace embree
template<typename T> __forceinline Vec3<bool> ge_mask( const Vec3<T>& a, const Vec3<T>& b ) { return Vec3<bool>(a.x>=b.x,a.y>=b.y,a.z>=b.z); }
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline T sqr ( const Vec3<T>& a ) { return dot(a,a); }
@@ -207,7 +207,6 @@ namespace embree
template<typename T> __forceinline Vec3<T> normalize( const Vec3<T>& a ) { return a*rsqrt(sqr(a)); }
template<typename T> __forceinline T distance ( const Vec3<T>& a, const Vec3<T>& b ) { return length(a-b); }
template<typename T> __forceinline Vec3<T> cross ( const Vec3<T>& a, const Vec3<T>& b ) { return Vec3<T>(msub(a.y,b.z,a.z*b.y), msub(a.z,b.x,a.x*b.z), msub(a.x,b.y,a.y*b.x)); }
template<typename T> __forceinline Vec3<T> stable_triangle_normal( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c )
{
const T ab_x = a.z*b.y, ab_y = a.x*b.z, ab_z = a.y*b.x;
@@ -266,11 +265,11 @@ namespace embree
/// SSE / AVX / MIC specializations
////////////////////////////////////////////////////////////////////////////////
#if defined __SSE__
#if defined(__SSE__) || defined(__ARM_NEON)
#include "../simd/sse.h"
#endif
#if defined __AVX__
#if defined(__AVX__)
#include "../simd/avx.h"
#endif
@@ -291,18 +290,14 @@ namespace embree
template<> __forceinline Vec3<vfloat4>::Vec3(const Vec3fa& a) {
x = a.x; y = a.y; z = a.z;
}
#elif defined(__SSE__)
#elif defined(__SSE__) || defined(__ARM_NEON)
template<>
__forceinline Vec3<vfloat4>::Vec3(const Vec3fa& a) {
const vfloat4 v = vfloat4(a); x = shuffle<0,0,0,0>(v); y = shuffle<1,1,1,1>(v); z = shuffle<2,2,2,2>(v);
const vfloat4 v = vfloat4(a.m128); x = shuffle<0,0,0,0>(v); y = shuffle<1,1,1,1>(v); z = shuffle<2,2,2,2>(v);
}
#endif
#if defined(__SSE__)
__forceinline Vec3<vfloat4> broadcast4f(const Vec3<vfloat4>& a, const size_t k) {
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
}
#if defined(__SSE__) || defined(__ARM_NEON)
template<>
__forceinline Vec3<vfloat4> broadcast<vfloat4,vfloat4>(const Vec3<vfloat4>& a, const size_t k) {
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
@@ -319,15 +314,6 @@ namespace embree
__forceinline Vec3<vfloat8>::Vec3(const Vec3fa& a) {
x = a.x; y = a.y; z = a.z;
}
__forceinline Vec3<vfloat4> broadcast4f(const Vec3<vfloat8>& a, const size_t k) {
return Vec3<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]));
}
__forceinline Vec3<vfloat8> broadcast8f(const Vec3<vfloat4>& a, const size_t k) {
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
}
__forceinline Vec3<vfloat8> broadcast8f(const Vec3<vfloat8>& a, const size_t k) {
return Vec3<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]));
}
template<>
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat4>(const Vec3<vfloat4>& a, const size_t k) {
+4 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -19,7 +19,7 @@ namespace embree
union {
__m128 m128;
struct { int x,y,z; int a; };
struct { int x,y,z; };
};
typedef int Scalar;
@@ -108,6 +108,8 @@ namespace embree
__forceinline bool any ( const Vec3ba& b ) { return (_mm_movemask_ps(b) & 0x7) != 0x0; }
__forceinline bool none ( const Vec3ba& b ) { return (_mm_movemask_ps(b) & 0x7) == 0x0; }
__forceinline size_t movemask(const Vec3ba& a) { return _mm_movemask_ps(a) & 0x7; }
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
+483 -63
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -21,7 +21,7 @@ namespace embree
enum { N = 3 };
union {
__m128 m128;
struct { float x,y,z; union { int a; unsigned u; float w; }; };
struct { float x,y,z; };
};
////////////////////////////////////////////////////////////////////////////////
@@ -31,47 +31,37 @@ namespace embree
__forceinline Vec3fa( ) {}
__forceinline Vec3fa( const __m128 a ) : m128(a) {}
__forceinline Vec3fa ( const Vec3<float>& other ) { x = other.x; y = other.y; z = other.z; }
__forceinline Vec3fa& operator =( const Vec3<float>& other ) { x = other.x; y = other.y; z = other.z; return *this; }
__forceinline Vec3fa ( const Vec3<float>& other ) { m128 = _mm_set_ps(0, other.z, other.y, other.x); }
//__forceinline Vec3fa& operator =( const Vec3<float>& other ) { m128 = _mm_set_ps(0, other.z, other.y, other.x); return *this; }
__forceinline Vec3fa ( const Vec3fa& other ) { m128 = other.m128; }
__forceinline Vec3fa& operator =( const Vec3fa& other ) { m128 = other.m128; return *this; }
__forceinline explicit Vec3fa( const float a ) : m128(_mm_set1_ps(a)) {}
__forceinline Vec3fa( const float x, const float y, const float z) : m128(_mm_set_ps(0, z, y, x)) {}
__forceinline Vec3fa( const Vec3fa& other, const int a1) { m128 = other.m128; a = a1; }
__forceinline Vec3fa( const Vec3fa& other, const unsigned a1) { m128 = other.m128; u = a1; }
__forceinline Vec3fa( const Vec3fa& other, const float w1) {
#if defined (__SSE4_1__)
m128 = _mm_insert_ps(other.m128, _mm_set_ss(w1),3 << 4);
#else
const vint4 mask(-1,-1,-1,0);
m128 = select(vboolf4(_mm_castsi128_ps(mask)),vfloat4(other.m128),vfloat4(w1));
#endif
}
//__forceinline Vec3fa( const float x, const float y, const float z, const int a) : x(x), y(y), z(z), a(a) {} // not working properly!
//__forceinline Vec3fa( const float x, const float y, const float z, const unsigned a) : x(x), y(y), z(z), u(a) {} // not working properly!
__forceinline Vec3fa( const float x, const float y, const float z, const float w) : m128(_mm_set_ps(w, z, y, x)) {}
__forceinline explicit Vec3fa( const __m128i a ) : m128(_mm_cvtepi32_ps(a)) {}
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
#if defined (__SSE4_1__)
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { return _mm_insert_ps(a, b, (3 << 4) | (3 << 6)); }
#else
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { Vec3fa c = a; c.a = b.a; return c; }
#endif
__forceinline explicit operator const vfloat4() const { return vfloat4(m128); }
__forceinline explicit operator const vint4() const { return vint4(_mm_cvtps_epi32(m128)); }
__forceinline explicit operator const Vec2fa() const { return Vec2fa(m128); }
__forceinline explicit operator const Vec3ia() const { return Vec3ia(_mm_cvtps_epi32(m128)); }
//__forceinline operator const __m128&() const { return m128; }
//__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline Vec3fa load( const void* const a ) {
#if defined(__aarch64__)
__m128 t = _mm_load_ps((float*)a);
t[3] = 0.0f;
return Vec3fa(t);
#else
return Vec3fa(_mm_and_ps(_mm_load_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1))));
#endif
}
static __forceinline Vec3fa loadu( const void* const a ) {
@@ -79,7 +69,7 @@ namespace embree
}
static __forceinline void storeu ( void* ptr, const Vec3fa& v ) {
_mm_storeu_ps((float*)ptr,v);
_mm_storeu_ps((float*)ptr,v.m128);
}
////////////////////////////////////////////////////////////////////////////////
@@ -105,19 +95,31 @@ namespace embree
__forceinline Vec3fa operator +( const Vec3fa& a ) { return a; }
__forceinline Vec3fa operator -( const Vec3fa& a ) {
#if defined(__aarch64__)
return vnegq_f32(a.m128);
#else
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
return _mm_xor_ps(a.m128, mask);
#endif
}
__forceinline Vec3fa abs ( const Vec3fa& a ) {
#if defined(__aarch64__)
return _mm_abs_ps(a.m128);
#else
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
return _mm_and_ps(a.m128, mask);
#endif
}
__forceinline Vec3fa sign ( const Vec3fa& a ) {
return blendv_ps(Vec3fa(one), -Vec3fa(one), _mm_cmplt_ps (a,Vec3fa(zero)));
return blendv_ps(Vec3fa(one).m128, (-Vec3fa(one)).m128, _mm_cmplt_ps (a.m128,Vec3fa(zero).m128));
}
__forceinline Vec3fa rcp ( const Vec3fa& a )
{
#if defined(__aarch64__)
return vdivq_f32(vdupq_n_f32(1.0f),a.m128);
#else
#if defined(__AVX512VL__)
const Vec3fa r = _mm_rcp14_ps(a.m128);
#else
@@ -125,30 +127,40 @@ namespace embree
#endif
#if defined(__AVX2__)
const Vec3fa res = _mm_mul_ps(r,_mm_fnmadd_ps(r, a, vfloat4(2.0f)));
const Vec3fa h_n = _mm_fnmadd_ps(a.m128, r.m128, vfloat4(1.0)); // First, compute 1 - a * r (which will be very close to 0)
const Vec3fa res = _mm_fmadd_ps(r.m128, h_n.m128, r.m128); // Then compute r + r * h_n
#else
const Vec3fa res = _mm_mul_ps(r,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r, a)));
//return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
const Vec3fa h_n = _mm_sub_ps(vfloat4(1.0f), _mm_mul_ps(a.m128, r.m128)); // First, compute 1 - a * r (which will be very close to 0)
const Vec3fa res = _mm_add_ps(r.m128,_mm_mul_ps(r.m128, h_n.m128)); // Then compute r + r * h_n
#endif
return res;
#endif //defined(__aarch64__)
}
__forceinline Vec3fa sqrt ( const Vec3fa& a ) { return _mm_sqrt_ps(a.m128); }
__forceinline Vec3fa sqr ( const Vec3fa& a ) { return _mm_mul_ps(a,a); }
__forceinline Vec3fa sqr ( const Vec3fa& a ) { return _mm_mul_ps(a.m128,a.m128); }
__forceinline Vec3fa rsqrt( const Vec3fa& a )
{
#if defined(__aarch64__)
__m128 r = _mm_rsqrt_ps(a.m128);
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
r = vmulq_f32(r, vrsqrtsq_f32(vmulq_f32(a.m128, r), r));
return r;
#else
#if defined(__AVX512VL__)
__m128 r = _mm_rsqrt14_ps(a.m128);
#else
__m128 r = _mm_rsqrt_ps(a.m128);
#endif
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a.m128, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
#endif
}
__forceinline Vec3fa zero_fix(const Vec3fa& a) {
return blendv_ps(a, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
return blendv_ps(a.m128, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
}
__forceinline Vec3fa rcp_safe(const Vec3fa& a) {
return rcp(zero_fix(a));
@@ -177,19 +189,19 @@ namespace embree
__forceinline Vec3fa min( const Vec3fa& a, const Vec3fa& b ) { return _mm_min_ps(a.m128,b.m128); }
__forceinline Vec3fa max( const Vec3fa& a, const Vec3fa& b ) { return _mm_max_ps(a.m128,b.m128); }
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec3fa mini(const Vec3fa& a, const Vec3fa& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
const vint4 ai = _mm_castps_si128(a.m128);
const vint4 bi = _mm_castps_si128(b.m128);
const vint4 ci = _mm_min_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
#endif
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec3fa maxi(const Vec3fa& a, const Vec3fa& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
const vint4 ai = _mm_castps_si128(a.m128);
const vint4 bi = _mm_castps_si128(b.m128);
const vint4 ci = _mm_max_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
@@ -203,16 +215,16 @@ namespace embree
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX2__)
__forceinline Vec3fa madd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fmadd_ps(a,b,c); }
__forceinline Vec3fa msub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fmsub_ps(a,b,c); }
__forceinline Vec3fa nmadd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fnmadd_ps(a,b,c); }
__forceinline Vec3fa nmsub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fnmsub_ps(a,b,c); }
#if defined(__AVX2__) || defined(__ARM_NEON)
__forceinline Vec3fa madd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fmadd_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fa msub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fmsub_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fa nmadd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fnmadd_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fa nmsub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return _mm_fnmsub_ps(a.m128,b.m128,c.m128); }
#else
__forceinline Vec3fa madd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return a*b+c; }
__forceinline Vec3fa msub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return a*b-c; }
__forceinline Vec3fa nmadd ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return -a*b+c;}
__forceinline Vec3fa nmsub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return -a*b-c; }
__forceinline Vec3fa msub ( const Vec3fa& a, const Vec3fa& b, const Vec3fa& c) { return a*b-c; }
#endif
__forceinline Vec3fa madd ( const float a, const Vec3fa& b, const Vec3fa& c) { return madd(Vec3fa(a),b,c); }
@@ -234,9 +246,27 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
#if defined(__aarch64__)
__forceinline float reduce_add(const Vec3fa& v) {
float32x4_t t = v.m128;
t[3] = 0.0f;
return vaddvq_f32(t);
}
__forceinline float reduce_add(const Vec3fa& v) {
const vfloat4 a(v);
__forceinline float reduce_mul(const Vec3fa& v) { return v.x*v.y*v.z; }
__forceinline float reduce_min(const Vec3fa& v) {
float32x4_t t = v.m128;
t[3] = t[2];
return vminvq_f32(t);
}
__forceinline float reduce_max(const Vec3fa& v) {
float32x4_t t = v.m128;
t[3] = t[2];
return vmaxvq_f32(t);
}
#else
__forceinline float reduce_add(const Vec3fa& v) {
const vfloat4 a(v.m128);
const vfloat4 b = shuffle<1>(a);
const vfloat4 c = shuffle<2>(a);
return _mm_cvtss_f32(a+b+c);
@@ -245,6 +275,7 @@ namespace embree
__forceinline float reduce_mul(const Vec3fa& v) { return v.x*v.y*v.z; }
__forceinline float reduce_min(const Vec3fa& v) { return min(v.x,v.y,v.z); }
__forceinline float reduce_max(const Vec3fa& v) { return max(v.x,v.y,v.z); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
@@ -257,8 +288,13 @@ namespace embree
__forceinline Vec3ba neq_mask(const Vec3fa& a, const Vec3fa& b ) { return _mm_cmpneq_ps(a.m128, b.m128); }
__forceinline Vec3ba lt_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmplt_ps (a.m128, b.m128); }
__forceinline Vec3ba le_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmple_ps (a.m128, b.m128); }
__forceinline Vec3ba gt_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmpnle_ps(a.m128, b.m128); }
__forceinline Vec3ba ge_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmpnlt_ps(a.m128, b.m128); }
#if defined(__aarch64__)
__forceinline Vec3ba gt_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmpgt_ps (a.m128, b.m128); }
__forceinline Vec3ba ge_mask( const Vec3fa& a, const Vec3fa& b ) { return _mm_cmpge_ps (a.m128, b.m128); }
#else
__forceinline Vec3ba gt_mask(const Vec3fa& a, const Vec3fa& b) { return _mm_cmpnle_ps(a.m128, b.m128); }
__forceinline Vec3ba ge_mask(const Vec3fa& a, const Vec3fa& b) { return _mm_cmpnlt_ps(a.m128, b.m128); }
#endif
__forceinline bool isvalid ( const Vec3fa& v ) {
return all(gt_mask(v,Vec3fa(-FLT_LARGE)) & lt_mask(v,Vec3fa(+FLT_LARGE)));
@@ -268,13 +304,21 @@ namespace embree
return all(ge_mask(a,Vec3fa(-FLT_MAX)) & le_mask(a,Vec3fa(+FLT_MAX)));
}
__forceinline bool isvalid4 ( const Vec3fa& v ) {
return all((vfloat4(v.m128) > vfloat4(-FLT_LARGE)) & (vfloat4(v.m128) < vfloat4(+FLT_LARGE)));
}
__forceinline bool is_finite4 ( const Vec3fa& a ) {
return all((vfloat4(a.m128) >= vfloat4(-FLT_MAX)) & (vfloat4(a.m128) <= vfloat4(+FLT_MAX)));
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__SSE4_1__)
__forceinline float dot ( const Vec3fa& a, const Vec3fa& b ) {
return _mm_cvtss_f32(_mm_dp_ps(a,b,0x7F));
return _mm_cvtss_f32(_mm_dp_ps(a.m128,b.m128,0x7F));
}
#else
__forceinline float dot ( const Vec3fa& a, const Vec3fa& b ) {
@@ -284,10 +328,10 @@ namespace embree
__forceinline Vec3fa cross ( const Vec3fa& a, const Vec3fa& b )
{
vfloat4 a0 = vfloat4(a);
vfloat4 b0 = shuffle<1,2,0,3>(vfloat4(b));
vfloat4 a1 = shuffle<1,2,0,3>(vfloat4(a));
vfloat4 b1 = vfloat4(b);
vfloat4 a0 = vfloat4(a.m128);
vfloat4 b0 = shuffle<1,2,0,3>(vfloat4(b.m128));
vfloat4 a1 = shuffle<1,2,0,3>(vfloat4(a.m128));
vfloat4 b1 = vfloat4(b.m128);
return Vec3fa(shuffle<1,2,0,3>(msub(a0,b0,a1*b1)));
}
@@ -318,11 +362,11 @@ namespace embree
__forceinline Vec3fa select( bool s, const Vec3fa& t, const Vec3fa& f ) {
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
return blendv_ps(f, t, mask);
return blendv_ps(f.m128, t.m128, mask);
}
__forceinline Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
return blendv_ps(f, t, s);
return blendv_ps(f.m128, t.m128, s);
}
__forceinline Vec3fa lerp(const Vec3fa& v0, const Vec3fa& v1, const float t) {
@@ -343,10 +387,14 @@ namespace embree
/// Rounding Functions
////////////////////////////////////////////////////////////////////////////////
#if defined (__SSE4_1__)
__forceinline Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
__forceinline Vec3fa floor( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline Vec3fa ceil ( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
#if defined(__aarch64__)
__forceinline Vec3fa floor(const Vec3fa& a) { return vrndmq_f32(a.m128); }
__forceinline Vec3fa ceil (const Vec3fa& a) { return vrndpq_f32(a.m128); }
__forceinline Vec3fa trunc(const Vec3fa& a) { return vrndq_f32(a.m128); }
#elif defined (__SSE4_1__)
__forceinline Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_NEAREST_INT); }
__forceinline Vec3fa floor( const Vec3fa& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_NEG_INF ); }
__forceinline Vec3fa ceil ( const Vec3fa& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_POS_INF ); }
#else
__forceinline Vec3fa trunc( const Vec3fa& a ) { return Vec3fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
__forceinline Vec3fa floor( const Vec3fa& a ) { return Vec3fa(floorf(a.x),floorf(a.y),floorf(a.z)); }
@@ -362,4 +410,376 @@ namespace embree
}
typedef Vec3fa Vec3fa_t;
////////////////////////////////////////////////////////////////////////////////
/// SSE Vec3fx Type
////////////////////////////////////////////////////////////////////////////////
struct __aligned(16) Vec3fx
{
ALIGNED_STRUCT_(16);
typedef float Scalar;
enum { N = 3 };
union {
__m128 m128;
struct { float x,y,z; union { int a; unsigned u; float w; }; };
};
////////////////////////////////////////////////////////////////////////////////
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx( ) {}
__forceinline Vec3fx( const __m128 a ) : m128(a) {}
__forceinline explicit Vec3fx(const Vec3fa& v) : m128(v.m128) {}
__forceinline operator Vec3fa () const { return Vec3fa(m128); }
__forceinline explicit Vec3fx ( const Vec3<float>& other ) { m128 = _mm_set_ps(0, other.z, other.y, other.x); }
//__forceinline Vec3fx& operator =( const Vec3<float>& other ) { m128 = _mm_set_ps(0, other.z, other.y, other.x); return *this; }
__forceinline Vec3fx ( const Vec3fx& other ) { m128 = other.m128; }
__forceinline Vec3fx& operator =( const Vec3fx& other ) { m128 = other.m128; return *this; }
__forceinline explicit Vec3fx( const float a ) : m128(_mm_set1_ps(a)) {}
__forceinline Vec3fx( const float x, const float y, const float z) : m128(_mm_set_ps(0, z, y, x)) {}
__forceinline Vec3fx( const Vec3fa& other, const int a1) { m128 = other.m128; a = a1; }
__forceinline Vec3fx( const Vec3fa& other, const unsigned a1) { m128 = other.m128; u = a1; }
__forceinline Vec3fx( const Vec3fa& other, const float w1) {
#if defined (__aarch64__)
m128 = other.m128; m128[3] = w1;
#elif defined (__SSE4_1__)
m128 = _mm_insert_ps(other.m128, _mm_set_ss(w1),3 << 4);
#else
const vint4 mask(-1,-1,-1,0);
m128 = select(vboolf4(_mm_castsi128_ps(mask)),vfloat4(other.m128),vfloat4(w1));
#endif
}
//__forceinline Vec3fx( const float x, const float y, const float z, const int a) : x(x), y(y), z(z), a(a) {} // not working properly!
//__forceinline Vec3fx( const float x, const float y, const float z, const unsigned a) : x(x), y(y), z(z), u(a) {} // not working properly!
__forceinline Vec3fx( const float x, const float y, const float z, const float w) : m128(_mm_set_ps(w, z, y, x)) {}
//__forceinline explicit Vec3fx( const __m128i a ) : m128(_mm_cvtepi32_ps(a)) {}
__forceinline explicit operator const vfloat4() const { return vfloat4(m128); }
__forceinline explicit operator const vint4() const { return vint4(_mm_cvtps_epi32(m128)); }
__forceinline explicit operator const Vec2fa() const { return Vec2fa(m128); }
__forceinline explicit operator const Vec3ia() const { return Vec3ia(_mm_cvtps_epi32(m128)); }
//__forceinline operator const __m128&() const { return m128; }
//__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline Vec3fx load( const void* const a ) {
return Vec3fx(_mm_and_ps(_mm_load_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1))));
}
static __forceinline Vec3fx loadu( const void* const a ) {
return Vec3fx(_mm_loadu_ps((float*)a));
}
static __forceinline void storeu ( void* ptr, const Vec3fx& v ) {
_mm_storeu_ps((float*)ptr,v.m128);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx( ZeroTy ) : m128(_mm_setzero_ps()) {}
__forceinline Vec3fx( OneTy ) : m128(_mm_set1_ps(1.0f)) {}
__forceinline Vec3fx( PosInfTy ) : m128(_mm_set1_ps(pos_inf)) {}
__forceinline Vec3fx( NegInfTy ) : m128(_mm_set1_ps(neg_inf)) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline const float& operator []( const size_t index ) const { assert(index < 3); return (&x)[index]; }
__forceinline float& operator []( const size_t index ) { assert(index < 3); return (&x)[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx operator +( const Vec3fx& a ) { return a; }
__forceinline Vec3fx operator -( const Vec3fx& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
return _mm_xor_ps(a.m128, mask);
}
__forceinline Vec3fx abs ( const Vec3fx& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
return _mm_and_ps(a.m128, mask);
}
__forceinline Vec3fx sign ( const Vec3fx& a ) {
return blendv_ps(Vec3fx(one).m128, (-Vec3fx(one)).m128, _mm_cmplt_ps (a.m128,Vec3fx(zero).m128));
}
__forceinline Vec3fx rcp ( const Vec3fx& a )
{
#if defined(__AVX512VL__)
const Vec3fx r = _mm_rcp14_ps(a.m128);
#else
const Vec3fx r = _mm_rcp_ps(a.m128);
#endif
#if defined(__AVX2__)
const Vec3fx res = _mm_mul_ps(r.m128,_mm_fnmadd_ps(r.m128, a.m128, vfloat4(2.0f)));
#else
const Vec3fx res = _mm_mul_ps(r.m128,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r.m128, a.m128)));
//return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
#endif
return res;
}
__forceinline Vec3fx sqrt ( const Vec3fx& a ) { return _mm_sqrt_ps(a.m128); }
__forceinline Vec3fx sqr ( const Vec3fx& a ) { return _mm_mul_ps(a.m128,a.m128); }
__forceinline Vec3fx rsqrt( const Vec3fx& a )
{
#if defined(__AVX512VL__)
__m128 r = _mm_rsqrt14_ps(a.m128);
#else
__m128 r = _mm_rsqrt_ps(a.m128);
#endif
return _mm_add_ps(_mm_mul_ps(_mm_set1_ps(1.5f),r), _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a.m128, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
}
__forceinline Vec3fx zero_fix(const Vec3fx& a) {
return blendv_ps(a.m128, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
}
__forceinline Vec3fx rcp_safe(const Vec3fx& a) {
return rcp(zero_fix(a));
}
__forceinline Vec3fx log ( const Vec3fx& a ) {
return Vec3fx(logf(a.x),logf(a.y),logf(a.z));
}
__forceinline Vec3fx exp ( const Vec3fx& a ) {
return Vec3fx(expf(a.x),expf(a.y),expf(a.z));
}
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx operator +( const Vec3fx& a, const Vec3fx& b ) { return _mm_add_ps(a.m128, b.m128); }
__forceinline Vec3fx operator -( const Vec3fx& a, const Vec3fx& b ) { return _mm_sub_ps(a.m128, b.m128); }
__forceinline Vec3fx operator *( const Vec3fx& a, const Vec3fx& b ) { return _mm_mul_ps(a.m128, b.m128); }
__forceinline Vec3fx operator *( const Vec3fx& a, const float b ) { return a * Vec3fx(b); }
__forceinline Vec3fx operator *( const float a, const Vec3fx& b ) { return Vec3fx(a) * b; }
__forceinline Vec3fx operator /( const Vec3fx& a, const Vec3fx& b ) { return _mm_div_ps(a.m128,b.m128); }
__forceinline Vec3fx operator /( const Vec3fx& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
__forceinline Vec3fx operator /( const float a, const Vec3fx& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
__forceinline Vec3fx min( const Vec3fx& a, const Vec3fx& b ) { return _mm_min_ps(a.m128,b.m128); }
__forceinline Vec3fx max( const Vec3fx& a, const Vec3fx& b ) { return _mm_max_ps(a.m128,b.m128); }
#if defined(__SSE4_1__) || defined(__aarch64__)
__forceinline Vec3fx mini(const Vec3fx& a, const Vec3fx& b) {
const vint4 ai = _mm_castps_si128(a.m128);
const vint4 bi = _mm_castps_si128(b.m128);
const vint4 ci = _mm_min_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
#endif
#if defined(__SSE4_1__) || defined(__aarch64__)
__forceinline Vec3fx maxi(const Vec3fx& a, const Vec3fx& b) {
const vint4 ai = _mm_castps_si128(a.m128);
const vint4 bi = _mm_castps_si128(b.m128);
const vint4 ci = _mm_max_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
#endif
__forceinline Vec3fx pow ( const Vec3fx& a, const float& b ) {
return Vec3fx(powf(a.x,b),powf(a.y,b),powf(a.z,b));
}
////////////////////////////////////////////////////////////////////////////////
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX2__)
__forceinline Vec3fx madd ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return _mm_fmadd_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fx msub ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return _mm_fmsub_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fx nmadd ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return _mm_fnmadd_ps(a.m128,b.m128,c.m128); }
__forceinline Vec3fx nmsub ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return _mm_fnmsub_ps(a.m128,b.m128,c.m128); }
#else
__forceinline Vec3fx madd ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return a*b+c; }
__forceinline Vec3fx msub ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return a*b-c; }
__forceinline Vec3fx nmadd ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return -a*b+c;}
__forceinline Vec3fx nmsub ( const Vec3fx& a, const Vec3fx& b, const Vec3fx& c) { return -a*b-c; }
#endif
__forceinline Vec3fx madd ( const float a, const Vec3fx& b, const Vec3fx& c) { return madd(Vec3fx(a),b,c); }
__forceinline Vec3fx msub ( const float a, const Vec3fx& b, const Vec3fx& c) { return msub(Vec3fx(a),b,c); }
__forceinline Vec3fx nmadd ( const float a, const Vec3fx& b, const Vec3fx& c) { return nmadd(Vec3fx(a),b,c); }
__forceinline Vec3fx nmsub ( const float a, const Vec3fx& b, const Vec3fx& c) { return nmsub(Vec3fx(a),b,c); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx& operator +=( Vec3fx& a, const Vec3fx& b ) { return a = a + b; }
__forceinline Vec3fx& operator -=( Vec3fx& a, const Vec3fx& b ) { return a = a - b; }
__forceinline Vec3fx& operator *=( Vec3fx& a, const Vec3fx& b ) { return a = a * b; }
__forceinline Vec3fx& operator *=( Vec3fx& a, const float b ) { return a = a * b; }
__forceinline Vec3fx& operator /=( Vec3fx& a, const Vec3fx& b ) { return a = a / b; }
__forceinline Vec3fx& operator /=( Vec3fx& a, const float b ) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline float reduce_add(const Vec3fx& v) {
const vfloat4 a(v.m128);
const vfloat4 b = shuffle<1>(a);
const vfloat4 c = shuffle<2>(a);
return _mm_cvtss_f32(a+b+c);
}
__forceinline float reduce_mul(const Vec3fx& v) { return v.x*v.y*v.z; }
__forceinline float reduce_min(const Vec3fx& v) { return min(v.x,v.y,v.z); }
__forceinline float reduce_max(const Vec3fx& v) { return max(v.x,v.y,v.z); }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator ==( const Vec3fx& a, const Vec3fx& b ) { return (_mm_movemask_ps(_mm_cmpeq_ps (a.m128, b.m128)) & 7) == 7; }
__forceinline bool operator !=( const Vec3fx& a, const Vec3fx& b ) { return (_mm_movemask_ps(_mm_cmpneq_ps(a.m128, b.m128)) & 7) != 0; }
__forceinline Vec3ba eq_mask( const Vec3fx& a, const Vec3fx& b ) { return _mm_cmpeq_ps (a.m128, b.m128); }
__forceinline Vec3ba neq_mask(const Vec3fx& a, const Vec3fx& b ) { return _mm_cmpneq_ps(a.m128, b.m128); }
__forceinline Vec3ba lt_mask( const Vec3fx& a, const Vec3fx& b ) { return _mm_cmplt_ps (a.m128, b.m128); }
__forceinline Vec3ba le_mask( const Vec3fx& a, const Vec3fx& b ) { return _mm_cmple_ps (a.m128, b.m128); }
__forceinline Vec3ba gt_mask( const Vec3fx& a, const Vec3fx& b ) { return _mm_cmpnle_ps(a.m128, b.m128); }
__forceinline Vec3ba ge_mask( const Vec3fx& a, const Vec3fx& b ) { return _mm_cmpnlt_ps(a.m128, b.m128); }
__forceinline bool isvalid ( const Vec3fx& v ) {
return all(gt_mask(v,Vec3fx(-FLT_LARGE)) & lt_mask(v,Vec3fx(+FLT_LARGE)));
}
__forceinline bool is_finite ( const Vec3fx& a ) {
return all(ge_mask(a,Vec3fx(-FLT_MAX)) & le_mask(a,Vec3fx(+FLT_MAX)));
}
__forceinline bool isvalid4 ( const Vec3fx& v ) {
return all((vfloat4(v.m128) > vfloat4(-FLT_LARGE)) & (vfloat4(v.m128) < vfloat4(+FLT_LARGE)));
}
__forceinline bool is_finite4 ( const Vec3fx& a ) {
return all((vfloat4(a.m128) >= vfloat4(-FLT_MAX)) & (vfloat4(a.m128) <= vfloat4(+FLT_MAX)));
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__SSE4_1__)
__forceinline float dot ( const Vec3fx& a, const Vec3fx& b ) {
return _mm_cvtss_f32(_mm_dp_ps(a.m128,b.m128,0x7F));
}
#else
__forceinline float dot ( const Vec3fx& a, const Vec3fx& b ) {
return reduce_add(a*b);
}
#endif
__forceinline Vec3fx cross ( const Vec3fx& a, const Vec3fx& b )
{
vfloat4 a0 = vfloat4(a.m128);
vfloat4 b0 = shuffle<1,2,0,3>(vfloat4(b.m128));
vfloat4 a1 = shuffle<1,2,0,3>(vfloat4(a.m128));
vfloat4 b1 = vfloat4(b.m128);
return Vec3fx(shuffle<1,2,0,3>(msub(a0,b0,a1*b1)));
}
__forceinline float sqr_length ( const Vec3fx& a ) { return dot(a,a); }
__forceinline float rcp_length ( const Vec3fx& a ) { return rsqrt(dot(a,a)); }
__forceinline float rcp_length2( const Vec3fx& a ) { return rcp(dot(a,a)); }
__forceinline float length ( const Vec3fx& a ) { return sqrt(dot(a,a)); }
__forceinline Vec3fx normalize( const Vec3fx& a ) { return a*rsqrt(dot(a,a)); }
__forceinline float distance ( const Vec3fx& a, const Vec3fx& b ) { return length(a-b); }
__forceinline float halfArea ( const Vec3fx& d ) { return madd(d.x,(d.y+d.z),d.y*d.z); }
__forceinline float area ( const Vec3fx& d ) { return 2.0f*halfArea(d); }
__forceinline Vec3fx normalize_safe( const Vec3fx& a ) {
const float d = dot(a,a); if (unlikely(d == 0.0f)) return a; else return a*rsqrt(d);
}
/*! differentiated normalization */
__forceinline Vec3fx dnormalize(const Vec3fx& p, const Vec3fx& dp)
{
const float pp = dot(p,p);
const float pdp = dot(p,dp);
return (pp*dp-pdp*p)*rcp(pp)*rsqrt(pp);
}
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3fx select( bool s, const Vec3fx& t, const Vec3fx& f ) {
__m128 mask = s ? _mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128())) : _mm_setzero_ps();
return blendv_ps(f.m128, t.m128, mask);
}
__forceinline Vec3fx select( const Vec3ba& s, const Vec3fx& t, const Vec3fx& f ) {
return blendv_ps(f.m128, t.m128, s);
}
__forceinline Vec3fx lerp(const Vec3fx& v0, const Vec3fx& v1, const float t) {
return madd(1.0f-t,v0,t*v1);
}
__forceinline int maxDim ( const Vec3fx& a )
{
const Vec3fx b = abs(a);
if (b.x > b.y) {
if (b.x > b.z) return 0; else return 2;
} else {
if (b.y > b.z) return 1; else return 2;
}
}
////////////////////////////////////////////////////////////////////////////////
/// Rounding Functions
////////////////////////////////////////////////////////////////////////////////
#if defined(__aarch64__)
__forceinline Vec3fx trunc(const Vec3fx& a) { return vrndq_f32(a.m128); }
__forceinline Vec3fx floor(const Vec3fx& a) { return vrndmq_f32(a.m128); }
__forceinline Vec3fx ceil (const Vec3fx& a) { return vrndpq_f32(a.m128); }
#elif defined (__SSE4_1__)
__forceinline Vec3fx trunc( const Vec3fx& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_NEAREST_INT); }
__forceinline Vec3fx floor( const Vec3fx& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_NEG_INF ); }
__forceinline Vec3fx ceil ( const Vec3fx& a ) { return _mm_round_ps(a.m128, _MM_FROUND_TO_POS_INF ); }
#else
__forceinline Vec3fx trunc( const Vec3fx& a ) { return Vec3fx(truncf(a.x),truncf(a.y),truncf(a.z)); }
__forceinline Vec3fx floor( const Vec3fx& a ) { return Vec3fx(floorf(a.x),floorf(a.y),floorf(a.z)); }
__forceinline Vec3fx ceil ( const Vec3fx& a ) { return Vec3fx(ceilf (a.x),ceilf (a.y),ceilf (a.z)); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline embree_ostream operator<<(embree_ostream cout, const Vec3fx& a) {
return cout << "(" << a.x << ", " << a.y << ", " << a.z << ")";
}
typedef Vec3fx Vec3ff;
}
+30 -20
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -19,7 +19,7 @@ namespace embree
union {
__m128i m128;
struct { int x,y,z; int a; };
struct { int x,y,z; };
};
typedef int Scalar;
@@ -65,7 +65,9 @@ namespace embree
__forceinline Vec3ia operator +( const Vec3ia& a ) { return a; }
__forceinline Vec3ia operator -( const Vec3ia& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.m128); }
#if defined(__SSSE3__)
#if (defined(__aarch64__))
__forceinline Vec3ia abs ( const Vec3ia& a ) { return vabsq_s32(a.m128); }
#elif defined(__SSSE3__)
__forceinline Vec3ia abs ( const Vec3ia& a ) { return _mm_abs_epi32(a.m128); }
#endif
@@ -81,7 +83,7 @@ namespace embree
__forceinline Vec3ia operator -( const Vec3ia& a, const int b ) { return a-Vec3ia(b); }
__forceinline Vec3ia operator -( const int a, const Vec3ia& b ) { return Vec3ia(a)-b; }
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec3ia operator *( const Vec3ia& a, const Vec3ia& b ) { return _mm_mullo_epi32(a.m128, b.m128); }
__forceinline Vec3ia operator *( const Vec3ia& a, const int b ) { return a * Vec3ia(b); }
__forceinline Vec3ia operator *( const int a, const Vec3ia& b ) { return Vec3ia(a) * b; }
@@ -116,7 +118,7 @@ namespace embree
__forceinline Vec3ia& operator -=( Vec3ia& a, const Vec3ia& b ) { return a = a - b; }
__forceinline Vec3ia& operator -=( Vec3ia& a, const int& b ) { return a = a - b; }
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec3ia& operator *=( Vec3ia& a, const Vec3ia& b ) { return a = a * b; }
__forceinline Vec3ia& operator *=( Vec3ia& a, const int& b ) { return a = a * b; }
#endif
@@ -127,18 +129,38 @@ namespace embree
__forceinline Vec3ia& operator |=( Vec3ia& a, const Vec3ia& b ) { return a = a | b; }
__forceinline Vec3ia& operator |=( Vec3ia& a, const int& b ) { return a = a | b; }
#if !defined(__ARM_NEON)
__forceinline Vec3ia& operator <<=( Vec3ia& a, const int& b ) { return a = a << b; }
__forceinline Vec3ia& operator >>=( Vec3ia& a, const int& b ) { return a = a >> b; }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3ia select( const Vec3ba& m, const Vec3ia& t, const Vec3ia& f ) {
#if defined(__aarch64__) || defined(__SSE4_1__)
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
#else
return _mm_or_si128(_mm_and_si128(_mm_castps_si128(m), t), _mm_andnot_si128(_mm_castps_si128(m), f));
#endif
}
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
#if defined(__aarch64__)
__forceinline int reduce_add(const Vec3ia& v) { return vaddvq_s32(select(Vec3ba(1,1,1),v,Vec3ia(0))); }
__forceinline int reduce_mul(const Vec3ia& v) { return v.x*v.y*v.z; }
__forceinline int reduce_min(const Vec3ia& v) { return vminvq_s32(select(Vec3ba(1,1,1),v,Vec3ia(0x7FFFFFFF))); }
__forceinline int reduce_max(const Vec3ia& v) { return vmaxvq_s32(select(Vec3ba(1,1,1),v,Vec3ia(0x80000000))); }
#else
__forceinline int reduce_add(const Vec3ia& v) { return v.x+v.y+v.z; }
__forceinline int reduce_mul(const Vec3ia& v) { return v.x*v.y*v.z; }
__forceinline int reduce_min(const Vec3ia& v) { return min(v.x,v.y,v.z); }
__forceinline int reduce_max(const Vec3ia& v) { return max(v.x,v.y,v.z); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
////////////////////////////////////////////////////////////////////////////////
@@ -156,19 +178,7 @@ namespace embree
__forceinline Vec3ba lt_mask( const Vec3ia& a, const Vec3ia& b ) { return _mm_castsi128_ps(_mm_cmplt_epi32 (a.m128, b.m128)); }
__forceinline Vec3ba gt_mask( const Vec3ia& a, const Vec3ia& b ) { return _mm_castsi128_ps(_mm_cmpgt_epi32 (a.m128, b.m128)); }
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec3ia select( const Vec3ba& m, const Vec3ia& t, const Vec3ia& f ) {
#if defined(__SSE4_1__)
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
#else
return _mm_or_si128(_mm_and_si128(_mm_castps_si128(m), t), _mm_andnot_si128(_mm_castps_si128(m), f));
#endif
}
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return _mm_min_epi32(a.m128,b.m128); }
__forceinline Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return _mm_max_epi32(a.m128,b.m128); }
#else
+11 -26
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -34,7 +34,7 @@ namespace embree
__forceinline Vec4( const Vec3<T>& xyz, const T& w ) : x(xyz.x), y(xyz.y), z(xyz.z), w(w) {}
__forceinline Vec4( const Vec4& other ) { x = other.x; y = other.y; z = other.z; w = other.w; }
__forceinline Vec4( const Vec3fa& other );
__forceinline Vec4( const Vec3fx& other );
template<typename T1> __forceinline Vec4( const Vec4<T1>& a ) : x(T(a.x)), y(T(a.y)), z(T(a.z)), w(T(a.w)) {}
template<typename T1> __forceinline Vec4& operator =(const Vec4<T1>& other) { x = other.x; y = other.y; z = other.z; w = other.w; return *this; }
@@ -149,7 +149,7 @@ namespace embree
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
/// Euclidean Space Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline T dot ( const Vec4<T>& a, const Vec4<T>& b ) { return madd(a.x,b.x,madd(a.y,b.y,madd(a.z,b.z,a.w*b.w))); }
@@ -205,7 +205,7 @@ namespace embree
/// SSE / AVX / MIC specializations
////////////////////////////////////////////////////////////////////////////////
#if defined __SSE__
#if defined(__SSE__) || defined(__ARM_NEON)
#include "../simd/sse.h"
#endif
@@ -219,40 +219,25 @@ namespace embree
namespace embree
{
template<> __forceinline Vec4<float>::Vec4( const Vec3fa& a ) { x = a.x; y = a.y; z = a.z; w = a.w; }
template<> __forceinline Vec4<float>::Vec4( const Vec3fx& a ) { x = a.x; y = a.y; z = a.z; w = a.w; }
#if defined(__AVX__)
template<> __forceinline Vec4<vfloat4>::Vec4( const Vec3fa& a ) {
template<> __forceinline Vec4<vfloat4>::Vec4( const Vec3fx& a ) {
x = a.x; y = a.y; z = a.z; w = a.w;
}
#elif defined(__SSE__)
template<> __forceinline Vec4<vfloat4>::Vec4( const Vec3fa& a ) {
const vfloat4 v = vfloat4(a); x = shuffle<0,0,0,0>(v); y = shuffle<1,1,1,1>(v); z = shuffle<2,2,2,2>(v); w = shuffle<3,3,3,3>(v);
}
#endif
#if defined(__SSE__)
__forceinline Vec4<vfloat4> broadcast4f( const Vec4<vfloat4>& a, const size_t k ) {
return Vec4<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]), vfloat4::broadcast(&a.w[k]));
#elif defined(__SSE__) || defined(__ARM_NEON)
template<> __forceinline Vec4<vfloat4>::Vec4( const Vec3fx& a ) {
const vfloat4 v = vfloat4(a.m128); x = shuffle<0,0,0,0>(v); y = shuffle<1,1,1,1>(v); z = shuffle<2,2,2,2>(v); w = shuffle<3,3,3,3>(v);
}
#endif
#if defined(__AVX__)
template<> __forceinline Vec4<vfloat8>::Vec4( const Vec3fa& a ) {
template<> __forceinline Vec4<vfloat8>::Vec4( const Vec3fx& a ) {
x = a.x; y = a.y; z = a.z; w = a.w;
}
__forceinline Vec4<vfloat4> broadcast4f( const Vec4<vfloat8>& a, const size_t k ) {
return Vec4<vfloat4>(vfloat4::broadcast(&a.x[k]), vfloat4::broadcast(&a.y[k]), vfloat4::broadcast(&a.z[k]), vfloat4::broadcast(&a.w[k]));
}
__forceinline Vec4<vfloat8> broadcast8f( const Vec4<vfloat4>& a, const size_t k ) {
return Vec4<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]), vfloat8::broadcast(&a.w[k]));
}
__forceinline Vec4<vfloat8> broadcast8f( const Vec4<vfloat8>& a, const size_t k ) {
return Vec4<vfloat8>(vfloat8::broadcast(&a.x[k]), vfloat8::broadcast(&a.y[k]), vfloat8::broadcast(&a.z[k]), vfloat8::broadcast(&a.w[k]));
}
#endif
#if defined(__AVX512F__)
template<> __forceinline Vec4<vfloat16>::Vec4( const Vec3fa& a ) : x(a.x), y(a.y), z(a.z), w(a.w) {}
template<> __forceinline Vec4<vfloat16>::Vec4( const Vec3fx& a ) : x(a.x), y(a.y), z(a.z), w(a.w) {}
#endif
}
+3 -4
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ADD_LIBRARY(simd STATIC sse.cpp)
@@ -6,7 +6,6 @@ SET_PROPERTY(TARGET simd PROPERTY FOLDER common)
SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
INSTALL(EXPORT simd-targets DESTINATION ${EMBREE_CMAKECONFIG_DIR} COMPONENT devel)
SIGN_TARGET(simd)
INSTALL(TARGETS simd EXPORT simd-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
INSTALL(EXPORT simd-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel)
ENDIF()
File diff suppressed because it is too large Load Diff
+85
View File
@@ -0,0 +1,85 @@
// Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
/* Make precision match SSE, at the cost of some performance */
#if !defined(__aarch64__)
# define SSE2NEON_PRECISE_DIV 1
# define SSE2NEON_PRECISE_SQRT 1
#endif
#include "sse2neon.h"
__forceinline __m128 _mm_abs_ps(__m128 a) { return vabsq_f32(a); }
__forceinline __m128 _mm_fmadd_ps (__m128 a, __m128 b, __m128 c) { return vfmaq_f32(c, a, b); }
__forceinline __m128 _mm_fnmadd_ps(__m128 a, __m128 b, __m128 c) { return vfmsq_f32(c, a, b); }
__forceinline __m128 _mm_fnmsub_ps(__m128 a, __m128 b, __m128 c) { return vnegq_f32(vfmaq_f32(c, a, b)); }
__forceinline __m128 _mm_fmsub_ps (__m128 a, __m128 b, __m128 c) { return vnegq_f32(vfmsq_f32(c, a, b)); }
__forceinline __m128 _mm_broadcast_ss (float const * mem_addr)
{
return vdupq_n_f32(*mem_addr);
}
// AVX2 emulation leverages Intel FMA defs above. Include after them.
#include "avx2neon.h"
/* Dummy defines for floating point control */
#define _MM_MASK_MASK 0x1f80
#define _MM_MASK_DIV_ZERO 0x200
// #define _MM_FLUSH_ZERO_ON 0x8000
#define _MM_MASK_DENORM 0x100
#define _MM_SET_EXCEPTION_MASK(x)
// #define _MM_SET_FLUSH_ZERO_MODE(x)
__forceinline int _mm_getcsr()
{
return 0;
}
__forceinline void _mm_mfence()
{
__sync_synchronize();
}
__forceinline __m128i _mm_load4epu8_epi32(__m128i *ptr)
{
uint8x8_t t0 = vld1_u8((uint8_t*)ptr);
uint16x8_t t1 = vmovl_u8(t0);
uint32x4_t t2 = vmovl_u16(vget_low_u16(t1));
return vreinterpretq_s32_u32(t2);
}
__forceinline __m128i _mm_load4epu16_epi32(__m128i *ptr)
{
uint16x8_t t0 = vld1q_u16((uint16_t*)ptr);
uint32x4_t t1 = vmovl_u16(vget_low_u16(t0));
return vreinterpretq_s32_u32(t1);
}
__forceinline __m128i _mm_load4epi8_f32(__m128i *ptr)
{
int8x8_t t0 = vld1_s8((int8_t*)ptr);
int16x8_t t1 = vmovl_s8(t0);
int32x4_t t2 = vmovl_s16(vget_low_s16(t1));
float32x4_t t3 = vcvtq_f32_s32(t2);
return vreinterpretq_s32_f32(t3);
}
__forceinline __m128i _mm_load4epu8_f32(__m128i *ptr)
{
uint8x8_t t0 = vld1_u8((uint8_t*)ptr);
uint16x8_t t1 = vmovl_u8(t0);
uint32x4_t t2 = vmovl_u16(vget_low_u16(t1));
return vreinterpretq_s32_u32(t2);
}
__forceinline __m128i _mm_load4epi16_f32(__m128i *ptr)
{
int16x8_t t0 = vld1q_s16((int16_t*)ptr);
int32x4_t t1 = vmovl_s16(vget_low_s16(t0));
float32x4_t t2 = vcvtq_f32_s32(t1);
return vreinterpretq_s32_f32(t2);
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -6,7 +6,7 @@
#include "../math/math.h"
/* include SSE wrapper classes */
#if defined(__SSE__)
#if defined(__SSE__) || defined(__ARM_NEON)
# include "sse.h"
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "sse.h"
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -11,7 +11,7 @@
namespace embree
{
#if defined(__SSE4_1__)
#if defined(__aarch64__) || defined(__SSE4_1__)
__forceinline __m128 blendv_ps(__m128 f, __m128 t, __m128 mask) {
return _mm_blendv_ps(f,t,mask);
}

Some files were not shown because too many files have changed in this diff Show More