Compare commits

..
2488 Commits
Author SHA1 Message Date
Sven Woop 86dbc8a437 fixed comments 2018-12-13 08:41:14 +01:00
Sven Woop 4c93274a31 added support for arbitrary SAH block size 2018-12-13 08:39:06 +01:00
Sven Woop bd7ea15f50 replaced logBlockSize by sahBlockSize 2018-12-13 08:22:12 +01:00
Sven Woop 1df9591a8c replaced logBlockSize by sahBlockSize 2018-12-13 07:53:13 +01:00
Sven Woop 23753277fa regenerated documentation 2018-11-22 07:18:21 +01:00
Sven Woop 95053e8c6e setting version to v3.3.0 2018-11-22 07:16:52 +01:00
Sven Woop 0ff0a6909b Merge branch 'devel' of gitlab.com:sdvis/embree into devel 2018-11-21 07:15:17 +01:00
Sven Woop 40e445ade8 setting CMP0042 policy to NEW by default 2018-11-21 07:15:06 +01:00
Sven Woop 8c08b5c5b5 bugfix in open_sequential function, this codepath is currently disabled 2018-11-20 05:39:10 +01:00
Sven Woop a07e9b0c5c Revert "Applied bugfix for missed perfectly axis aligned motion blurred"
This issue is already worked around in the setBounds function of
BVH.

This reverts commit 17a17f7e18.
2018-11-19 17:45:39 +01:00
Sven Woop 0f4f821f76 added documentation for motion blur time range 2018-11-19 08:31:50 +01:00
Sven Woop cf4d9e9f62 Merge branch 'devel' into swoop 2018-11-19 07:54:14 +01:00
Sven Woop d25f7b0ac2 moved previous changelog update to doc/src/changelog.md 2018-11-09 11:03:18 +01:00
Tim Rowley 15caf3fd1b Fix black tutorial windows on macOS 10.14 until moved. 2018-11-07 10:25:32 -06:00
Sven Woop 0eb47c2c6b bugfixes in ambient occlusion shader (--shader ao) 2018-11-06 08:16:03 +01:00
Sven Woop 9de546d581 Fixed crash with pathtracer when using --shader ao command line 2018-11-06 08:00:40 +01:00
Sven Woop 33bd19d2a3 setting version to v3.2.5-alpha.0 2018-11-06 07:45:17 +01:00
Sven Woop 4e1a7741fb Fixed segfault of pathtracer when invoking with --triangle-sphere command line option. 2018-11-06 07:44:19 +01:00
Johannes Günther e2f4851405 Fix typo&links (vs1[24]->vc1[24]), package correct tbb.dll for vc14 2018-10-29 14:29:15 +01:00
Sven Woop 7662e7b260 regenerated documentation 2018-10-25 17:14:31 +02:00
Sven Woop 4a12bfed63 setting version to v3.2.4 2018-10-25 12:34:10 +02:00
Sven Woop 1bf492e704 releasing ZIP files for vs12 and vs14 2018-10-25 12:33:50 +02:00
Sven Woop 8e3fc16de5 bugfix in CI 2018-10-25 12:16:53 +02:00
Sven Woop d110857224 fixed compile issues with ICC 2019 2018-10-25 11:50:28 +02:00
Sven Woop 09a6013b79 regenerated documentation 2018-10-11 06:59:50 +02:00
Sven Woop 60254acc8a setting version to v3.2.3 2018-10-11 06:57:50 +02:00
Sven Woop 6c6aa92560 setting version to v3.2.3-alpha.0 2018-10-10 10:01:17 +02:00
Sven Woop 79c9f4a1b8 Fixed crash when using curves with RTC_SCENE_FLAG_DYNAMIC and RTC_BUILD_QUALITY_MEDIUM 2018-10-10 09:51:30 +02:00
Sven Woop ae20787a43 added hair to regression_dynamic test 2018-10-10 09:51:23 +02:00
Sven Woop a8fda51877 fixed typo in changelog 2018-10-10 07:12:40 +02:00
Sven Woop dac0fa9d4a regenerated documentation 2018-10-05 21:52:32 +02:00
Sven Woop 140c5c5680 setting version to v3.2.2 2018-10-05 21:51:36 +02:00
Sven Woop d5d7d5bbef fixed wrong command line in tutorial.md 2018-10-05 17:26:35 +02:00
Sven Woop 4fd65fbf17 added libthree customer to projects page 2018-10-05 11:30:06 +02:00
Sven Woop 53c87a2ec8 Fixed detection of AppleClang compiler under MacOSX 2018-10-05 11:25:07 +02:00
Sven Woop fc7a76fa67 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-10-05 06:49:48 +02:00
Sven Woop 4630132503 setting version to v3.2.2-alpha.0 2018-10-05 06:49:37 +02:00
Sven Woop 81185adc9b setting version to v3.2.1-alpha.0 2018-10-05 06:48:00 +02:00
Sven Woop 3c7862a953 Fixed intersection distance for unnormalized rays with line segments. 2018-10-05 06:47:19 +02:00
Sven Woop 617100a4b9 added compressed-leaf BVH paper 2018-10-03 07:28:32 +02:00
Sven Woop 4ab3b7c36a added Meso Star customer 2018-10-01 07:45:16 +02:00
Johannes Günther 045c3b9099 Polish status message a bit 2018-09-26 10:20:07 +02:00
Sven Woop 0d56e0eb04 Merge pull request #212 from demarle/fixup-cray-build
move a cray specific setting to the right place
2018-09-26 06:23:00 +02:00
Sven Woop 08757fe9cd disabled fast transcendentals as workaround for sincosf linking error 2018-09-25 12:12:35 +02:00
Johannes Günther 38c347f9be Removed libmmd dependency 2018-09-25 12:12:20 +02:00
David E. DeMarle 7ac397ad35 move a cray specific setting to the right place
The code got shifted around such that the attempt to disable
sse42 on cray in the crayprgenv section failed because the cache
variable has not yet been created. This change moves that
specific bit later to make everything work as intended.
2018-09-24 14:08:10 -04:00
Sven Woop bbc55cee7c regenerated documentation 2018-09-24 16:07:43 +02:00
Sven Woop e7325f6a54 changed version to v3.2.1 2018-09-24 16:04:38 +02:00
Sven Woop ecf885023e workaround for failing PPL tests 2018-09-22 18:33:15 +02:00
Sven Woop e9328c5dfd reduced temporal memory of grid builder 2018-09-21 12:21:09 +02:00
Sven Woop 4c54822dca Revert "Removed libmmd dependency"
This reverts commit b34d224a7c.
2018-09-20 12:06:10 +02:00
Johannes Günther b34d224a7c Removed libmmd dependency 2018-09-19 11:19:23 +02:00
Attila Afra 9dd6dc3b7c fixed inconsistent handling of NaNs in SIMD comparisons 2018-09-19 07:11:28 +02:00
Sven Woop 688a867a5a Revert "fixed inconsistent handling of NaNs in SIMD comparisons"
This reverts commit c46a2b48fd.
2018-09-17 19:10:32 +02:00
Sven Woop 06c4274e0f reduced complexity of address sanitizer test further 2018-09-17 08:46:02 +02:00
Sven Woop c2275ce57e Improved fix for bug in multi segment motion blur that caused
missing of perfectly axis aligned geometry.
2018-09-17 08:40:44 +02:00
Sven Woop 528b23a699 workaround for ICC 2018 compiler bug 2018-09-17 08:35:09 +02:00
Sven Woop 68feaa034e Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-09-17 07:04:57 +02:00
Sven Woop 91809d98d7 Merge commit 'dd857c7' into devel 2018-09-16 20:54:06 +02:00
Sven Woop dd857c798f Revert "Remove libmmd dependency"
This reverts commit a89b7b3c3b.
2018-09-16 20:53:43 +02:00
Sven Woop 8cfc1a3893 Revert "Fix warnings for RelWithDebInfo on Windows"
This reverts commit ab7694016a.
2018-09-16 20:52:42 +02:00
Sven Woop 24b6002b09 Merge branch 'memory_reductions' into devel 2018-09-15 18:52:23 +02:00
Sven Woop 049b08ca0f reduced complexity of addr sanitizer tests 2018-09-15 11:12:22 +02:00
Stefan Werner 84b4242cdb Updated Find Embree tutorial to work with Embree 3.2 and newer. 2018-09-13 13:34:29 +02:00
Sven Woop 890cb29e7b Reduced MAX_TASKS in parallel algorithms from 512 to 64. This
significantly reduces stack size requirements of our algorithms.
2018-09-13 10:00:50 +02:00
Sven Woop 8d5b349e27 Moved prefix sum state of subdiv builder from build task onto stack.
This reduces the memory consumption of the subdiv build task significantly.
Size of the builder was over 100k in some cases.
2018-09-13 09:55:44 +02:00
Sven Woop e04b3127bc Reduced memory consumption of small scenes by 4x.
- Scene is now derived from AccelN
- AccelN uses single std::vector to store list of accels.
- Scene only creates accels and builders that are required for the scene.
2018-09-13 09:42:51 +02:00
Sven Woop cdb12a2877 Fixed bug when scene mode was changed for dynamic scenes.
BVH builders would get regenerated, but two level builder
would not re-build previously build geometries.
2018-09-13 09:09:07 +02:00
Attila Afra c46a2b48fd fixed inconsistent handling of NaNs in SIMD comparisons 2018-09-12 14:17:42 +03:00
Sven Woop c345dc3ad6 fix in verify, returned linear bounds are slightly enlarged now 2018-09-11 08:03:41 +02:00
Sven Woop c9bac63dcd enabling instances but not user geometries works now 2018-09-11 07:15:53 +02:00
Sven Woop 17a17f7e18 Applied bugfix for missed perfectly axis aligned motion blurred
geometry also to time range implementation for motion blur.
2018-09-11 07:00:39 +02:00
Sven Woop b27a31f572 Merge branch 'devel' into swoop 2018-09-11 06:57:54 +02:00
Sven Woop f785496706 Fixed bug in multi segment motion blur that caused missing of perfectly
axis aligned geometry.
2018-09-11 06:47:18 +02:00
Sven Woop 208297aa12 updates to changelog 2018-09-07 10:40:23 +02:00
Sven Woop a2189c43e8 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-09-07 10:38:42 +02:00
Sven Woop 4ff7f4fab9 proper fix to return correct transformation in rtcGetGeometryTransform 2018-09-07 08:34:35 +02:00
Sven Woop 18c3557f70 Reverting this for now to get CI working. Will later activate and test again.
Revert "Remove libmmd dependency"

This reverts commit a89b7b3c3b.
2018-09-07 08:32:24 +02:00
Sven Woop 0da9a187a0 replacing Embree by Intel(R) Embree at some places on docu and webpage 2018-09-06 10:55:30 +02:00
Sven Woop a7772b05aa changed model hash to include time segment mblur test for instances 2018-09-06 10:31:49 +02:00
Sven Woop 03f24bbba5 fixes to scenegraph to support time range for instances 2018-09-06 10:29:45 +02:00
Sven Woop d2db02fa10 bugfix in time range for motion blur geometry of instances 2018-09-06 09:30:25 +02:00
Sven Woop 22efa65df6 Added BVH8 support for motion blurred curves and lines. 2018-09-06 08:59:06 +02:00
Sven Woop a6e9fc994c Bugfix in length of derivatives for grid geometry. 2018-09-06 08:09:30 +02:00
Sven Woop 14bd6d7002 Removed further not necessary refcounting from various API functions. 2018-09-06 07:59:04 +02:00
Sven Woop 6c25c3eb63 fixed link to tutorials 2018-09-04 12:55:45 +02:00
Sven Woop acb5038c8a added link to siggraph 2018 slides 2018-09-04 11:04:11 +02:00
Carsten Benthin 19932d1b7f setting version to v3.2.1-alpha.4 2018-08-30 04:47:29 -08:00
Carsten Benthin f95089bc85 setting version to v3.2.1-alpha.4 2018-08-30 04:45:38 -08:00
cbenthin a8783fe64a updated changelog 2018-08-30 12:16:09 +02:00
cbenthin d4d9a6a936 AffineSpace3fa Instance::getTransform(float time) returns now rcp(transform), otherwise rtcGetGeometryTransform returns wrong (inverse) data; removed ref counting from rtcGetGeometryUserData call 2018-08-30 12:09:49 +02:00
cbenthin 7207342964 setting version to v3.2.1-alpha.3 2018-08-29 10:03:01 +02:00
Johannes Günther cef97d043c Merge changelog from embree v2 2018-07-26 17:22:31 +02:00
Attila Afra 80c0fae902 cleanup 2018-07-13 17:38:12 +03:00
Attila Afra fd6eca502f fixed bug in temporal splitting 2018-07-13 17:21:00 +03:00
cbenthin a1c750b5a2 merged devel into swoop 2018-07-11 16:46:56 +02:00
Attila Afra 226f9e1fb5 fixed bug in getTimeSegmentRange 2018-07-11 14:15:30 +03:00
Johannes Günther 8507bf0945 This was not the right fix for unresolved externals
This reverts commit ff64407196.
2018-07-06 13:39:28 +02:00
Johannes Günther 6e73a383db Compute relative path, fixes #194
A fixed relative path does not work with multi-level/nested
CMAKE_INSTALL_LIBDIR as with e.g Debian.
2018-07-06 13:25:37 +02:00
Johannes Günther a705ecb6d6 Fix name issues in docu (most pointed out in PR 203) 2018-07-05 16:46:08 +02:00
Carsten Benthin 1456b1d428 fixed more win warnings 2018-06-28 03:57:25 -08:00
cbenthin f81d0ce3ac fixed win warning 2018-06-28 13:30:57 +02:00
cbenthin 5a40ecfa7e regeneration tutorials 2018-06-28 13:16:49 +02:00
Carsten Benthin 867afa5b7b fixed compile error under windows + AVX512 2018-06-28 03:10:18 -08:00
cbenthin 2b761f364e regenerating tutorials 2018-06-28 11:37:46 +02:00
cbenthin ef9dd1951d version v3.3.0-alpha.0 2018-06-28 11:10:14 +02:00
Jefferson Amstutz 392e7d22f0 Revert "use glfw3's CMake config directly instead of PkgConfig to enable custom envs"
This reverts commit 0aac46598b.
2018-06-26 11:14:47 -05:00
Jefferson Amstutz 0aac46598b use glfw3's CMake config directly instead of PkgConfig to enable custom envs 2018-06-26 11:01:56 -05:00
Johannes Günther ff64407196 Fix remaining unresolved externals, closes #195 2018-06-04 16:24:31 +02:00
Johannes Günther ab7694016a Fix warnings for RelWithDebInfo on Windows 2018-06-04 11:23:04 +02:00
Johannes Günther dac69beaa6 Fix docu links 2018-05-30 15:31:59 +02:00
Johannes Günther b4dda0eb79 Introduce variable for pandoc 2018-05-30 15:12:07 +02:00
Johannes Günther 1a37087138 Improve support of Debug config, #196 2018-05-29 12:55:45 +02:00
Johannes Günther a89b7b3c3b Remove libmmd dependency 2018-05-29 11:12:17 +02:00
Sven Woop a6527de9c9 updates to changelog, added geometry mblur time range 2018-05-28 10:10:58 +02:00
Sven Woop 9805370657 cleanups 2018-05-28 10:08:34 +02:00
Sven Woop ff669ab8f4 bugfix in createLargeLeaf for object time range mblur builder 2018-05-28 09:24:14 +02:00
Sven Woop 4efa364c7b bugfix in BuildRecord construction for object time range mblur builder 2018-05-28 09:07:18 +02:00
Sven Woop ca932f7669 bugfix in time_range handling, have to clip time range when constructing SetMB 2018-05-28 08:25:30 +02:00
Sven Woop 7297e6ffff cleanups 2018-05-28 07:46:00 +02:00
Sven Woop b04f338936 fixed bug with singleTimeSegment feature, however, this is not used anymore 2018-05-28 07:29:02 +02:00
Sven Woop bb4cd86ea4 using mblur time range tests 2018-05-25 14:48:06 +02:00
Sven Woop ba404619cc added grid mesh support to viewer_stream 2018-05-25 14:43:05 +02:00
Sven Woop a88881677e fixed various bugs where time_range was not properly copied 2018-05-25 14:39:38 +02:00
Sven Woop 7b7c88337d bugfix in --convert-triangles-to-quads, time range was not copied 2018-05-25 14:21:51 +02:00
Sven Woop a9b96ac13f added mblur_time_range_grid.xml 2018-05-25 14:09:39 +02:00
Sven Woop 0e27f93cb2 bugfix for mblur time range of grids 2018-05-25 14:09:02 +02:00
Sven Woop 4e725e928b added GridMesh support to XML loader 2018-05-25 13:46:32 +02:00
Sven Woop d9fd88e841 fixing mblur time range for quads 2018-05-25 13:41:17 +02:00
Sven Woop abf293aa0a adde mblur_time_range_line.xml 2018-05-25 13:28:08 +02:00
Sven Woop b71f37e1f6 added geometry time range support for curves 2018-05-25 13:26:11 +02:00
Sven Woop b13918bd79 updates to changelog 2018-05-25 12:29:11 +02:00
Sven Woop d56cfe1c7f changed CMAKE_SOURCE_DIR to PROJECT_SOURCE_DIR to allow Embree be used in subdirectory of other project 2018-05-25 12:26:45 +02:00
Sven Woop bdc547c7cc fixed some compile issues with GCC in debug mode, but still not compiling 2018-05-25 11:13:09 +02:00
Sven Woop d880935a86 enabling FORTIFY_SOURCE also for RelWithDebInfo build, it requires optimization 2018-05-25 10:48:33 +02:00
Sven Woop a0026910d9 enabling FORTIFY_SOURCE only for release build, it requires optimization 2018-05-25 10:47:10 +02:00
Sven Woop ba78d28f59 setting version to v3.2.1-alpha.2 2018-05-25 10:36:17 +02:00
Sven Woop 8656ac20ec Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-05-25 10:33:05 +02:00
Johannes Günther 3a41c0af2c Merge branch 'master' into devel 2018-05-25 10:49:30 +02:00
Sven Woop b5a2f1337d Fixed AVX512 compile issue with GCC 6.1.1 2018-05-25 10:32:53 +02:00
Sven Woop 0eabcdddd3 added geometry time range support to all other primitives, except curves everything should be working now 2018-05-25 07:47:40 +02:00
Sven Woop 7b8fa2e8a2 further disabling of buildSingleSegment 2018-05-25 07:13:32 +02:00
Johannes Günther 762af34bdd Update year and add privacy links 2018-05-24 18:33:23 +02:00
Johannes Günther 8cf50641ed Merge remote-tracking branch 'github/devel' into devel 2018-05-24 14:16:22 +02:00
Sven Woop 18e8a2dfbd set version to v3.2.1-alpha.1 2018-05-24 10:16:53 +02:00
Sven Woop 7634bf6e4b added support for time_steps parameter to TransformNode in XML format 2018-05-24 09:28:11 +02:00
Sven Woop 11e4d67237 transformation motion blur uses linear bounds of instanced scene 2018-05-24 09:16:48 +02:00
Sven Woop 687099d882 added --convert-mblur-to-nonmblur command line option 2018-05-24 08:16:09 +02:00
Sven Woop d09daacf60 assigning mblur time debugging to HOME/END keys 2018-05-24 07:52:18 +02:00
Sven Woop a48d986269 added cmake option to make flat curve self intersection avoidance adjustable 2018-05-23 14:57:44 +02:00
Sven Woop a72873c854 bugfix in filtering of non overlapping time ranges 2018-05-23 12:29:38 +02:00
Sven Woop d5e09d228d cleanups 2018-05-23 12:25:59 +02:00
Sven Woop 60b0c0154f bugfix in linear bounds calculation when time ranges were present 2018-05-23 12:17:13 +02:00
Sven Woop 5a7230da1f added triangle_msmblur_time_range.xml 2018-05-23 09:57:12 +02:00
Sven Woop a8dc2540de fixed bug in comment parsing 2018-05-23 09:31:52 +02:00
Sven Woop 03f654c62e optimized trianglei for mblur to only support single geomID 2018-05-23 09:11:52 +02:00
Sven Woop 7aeb056b32 added assertion in msmblur leaf creation to check that all geomIDs are identical 2018-05-23 09:02:48 +02:00
Sven Woop 4262431328 disabling buildSingleSegment in bvh_builder_sah_mb.cpp 2018-05-23 08:58:24 +02:00
Sven Woop 11d5e26d82 properly creating time bounding node when time bounds have shrunken 2018-05-23 08:47:02 +02:00
Sven Woop 3ae221bf73 properly extending time_range during split 2018-05-23 08:07:12 +02:00
Sven Woop f3b787a0ea msmblur builder creates leaves with single geometry only 2018-05-23 07:34:24 +02:00
Sven Woop 63b3971140 adjusting .gitlab-ci.yml for powershell 2018-05-22 14:09:15 +02:00
Sven Woop 8d3863ed00 bugfix in flat mode for hermite curves 2018-05-22 14:08:54 +02:00
Sven Woop dc9fa0eed0 setting version to 3.2.1-alpha.0 2018-05-22 09:23:07 +02:00
Johannes Günther 36c541a2a5 Fix index format of quads 2018-05-15 16:23:41 +02:00
Sven Woop 0ec8f6a299 filtering out primitives which are not valid in current time interval 2018-05-15 14:24:47 +02:00
Sven Woop 4be6966f63 added TimeRange node to XML format 2018-05-15 12:43:42 +02:00
Sven Woop 49fab5e8e0 assigning mblur time debugging to HOME/END keys 2018-05-15 11:22:47 +02:00
Sven Woop a8ee444842 first attempt to get extended motion blur working for triangles 2018-05-15 11:19:19 +02:00
Sven Woop d710ab6245 added rtcSetGeometryTimeRange API function 2018-05-15 08:22:25 +02:00
Sven Woop 95d3b09224 bugfix to run windows CI 2018-05-15 08:02:58 +02:00
Sven Woop 51f418e87d Merge branch 'swoop' into devel 2018-05-14 18:03:10 +02:00
Sven Woop f67d01d82d further CI fix for windows 2018-05-14 18:00:55 +02:00
Sven Woop b8c8e81bac fixes to make CI working again under Windows 2018-05-14 16:47:45 +02:00
Sven Woop c729538394 updates to changelog 2018-05-14 12:00:26 +02:00
Sven Woop 301fe63a39 Improved self intersection avoidance for flat curves. Transparency rays
with tnear set to previous hit distance do not need curve radius
based self intersection avoidance as same hit is calculated again. For this
reason self intersection avoidance is now only applied to ray origin.
2018-05-14 11:56:30 +02:00
Sven Woop bd9ebf578f Fixed invalid memory access in rtcGetGeometryTransform for non-motion blur instances. 2018-05-14 11:38:17 +02:00
Sven Woop 114208ac37 raising error when oriented curve has no normal buffer set 2018-05-14 11:29:29 +02:00
Sven Woop 8f2695cba2 raising error when oriented curve has no normal buffer set 2018-05-14 11:23:39 +02:00
Sven Woop bd9ac93df7 ignoring invalid oriented curves 2018-05-14 11:21:22 +02:00
Sven Woop dbb9b8d86d Fixed floating point exception in static variable initialization. 2018-05-14 11:08:55 +02:00
Sven Woop 03af3dbb4c added oriented_curve1.xml 2018-05-04 10:54:01 +02:00
Sven Woop e13cb9bad7 updates to oriented curve example scene 2018-05-04 10:22:18 +02:00
Sven Woop 08029410a9 updates to oriented curve example scene 2018-05-04 10:21:51 +02:00
Sven Woop dbd2675126 bugfix for rendering on retina displays under macOS 2018-05-04 10:03:44 +02:00
Sven Woop dbc07cff99 regenerated documentation 2018-05-03 10:16:08 +02:00
Sven Woop afac2b9b40 setting version to v3.2.0 2018-05-03 10:13:25 +02:00
Sven Woop ad930f89af merged in release branch 2018-04-30 07:33:06 +02:00
cbenthin e139788935 minor updates 2018-04-26 19:02:57 +02:00
cbenthin 919b8b2c31 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-04-26 18:20:44 +02:00
cbenthin 8393de5f67 faster version of sven's tri test 2018-04-26 17:53:42 +02:00
Sven Woop a845da963f Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-04-25 10:33:55 +02:00
Sven Woop 5b9b4ae06c made imgui window moveable 2018-04-25 10:33:23 +02:00
Sven Woop 3be061ab61 updates 2018-04-25 08:17:37 +02:00
Sven Woop f8bfa6a13f updated curve documentation for hermite basis and new normal buffer layout 2018-04-25 08:05:29 +02:00
Sven Woop 22a7ef2b20 Merge branch 'swoop' into devel 2018-04-24 16:41:21 +02:00
Sven Woop 699962846a new normal buffer definition for normal oriented curves 2018-04-24 13:17:38 +02:00
Sven Woop 072dcedc4d added docu of hermite basis 2018-04-24 09:52:48 +02:00
Sven Woop 5697bc9113 added hermite basis test 2018-04-24 09:36:47 +02:00
Sven Woop e08e41c5b8 bugfix 2018-04-24 09:15:04 +02:00
Sven Woop c1a682fda4 added hermite curve support to pathtracer 2018-04-24 08:52:34 +02:00
Sven Woop d8bb8524d9 added hermite basis to XML loader 2018-04-24 08:41:05 +02:00
Sven Woop 6b89ac1a8e implemented linear vertex attribute interpolation for hermite basis 2018-04-24 07:52:21 +02:00
Attila Afra ef480fd1c3 fixed documentation of normal-oriented curves 2018-04-23 23:27:44 +03:00
cbenthin a8977c8eca need to filter out invalid slots for Sven's tri test 2018-04-23 16:01:34 +02:00
cbenthin 05bf30e437 updates 2018-04-23 15:03:55 +02:00
cbenthin 91616608d7 fixes 2018-04-23 13:18:05 +02:00
cbenthin add04f30dd adding Sven's triangle test for testing 2018-04-23 11:58:56 +02:00
Sven Woop f9c6035768 bugfix for hermite curves 2018-04-23 11:57:56 +02:00
Sven Woop 2557abe139 bugfixe for hermite curves 2018-04-23 10:55:17 +02:00
Sven Woop a110de4719 added --convert-bezier-to-hermite command line option 2018-04-23 10:38:50 +02:00
Sven Woop b7557ac3ea fixed interpolate for hermite basis 2018-04-23 10:19:46 +02:00
Sven Woop c870146e64 Hermite curve build again on CurveGeometry.
Implemented BVH build for Hermite curves.
2018-04-23 10:02:04 +02:00
Sven Woop c1c7276602 updates 2018-04-23 09:37:09 +02:00
Sven Woop 0e032a023d separated curve access in scene_curves.cpp 2018-04-23 09:34:27 +02:00
Sven Woop 46e80802e6 compile fix for windows 2018-04-23 09:05:31 +02:00
Sven Woop 5892116ff8 removed unused line SAH builders 2018-04-23 09:02:36 +02:00
Sven Woop 96a1da0d6e bugfix for clang under windows, constructors of some primitive types used AVX code 2018-04-23 08:21:06 +02:00
Sven Woop 1427c0a0d2 compile fixes when only enabling single ISA 2018-04-23 08:04:33 +02:00
Sven Woop d891400ac7 removed AVX512KNL only compile test, no longer supported 2018-04-23 07:54:25 +02:00
Sven Woop 98af7cc9ce increased image compare threshold slightly 2018-04-23 07:50:41 +02:00
Sven Woop a439e386e8 bugfix to Embree2 to Embree3 conversion script 2018-04-23 07:44:22 +02:00
Sven Woop 6c9a8a73a2 properly describing rtcIntersect4/8/16 maintainance of packet size 2018-04-23 07:41:18 +02:00
Sven Woop af945a102d compile fix for windows 2018-04-20 18:41:31 +02:00
Jefferson Amstutz 4c25034bcc const correctness for RTCHitN accessor functions (fixes clang 6 warnings) 2018-04-20 10:45:18 -05:00
Sven Woop 9010d6acd5 implemented hermite curve basis, builder not working yet 2018-04-20 12:00:00 +02:00
Sven Woop 050881ad18 compile fix for windows 2018-04-20 10:24:06 +02:00
Sven Woop 5d71b0bd04 added tangent and normal buffer to line geometry class 2018-04-20 10:16:08 +02:00
Sven Woop 3c5854e976 bugfix in getBuffer function for curves 2018-04-20 10:00:39 +02:00
Sven Woop 68081e661a added hermite basis to API 2018-04-20 09:22:35 +02:00
Sven Woop 859ca9ab03 fixed normal oriented curve type in RTCGeometryType 2018-04-20 09:05:35 +02:00
Sven Woop d64f5f5271 compile fix when only AVX512SKX was enabled 2018-04-20 07:55:32 +02:00
Sven Woop fb2f51ff97 cleanups 2018-04-20 07:49:25 +02:00
Sven Woop 656ef5de5a Merge branch 'swoop' into devel 2018-04-20 07:39:57 +02:00
Sven Woop ad10ae64b5 removed ubuntu14.04 from testing, does not provide GLFW3 package 2018-04-20 07:26:56 +02:00
Sven Woop 6e26fc5e1f added line segment changes to docu 2018-04-19 14:49:17 +02:00
Sven Woop 3205290a9e removed old line codepath 2018-04-19 14:44:49 +02:00
Sven Woop ace88c9cb2 bugfix in linei::createLeaf function 2018-04-19 14:28:58 +02:00
Sven Woop 8331538e46 bugfix in bvh_builder_hair_mb.cpp 2018-04-19 14:09:03 +02:00
Sven Woop 0600afb2cb SSE compile fix for line8i 2018-04-19 13:56:16 +02:00
Sven Woop 3c3b9f2904 optimized linei to support only single geometry inside leaf 2018-04-19 13:38:58 +02:00
Sven Woop 81838b7ff8 added line8i layout 2018-04-19 13:13:59 +02:00
Sven Woop 930f1383c9 removed size from PrimitiveType 2018-04-19 12:32:43 +02:00
Sven Woop bea5024322 removed blockSize from PrimitiveType 2018-04-19 12:18:03 +02:00
Sven Woop d0add46b12 added line segments to curve BVH 2018-04-19 11:31:32 +02:00
Sven Woop a4df8fdcbd compile fix for ubuntu16.04 2018-04-19 07:28:19 +02:00
Sven Woop 43dfe0c2fc updates to changelog 2018-04-18 07:09:03 +02:00
Sven Woop e1c7700b51 compile fixes for ICC 16 under MacOSX 2018-04-18 07:07:25 +02:00
Sven Woop b1bdaa246c updated documentation 2018-04-17 08:08:34 +02:00
cbenthin d9c55182a4 due to older oiio versions using delete instead of ::destry call for the oiio interface 2018-04-16 15:51:59 +02:00
Sven Woop e526e4063c Merge branch 'swoop' into devel 2018-04-16 11:01:16 +02:00
Sven Woop f05b994974 Merge branch 'swoop' of gitlab.com:embree/embree into swoop
Conflicts:
	tutorials/CMakeLists.txt
2018-04-13 04:01:21 -05:00
Sven Woop 67f67087e0 compile fix for macosx 2018-04-13 04:00:32 -05:00
Sven Woop f8b5c6ee3a fixed security issue in imgui_demo.cpp 2018-04-13 08:56:12 +02:00
Sven Woop 11f1309a25 compile fix for windows 2018-04-13 08:46:32 +02:00
Sven Woop b4d4b35969 compile fix when statically linking glfw 2018-04-13 07:42:03 +02:00
Sven Woop 9a9298d45e Merge branch 'release' into devel 2018-04-12 14:56:16 +02:00
Sven Woop c8ea1cec9d Merge commit '7ff38953eb6532914d6b62df37fee7df6f840b56' into release 2018-04-12 14:53:30 +02:00
Sven Woop 0040d3d1c6 swap comments of primID and geomID in rtcore_ray.h and rtcore_ray.ish 2018-04-12 13:36:41 +02:00
Sven Woop 8e3815e8ef upgrading to ubuntu17.10 for testing 2018-04-12 13:24:11 +02:00
Sven Woop 8e915c9119 Merge branch 'devel' into swoop2 2018-04-12 11:43:43 +02:00
Sven Woop c8ffcbc3c4 updates to imgui 2018-04-12 10:12:39 +02:00
Sven Woop 8b6685bafc updates 2018-04-12 09:58:12 +02:00
Sven Woop bf2b852b98 updates 2018-04-12 09:57:08 +02:00
Sven Woop 82bcba1968 printing frame rate 2018-04-12 09:53:23 +02:00
Sven Woop 3f91ca52be updates to imgui integration 2018-04-12 09:11:52 +02:00
Sven Woop 9d45e669aa updates to imgui integration 2018-04-12 08:54:36 +02:00
Sven Woop e43652cc23 first imgui windows working 2018-04-12 08:43:46 +02:00
Sven Woop 5b4d34cb63 added imgui opengl2/3 implementations 2018-04-12 08:27:28 +02:00
Sven Woop aa3b42065b added imgui 2018-04-12 08:19:19 +02:00
Sven Woop 35622c3488 removed GLUT 2018-04-11 16:29:35 +02:00
Sven Woop ae3f2e040d removed freeglut 2018-04-11 15:56:29 +02:00
Sven Woop 4e4f416e58 improved watertightness of robust mode, 1.5% performance decrease 2018-04-11 13:23:58 +02:00
Sven Woop 35278fecae updates to docu regarding GLFW dependency 2018-04-11 09:54:11 +00:00
Sven Woop db1ee1bdf1 disabling using static runtime under windows 2018-04-11 11:32:26 +02:00
Sven Woop c1323190b9 fixes to get GLFW working under Windows 2018-04-11 11:05:04 +02:00
Sven Woop b0bb318732 added glfw library for windows 2018-04-11 10:21:34 +02:00
Sven Woop 2c7f536185 updates 2018-04-11 09:54:23 +02:00
Sven Woop 10097b03ce fullscreen works with GLFW 2018-04-11 09:28:45 +02:00
Sven Woop c6f3587f2a updates to GLFW integration 2018-04-11 08:46:54 +02:00
Sven Woop a9aba84b5a initial integration of GLFW working 2018-04-11 08:27:35 +02:00
Sven Woop 4e9fcb2519 added and outputting xmm, ymm, and zmm-enabled CPU feature bits 2018-04-11 07:29:06 +02:00
Sven Woop d51b2e3efd added --max-path-length command line option to pathtracer 2018-04-09 08:16:57 +02:00
Sven Woop afe3b030c8 added conversion from round to flat curves 2018-04-09 07:45:48 +02:00
Sven Woop 1265a0d673 workaround for valgrind issue 2018-04-04 14:09:21 +02:00
Ingo Wald 7c049f400e fix 'unsed member' warning on clang (removed this member) 2018-04-02 11:31:10 -06:00
Sven Woop d4cf6d016b Merge branch 'release' into devel 2018-03-29 08:11:57 +02:00
Sven Woop 38fd7571e4 doubled stack size of internal task scheduler 2018-03-27 19:17:33 +02:00
Sven Woop 25b9c8dfac updates to grid docu 2018-03-27 08:44:51 +02:00
Sven Woop 426af2c84b removed unused benchmark_instancing.sh file 2018-03-27 08:25:06 +02:00
Sven Woop 600089c23f added further testing for grid geometry 2018-03-27 08:22:11 +02:00
Sven Woop 822765dda5 added merge-triangle-to-grids command line option 2018-03-27 08:19:49 +02:00
Sven Woop 72494b0e68 extended merge-quads-to-grids to support motion blur 2018-03-27 08:18:06 +02:00
Sven Woop 936d4947c8 printing warning in invoke_test, when reference image comparison is skipped 2018-03-27 08:08:05 +02:00
Attila Afra 073a46732f replaced ImageMagick with OpenImageIO 2018-03-26 15:33:15 +03:00
cbenthin 36e0a52128 bug fixes in grid mb packet intersection code 2018-03-23 14:39:48 +01:00
cbenthin c86385b23c reverted single segment in grid msmblur builder, fixed time interpolation in mb intersector 2018-03-23 11:57:39 +01:00
cbenthin 7ff38953eb Merge remote-tracking branch 'origin/devel' into swoop2 2018-03-23 10:02:53 +01:00
cbenthin d818dacd8b set singleLeafTimeSegment to true for msmblur grid builder 2018-03-23 10:02:29 +01:00
cbenthin 0e778644a4 Merge remote-tracking branch 'origin/devel' into swoop2 2018-03-23 09:56:12 +01:00
Sven Woop 7c80f577fb added grid interpolation test to verify, bugfix in grid interpolation code 2018-03-23 09:48:20 +01:00
Sven Woop a9de062e74 added garbage geometry test for grids 2018-03-23 09:08:03 +01:00
Sven Woop 6f5cb39217 fixed compile warning 2018-03-23 08:41:50 +01:00
cbenthin 7d8e05f455 some changes to make clang4 happy 2018-03-22 20:34:38 +01:00
cbenthin 0b1f33c7b8 added image for grid_geometry tutorial 2018-03-22 17:19:27 +01:00
cbenthin aecb76c57a fixes in pluecker code 2018-03-22 16:38:34 +01:00
cbenthin 8d6579c23e merge with devel 2018-03-22 15:48:33 +01:00
cbenthin f41487af23 grid watertight tests run through.... 2018-03-22 15:38:00 +01:00
cbenthin a2d6302fe0 more fixes 2018-03-22 15:24:44 +01:00
cbenthin 74470d1602 robust traversal for grid single intersectors 2018-03-22 09:00:41 +01:00
Sven Woop ce3562a47c Merge branch 'swoop' into devel 2018-03-22 08:57:24 +01:00
cbenthin 3b78e09c3f activated robust traversal for all pluecker grid intersectors 2018-03-22 08:57:03 +01:00
cbenthin 25f847caa3 more grid robust mode updates 2018-03-22 08:46:15 +01:00
Sven Woop 6dc1d01006 fixed inconsistency between stream and normal mode of user_geometry tutorial 2018-03-22 07:55:06 +01:00
Sven Woop f3e462c3ff implemented rtcInterpolate for grids 2018-03-22 07:38:24 +01:00
Sven Woop 40771f9a24 detecting ISAs supported by compiler using try_compile 2018-03-22 07:12:46 +01:00
Sven Woop 1c0a2f8725 using find_path to find embree models for CI testing 2018-03-22 06:43:35 +01:00
Sven Woop 9d1a22aa68 rtcSetNewGeometryBuffer properly overallocates vertex buffers now 2018-03-22 06:37:10 +01:00
cbenthin b643df8dc7 added first version of hybrid pluecker-based grid intersectors, not fully done yet 2018-03-21 23:43:41 +01:00
cbenthin 120f13fa5f seperate subgrid intersectors into seperate files 2018-03-21 20:55:08 +01:00
cbenthin fe1ff55842 bugfix in u/v interpolation for grid pluecker 2018-03-21 18:46:14 +01:00
cbenthin 54d3343a3a frist version of pluecker-based single ray grid intersectors 2018-03-21 17:31:22 +01:00
Sven Woop 8ea1cff2c7 Merge branch 'swoop' into devel 2018-03-21 15:18:19 +01:00
Sven Woop 66eb5a12b5 fixed shading in pathtracer for mblur curves 2018-03-21 15:17:52 +01:00
Sven Woop 2319c82d27 fixes for klocwork 2018-03-21 14:53:06 +01:00
Sven Woop d8b3bedc16 added BSpline evaluation to pathtracer, cleanups in postIntersectGeometry 2018-03-21 14:30:06 +01:00
Sven Woop ef3147b936 enabled some testing by default 2018-03-21 13:49:55 +01:00
cbenthin 8394e81e53 fixes for grid mb builder and invalid geometry 2018-03-21 13:32:37 +01:00
Sven Woop 375cf9569d Merge branch 'swoop' into devel 2018-03-21 12:49:48 +01:00
cbenthin a6430f5737 grid doc updates 2018-03-21 11:51:59 +01:00
Sven Woop 8d218554b9 enabled grids in multiple verify tests 2018-03-21 11:04:42 +01:00
cbenthin dcee04517f updates 2018-03-21 10:47:29 +01:00
Sven Woop 32b9731433 added --grid-sphere command line option 2018-03-21 10:27:26 +01:00
cbenthin e0fe856b24 grid docu updates 2018-03-21 10:25:50 +01:00
Sven Woop 529ff8e79e added --grid-plane command line option 2018-03-21 10:06:51 +01:00
Sven Woop 79812d71c3 verify tutorial can add grid meshes 2018-03-21 09:57:00 +01:00
Sven Woop 63bf0f1c57 fixed compile warnings in Release mode 2018-03-21 09:46:38 +01:00
Sven Woop 770def83f2 enabling AVX512SKX by default on Linux (but not AVX512KNL) 2018-03-21 09:43:02 +01:00
Sven Woop d7f2fdc6a5 enabled addrsanitizer tests again 2018-03-21 09:02:02 +01:00
Sven Woop a609ed7b5a fixed memory leak in internal taskscheduler 2018-03-21 08:49:20 +01:00
Sven Woop f8107b95d8 fixed memory leak in verify 2018-03-21 08:28:52 +01:00
Sven Woop 6b30be2ab3 fixed memory leak in verify 2018-03-21 08:26:53 +01:00
Sven Woop 8bdefe49cc raising error when valgrind not found 2018-03-21 08:20:17 +01:00
Sven Woop 4e97aad275 fixed memory leak in ISPCScene 2018-03-21 08:03:53 +01:00
Sven Woop ba203512e1 fixed typo in invoke_test.py 2018-03-21 07:52:36 +01:00
Sven Woop 649fb96c3e using RTC_INVALID_GEOMETRY_ID in rtcore_common.h 2018-03-21 07:44:36 +01:00
Sven Woop a3690782bd increased compare threshold, output of image error value 2018-03-21 07:41:38 +01:00
Sven Woop 58a412f3ed Merge branch 'swoop' into devel 2018-03-20 15:03:00 +01:00
Sven Woop 4c0185a4c6 disabling addrsanitizer for now 2018-03-20 15:01:13 +01:00
Sven Woop 669d46b2ed fix for addrsanitizer 2018-03-20 14:17:13 +01:00
Sven Woop f2894e8fae fixed two potential bugs in internal task scheduler 2018-03-20 14:07:41 +01:00
Sven Woop c81ebaebbf disabled PIE for executable to make addrsanitizer working again 2018-03-20 13:33:34 +01:00
Sven Woop 96bbdc0a3c Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-20 13:21:42 +01:00
Sven Woop 5eff653a31 added fedora28 with GCC 8.0.1 to CI testing 2018-03-20 13:21:32 +01:00
Sven Woop a7ef4a7357 running overlapping_geometry test sequential, this works around hanging verify when compiled with GCC 8.0.1 2018-03-20 13:11:00 +01:00
cbenthin c07e5832bd grid msmblur builder seems to work 2018-03-20 12:52:33 +01:00
Sven Woop a680355e5d increased image compare threshold slightly 2018-03-20 12:34:11 +01:00
Sven Woop 4c86edcc79 fixed instability of converting color 1.0 to char in some tutorials 2018-03-20 12:12:18 +01:00
cbenthin 57454c5d06 fixed incorrect grid bounds in MB case 2018-03-20 11:34:20 +01:00
cbenthin 332db1f3ec some fix in scenegraph grid conversion code 2018-03-20 10:51:26 +01:00
cbenthin d3ece0a3ed updated changelog 2018-03-20 10:29:04 +01:00
Sven Woop 3626fdc040 fixed typo in gitlab-ci-yml 2018-03-20 10:11:22 +01:00
Sven Woop 4bf4fee24c updated model hash 2018-03-20 09:46:18 +01:00
cbenthin d1c3adffb8 more warnings fixes 2018-03-20 09:37:23 +01:00
cbenthin 1aaad7d8a3 addressing some win32 compiler warnings 2018-03-20 09:20:24 +01:00
cbenthin c430e7b9b1 addressing some win32 compiler warnings 2018-03-20 09:19:39 +01:00
cbenthin f3c6de5bcb added some call by refs for Vec3fa to make win32 compiler happy 2018-03-20 09:16:07 +01:00
Sven Woop 99c00ca4c8 fixed Win32 compile error 2018-03-20 08:52:55 +01:00
Sven Woop c43f9921a5 Merge branch 'swoop2' into swoop 2018-03-20 08:45:07 +01:00
Sven Woop dfb896a778 bugfix in user_geometry tutorial, stream mode handled geomID=4 wrong, single ray code path calculated Ng wrong 2018-03-20 08:44:01 +01:00
Sven Woop 1348f18d4c bugfix in intersection_filter tutorial, duplicate intersections were handled wrong 2018-03-20 08:00:07 +01:00
Sven Woop 0877719ba2 reduced compare threshold 2018-03-19 17:52:38 +01:00
Sven Woop 6a1d7f6263 enabled address sanitizer again 2018-03-19 17:46:34 +01:00
Sven Woop 4ad4b85da9 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-19 17:44:25 +01:00
cbenthin bf2da7e69f more cleanups 2018-03-19 17:20:39 +01:00
cbenthin 0f538cbe2f some minor cleanups 2018-03-19 16:24:18 +01:00
cbenthin 283ace8d97 fixed for grid mb with packets 2018-03-19 15:59:46 +01:00
cbenthin e5c768abd8 updates 2018-03-19 14:40:48 +01:00
cbenthin 111cf21ff1 packet intersector for mb grids partially working 2018-03-19 11:54:45 +01:00
cbenthin 000ba58b99 added mb support when converting triangles to grids 2018-03-19 11:52:37 +01:00
cbenthin d914110bfe fixed dequantization code/intrinsics for KNL, grids should work now for single ray and packets 2018-03-19 11:18:17 +01:00
cbenthin 20cd2b44e6 partially fixed KNL code path 2018-03-18 23:33:09 +01:00
cbenthin 4747e78654 using now 6 bits to encode GType in geometry to prevent sign extension on extraction 2018-03-17 16:50:59 +01:00
cbenthin ffa340a39e workaround for scene::iterator and MSVC 2018-03-17 04:55:49 -07:00
cbenthin 2861a279e1 fix for grid packet intersectors 2018-03-17 10:28:12 +01:00
cbenthin f750d1374f more msmb grid stuff, not working yey 2018-03-16 15:59:53 +01:00
cbenthin 5d15ecd197 grid msmb updates 2018-03-16 15:11:26 +01:00
cbenthin 101682cb56 replaced _mm_loadu_si128 by _mm_loadl_epi64 when loading uchar data, reduces potential out-of-bounds accesses when compiler can't fuse the instructions 2018-03-16 13:43:57 +01:00
Sven Woop ce1622f13c updates to changelog 2018-03-16 13:37:34 +01:00
Sven Woop 042edb3781 fixed further load->loadu in quantized node decoding 2018-03-16 11:49:22 +01:00
Sven Woop e4616fc3cf bugfix when instances are disabled 2018-03-16 10:22:42 +01:00
Sven Woop 4d7dcf9166 using unaligned load to load quantized bounds 2018-03-16 10:20:54 +01:00
Sven Woop 9fb6e088da Using Intersect/Occluded1EpilogMU for grid intersector.
This also fixes a bug as previously the Occluded1EpilogM
was called wrong at one place.
2018-03-16 08:51:57 +01:00
Sven Woop d63e2056bd disabled sending of difference images, not working anymore anyway 2018-03-16 07:40:19 +01:00
Sven Woop ef80ecd326 Merge branch 'swoop2' into devel 2018-03-16 07:27:30 +01:00
cbenthin 7fb6adf79a grid packet mb updates 2018-03-15 16:41:54 +01:00
cbenthin 9cb8e10074 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-03-15 16:15:55 +01:00
cbenthin 9686263d87 first version of packet interface for grid mb 2018-03-15 16:15:45 +01:00
Sven Woop 4101f6ade0 added compile test of grids and instances enabled solely 2018-03-15 14:46:06 +01:00
Sven Woop 794c5c093a enabled testing for grid_geometry tutorial 2018-03-15 14:36:31 +01:00
Sven Woop f45d35c62c fixed shading of grid tutorial 2018-03-15 14:29:07 +01:00
Sven Woop d0e4f1518d increased resolution of grid tutorial 2018-03-15 14:28:29 +01:00
Sven Woop b6bc9c9b70 Merge branch 'swoop' into devel 2018-03-15 14:27:57 +01:00
Sven Woop 179892cfb6 Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-15 13:39:21 +01:00
Sven Woop 4a0383d971 fixed problem with non thread safe local static variable initialization on VS2013 2018-03-15 13:38:41 +01:00
Sven Woop b5ccb3230b Merge branch 'swoop2' into devel 2018-03-15 13:17:25 +01:00
Sven Woop fc006f71ec bugfix in normal calculation of grid tutorial when borders are present 2018-03-15 12:36:27 +01:00
Sven Woop 8725251c34 bugfix when borders are present 2018-03-15 12:09:35 +01:00
Sven Woop c2f5395618 bugfix to smooth normals of displacement geometry tutorial 2018-03-15 11:48:19 +01:00
Sven Woop 9943d8fe00 bugfix in displacement_geometry tutorial 2018-03-15 11:46:14 +01:00
Sven Woop a87a8b8baf regenerated C++ tutorials 2018-03-15 11:40:50 +01:00
Sven Woop 725b054067 additionally added cube again to grid tutorial 2018-03-15 11:27:50 +01:00
Sven Woop a27e0b5dea increased resolution 2018-03-15 11:22:26 +01:00
Sven Woop 664ed3f6ce increased resolution 2018-03-15 11:21:57 +01:00
Sven Woop 0b3f6cda76 moved grid accel after quad accel 2018-03-15 11:13:28 +01:00
Sven Woop 6e09b4f791 fixed normal calculation for grid corners 2018-03-15 11:07:28 +01:00
Sven Woop d09918fab3 fixed normal calculation for grid corners 2018-03-15 10:55:45 +01:00
cbenthin 0443adfad1 grid mb updates 2018-03-15 10:44:54 +01:00
Sven Woop e96986b506 cleanups for grid tutorial 2018-03-15 10:12:57 +01:00
Sven Woop 279dd39acf added normal debug visualization 2018-03-15 10:00:31 +01:00
Sven Woop 478d0f60a7 added normal debug visualization 2018-03-15 09:53:37 +01:00
Sven Woop 3cea4e59e1 cleanups for grid tutorial 2018-03-15 09:37:21 +01:00
Sven Woop 63fbdc73af cleanups for grid tutorial 2018-03-15 09:29:14 +01:00
Sven Woop e0c7242c0b cleanups for grid tutorial 2018-03-15 09:26:37 +01:00
Sven Woop 28e491c89e cleanups for grid tutorial 2018-03-15 09:19:42 +01:00
Sven Woop 3eefbeaaea cleanups for grid tutorial 2018-03-15 08:59:28 +01:00
Sven Woop 2209af9a25 cleanups for grid tutorial 2018-03-15 08:50:27 +01:00
Sven Woop 1b1998d670 cleanups for grid tutorial 2018-03-15 08:45:48 +01:00
Sven Woop f9f1ccd379 cleanups for grid tutorial 2018-03-15 08:42:42 +01:00
Sven Woop b3ca42c79e cleanups for grid tutorial 2018-03-15 08:38:43 +01:00
Sven Woop 18be8638fb cleanups for grid tutorial 2018-03-15 08:37:44 +01:00
Sven Woop 66ec9b743c cleanups for grid tutorial 2018-03-15 08:27:19 +01:00
Sven Woop 3a67575b1e cleanups for grid tutorial 2018-03-15 08:22:17 +01:00
Sven Woop 80dafcbf8c cleanups for grid tutorial 2018-03-15 08:21:09 +01:00
Sven Woop 0fe7cbaa70 cleanups for grid tutorial 2018-03-15 08:20:48 +01:00
Sven Woop 2fb3f2a5ac quad optimization works again in grid tutorial 2018-03-15 08:19:58 +01:00
Sven Woop 22b7150b65 preparations to add quad optimization to grid tutorial again 2018-03-15 07:40:34 +01:00
cbenthin f93255e95f single ray single segment grid mb seems to work now 2018-03-14 16:22:26 +01:00
cbenthin 88fb38aeeb simple grid mb working, with qnodemb test 2018-03-14 15:42:05 +01:00
Sven Woop 7b972a8a76 bugfix in grid_geometry tutorial 2018-03-14 15:02:00 +01:00
Sven Woop df29cd20a9 bugfix 2018-03-14 14:54:21 +01:00
Sven Woop df75c832f3 bugfixes 2018-03-14 14:48:50 +01:00
Sven Woop 0e2d183a4e grid_geometry tutorial uses proper foreach loop 2018-03-14 14:35:04 +01:00
Sven Woop 8b4636cb04 grid_geometry tutorial normal calculation code compiles 2018-03-14 14:26:50 +01:00
Sven Woop 33be1a389e grid tutorial temporarily splits up quads too 2018-03-14 14:15:15 +01:00
Sven Woop 4a31004780 bugfix 2018-03-14 13:01:47 +01:00
Sven Woop 13971f5cd6 not signing ZIP file 2018-03-14 12:53:21 +01:00
Sven Woop e36f2853bd grid_geometry tutorial interpolates normals 2018-03-14 12:22:42 +01:00
Sven Woop 6ef80730c2 enabled grid generation again in grid_geometry tutorial 2018-03-14 10:37:09 +01:00
Sven Woop 8a51e15310 using new sphere topolgy with quads, tris, and pentagons in grid_geometry tutorial 2018-03-14 10:05:33 +01:00
Sven Woop 629ce6324f bugfix in OBJ loader 2018-03-14 09:25:54 +01:00
cbenthin a0f73bc3ff removed mb test code 2018-03-14 09:24:06 +01:00
Sven Woop 76bc0e2993 fixed layout description in curveNi_mb.h 2018-03-14 09:20:49 +01:00
Sven Woop 8b13b59960 bugfix in signing MSI installer 2018-03-14 09:17:13 +01:00
Sven Woop 26445319d3 avoiding signing .tar.gz 2018-03-14 09:15:30 +01:00
Sven Woop 39203b7444 fixed compile warnings in obj_loader 2018-03-14 08:59:38 +01:00
Sven Woop 1d1200cad7 fixed Win32 compile warning 2018-03-14 08:36:21 +01:00
Sven Woop 6427db0e3c fixed Win32 compile warning 2018-03-14 08:35:02 +01:00
Sven Woop f9cc5e98cc workaround for VS2015 Win32 compiler bug 2018-03-14 08:26:54 +01:00
Sven Woop b612fbcb63 Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-14 07:40:10 +01:00
Sven Woop 862ccc35bf fixed windows compile bug 2018-03-14 07:39:53 +01:00
Sven Woop e4476f3c1f bugfix in signing PKG 2018-03-14 07:31:42 +01:00
cbenthin d881f062bf mb updates 2018-03-13 18:53:37 +01:00
cbenthin f7fa12be9c mb single intersectors 2018-03-13 17:36:08 +01:00
cbenthin 9b03ab695e grid mb updates 2018-03-13 16:46:20 +01:00
Sven Woop 942db2c4a1 Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-13 13:59:32 +01:00
Sven Woop 2ee0dda407 updates to downloading.md to link to PKG installer instead of dmg image 2018-03-13 13:58:35 +01:00
Sven Woop 16604998d0 updates to MacOSX uninstall script 2018-03-13 13:56:41 +01:00
Sven Woop 69874a8a3a using productbuild to build flat PKGs on MacOSX 2018-03-13 13:08:41 +01:00
cbenthin 6400a8c543 updates to grid mb support, not yet working 2018-03-13 11:57:31 +01:00
cbenthin 14a9fd4ed2 updates 2018-03-13 11:54:34 +01:00
cbenthin 9e32fb9bfd sync, cleanups and opts 2018-03-13 10:49:48 +01:00
Sven Woop 4e0d05553d Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-13 09:20:20 +01:00
Sven Woop 96a234e4ef enabled signing os binaries for MacOSX 2018-03-13 09:20:09 +01:00
Sven Woop 18fdab6e68 Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-13 08:38:36 +01:00
Sven Woop 82271f0e23 bugfix 2018-03-13 08:37:33 +01:00
Sven Woop 41030eb022 Merge branch 'devel' into swoop2 2018-03-13 08:34:30 +01:00
Sven Woop 08eef19a76 not signing binaries under Linux 2018-03-13 08:29:21 +01:00
Sven Woop 216a2c78f8 not signing libembree.so for now 2018-03-13 08:12:50 +01:00
Sven Woop 692d20f6d8 removing old .pkg file 2018-03-13 08:10:30 +01:00
Sven Woop 3a9e59ebca Merge branch 'swoop2' of gitlab.com:embree/embree into swoop2 2018-03-13 07:59:58 +01:00
Sven Woop 4c5fabfd5c added signing of .pkg installer 2018-03-13 07:59:43 +01:00
Sven Woop dbd110dd5a added fix to sign libembree3.so.3.1.0 2018-03-13 07:43:29 +01:00
cbenthin 275c83f1c2 minor opts for aligned nodes in AVX512VL mode 2018-03-12 14:28:42 +01:00
Sven Woop 7fe346d39d fix for signing libembree under Linux 2018-03-12 11:23:22 +01:00
Sven Woop f0e70886a4 signing all executables 2018-03-12 10:59:57 +01:00
Sven Woop 59e19d7f12 Merge branch 'swoop' into swoop2 2018-03-12 09:51:46 +01:00
Sven Woop b054e111e2 not signing tar.gz files 2018-03-12 09:49:27 +01:00
cbenthin aa3bb2a948 started inital work for the MB builder for grids 2018-03-10 11:53:36 +01:00
cbenthin 203601eae1 fixed grid from quad generation in scenegraph layer to generate correct u,v 2018-03-09 17:30:29 +01:00
cbenthin 12a488aa01 grid_geometry tutorial uses now a subdiv + rtcInterpolate to generate the grid vertices 2018-03-09 16:17:26 +01:00
Sven Woop d2a13ae296 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-09 15:00:25 +01:00
Sven Woop 20b5bdfe63 Merge branch 'swoop' into devel 2018-03-09 15:00:01 +01:00
cbenthin b5f4244a5c update to grid tutorials 2018-03-09 14:59:55 +01:00
Sven Woop 58046a2862 first attempt to sign installers 2018-03-09 14:58:59 +01:00
cbenthin 2026a7e6af removed print in ispc code, causes some link issues on windows 2018-03-09 13:45:14 +01:00
Sven Woop d18963169c fixed windows compile warnings 2018-03-09 12:48:04 +01:00
Sven Woop e8d2a1b515 fixed windows compile warnings 2018-03-09 12:43:14 +01:00
Sven Woop 8af35f98e9 fixed windows compile warnings 2018-03-09 12:40:50 +01:00
Sven Woop 30fd046199 fixed windows compile warnings 2018-03-09 12:33:36 +01:00
Sven Woop ce9879e62c fixed windows compile issues 2018-03-09 11:29:56 +01:00
Sven Woop 14b31a792e fixed windows compile warnings 2018-03-09 07:56:13 +01:00
Sven Woop 465d1cd47c fixed windows compile warnings 2018-03-09 07:54:12 +01:00
Sven Woop 17956340d6 fixed windows compile warnings 2018-03-09 07:49:36 +01:00
Sven Woop 7262945a72 fixed windows compile warnings 2018-03-09 07:48:05 +01:00
Sven Woop 09c360278c fixed compile warnings 2018-03-09 07:39:37 +01:00
Sven Woop 1680d0fdc4 fixed windows compile warnings 2018-03-09 07:34:14 +01:00
Sven Woop dd617dbf43 fixed windows compile warnings 2018-03-09 07:33:04 +01:00
Sven Woop a662ce35fc fixed windows compile warning 2018-03-09 07:26:53 +01:00
Sven Woop 041279610b fixed type in docu 2018-03-09 07:11:26 +01:00
cbenthin 8d20fa7e41 workaround for GCC and _mm256_permutexvar_epi64 which is missing in the header file 2018-03-08 23:13:39 +01:00
cbenthin 2564a3a199 starting to work on grid tutorial 2018-03-08 23:00:06 +01:00
cbenthin 80db42cd53 fixes and small updates for node sorting 2018-03-08 17:28:48 +01:00
cbenthin cda4694b42 added specialized node sorting functions for 4/8-wide AVX512VL code paths 2018-03-08 16:25:02 +01:00
cbenthin e6db5ce071 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-03-08 15:02:47 +01:00
cbenthin a3afc6797b added new bvh node sorting code for avx512vl, currently deactivated until I get the template specification right 2018-03-08 15:02:33 +01:00
Sven Woop c10ba17b54 fixed more Windows compile warnings 2018-03-08 14:59:21 +01:00
Sven Woop 9a62db7429 fixed windows compile warning in subgrid_intersector.h 2018-03-08 14:56:03 +01:00
Sven Woop df9fee100e fixed windows compile warnings 2018-03-08 14:48:00 +01:00
Sven Woop 48ca8917c6 fixed compile warning in bvh_builder_hair.h 2018-03-08 14:45:05 +01:00
Sven Woop af79490da7 fixed wrong cast in curveNi.h and curveNi_mb.h 2018-03-08 14:43:28 +01:00
Sven Woop f2b4cc1b82 fixed wrong cast in curveNi.h and curveNi_mb.h 2018-03-08 14:42:07 +01:00
Sven Woop a3112b4c03 ignoring some warnings for problematic globals 2018-03-08 14:38:34 +01:00
Sven Woop 7e8af8ddcf fixed GCC compile warnings 2018-03-08 13:59:49 +01:00
cbenthin 635ec24694 experimental new sorting code for avx512vl 2018-03-08 13:22:03 +01:00
Sven Woop 6228fc7802 Merge branch 'swoop' into devel 2018-03-08 11:53:30 +01:00
Sven Woop 01da5054b3 updates to documentation of topology access functions 2018-03-08 11:48:40 +01:00
Sven Woop 642278fa61 updates 2018-03-08 11:26:44 +01:00
Sven Woop 86e0070c3f Fixed issue that some pandoc versions convert [link] to
\[link\] in output.
2018-03-08 11:20:33 +01:00
Sven Woop 84b5dc7d3e adding half_edges image 2018-03-08 10:39:09 +01:00
Sven Woop fa354f6ed3 Revert "removed define _CRT_SECURE_NO_WARNINGS"
This reverts commit d3943d1793.
2018-03-08 09:26:05 +01:00
Sven Woop bbf9945fbb Revert "Removed move constructor and assignment operator from SubdivMesh::Topology class."
Visual Studio 2013 also needs this workaround.

This reverts commit 341240d6cf.
2018-03-08 09:25:06 +01:00
Sven Woop cd134ed838 passing topologyID only to rtcGetGeometryOppositeHalfEdge function 2018-03-08 09:24:58 +01:00
Sven Woop 7aab7612a3 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-08 09:23:24 +01:00
Sven Woop d5a8bd3666 updates to documentation 2018-03-08 09:23:10 +01:00
Sven Woop 0a1372e854 adding documentation for topology access functions 2018-03-08 09:01:30 +01:00
Sven Woop 341240d6cf Removed move constructor and assignment operator from SubdivMesh::Topology class.
This was a workaround for some Windows compile issues with VS2012.
2018-03-08 08:41:29 +01:00
Sven Woop f5d2b1cab7 added rtcGetGeometryFace API function 2018-03-08 08:40:33 +01:00
Sven Woop 40bab9887c added topologyID to topology access functions 2018-03-08 08:18:10 +01:00
Sven Woop f06b73061a added rtcGetGeometryFirstHalfEdge API function 2018-03-08 07:54:12 +01:00
Sven Woop 6f46352f62 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-08 07:19:30 +01:00
Sven Woop 999f95f6e0 Merge branch 'swoop3' into devel 2018-03-08 07:19:07 +01:00
Sven Woop 0d69ecd4d7 updates to api.md 2018-03-08 07:08:56 +01:00
Sven Woop 5bdfc6c67f adding FLAGS_LOWEST to further targets 2018-03-07 18:05:39 +01:00
Sven Woop 2df6fc9393 moved c99 compile test to separate library which does not set COMPILE_FLAGS property 2018-03-07 15:59:52 +01:00
cbenthin 263938ff16 fixed grid transfer in scenegraph layer 2018-03-07 15:56:21 +01:00
Sven Woop 2023e73e85 fixed location of gnu.cmake 2018-03-07 15:33:55 +01:00
Sven Woop 590bddcdaa Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-07 15:32:08 +01:00
Sven Woop f2fc02b637 Scene::vertices is now array of float* 2018-03-07 15:31:59 +01:00
cbenthin bce1b16bbf moved spatial split builders into bvh_builder_sah_spatial.cpp and mb builders into bvh_builder_sah_mb.cpp 2018-03-07 15:27:00 +01:00
Sven Woop 028d75a013 Merge remote-tracking branch 'origin/swoop2' into devel 2018-03-07 15:20:22 +01:00
Sven Woop 058592185c Merge remote-tracking branch 'origin/swoop' into devel 2018-03-07 15:20:19 +01:00
Sven Woop 4364046ed3 fixed INCLUDE(icc) -> INCLUDE(intel) 2018-03-07 15:19:41 +01:00
Sven Woop e993595586 settign FLAGS_LOWEST to further targets 2018-03-07 15:18:47 +01:00
Sven Woop 18fb671ae2 gcc.cmake -> gnu.cmake 2018-03-07 15:06:47 +01:00
cbenthin d8b3bf3998 changed naming for RTCGrid members, added RTC_FORMAT_GRID 2018-03-07 14:02:42 +01:00
Sven Woop 4b5880ff55 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-07 13:48:01 +01:00
Sven Woop 95c5cb5063 added documentation of oriented flat curve 2018-03-07 13:47:33 +01:00
Sven Woop bf7fee2e80 updates to changelog 2018-03-07 13:04:18 +01:00
Sven Woop c90b753d68 compile fix for macOS 2018-03-07 12:35:02 +01:00
Sven Woop 40b9aca266 AVX512 compile fix for GCC 7 2018-03-07 12:13:33 +01:00
Sven Woop 51f96a8267 AVX512 compile fix for GCC 7 2018-03-07 11:02:01 +00:00
cbenthin 25ce563837 updates and cleanups to grid primitive builder 2018-03-07 09:54:26 +01:00
Sven Woop 2d910b268c fixed typo 2018-03-07 09:49:33 +01:00
Sven Woop ea2655a4cc not using tables in documentation anymore 2018-03-07 09:48:27 +01:00
Sven Woop 210a8fa21c consistently using unsigned int/vuint for geomID, primID, and instID 2018-03-07 09:10:57 +01:00
Sven Woop 425bb10a8c Merge commit '70a8f0e4eca40f2bb569d179c6bbb953cd4ff0db' into devel 2018-03-07 08:12:08 +01:00
Sven Woop fcf26bca69 added fedora27 testing 2018-03-06 12:43:25 +01:00
Sven Woop 70a8f0e4ec bugfix for --shader occlusion 2018-03-06 12:28:40 +01:00
Sven Woop 3b8d32e965 removed KNL optimization from subgrid_intersector 2018-03-06 12:26:07 +01:00
Sven Woop 60e6eab02f Merge branch 'release' into swoop 2018-03-06 12:00:13 +01:00
Sven Woop 6ee24ab770 compile fix for GCC 8 2018-03-06 11:54:41 +01:00
Sven Woop 92bf7a6cb8 added gather function without time parameter to scene_curves.h 2018-03-06 11:37:37 +01:00
Sven Woop 4188ec1410 Merge branch 'swoop' into devel 2018-03-06 11:29:06 +01:00
Sven Woop aece2902e7 updates to changelog 2018-03-06 11:27:29 +01:00
Sven Woop 331c3cd9cd Added sources of documentation. 2018-03-06 11:00:17 +01:00
Sven Woop a4d9a2601d Fixed issues where SKX code behaved wrong:
1) binning used only 16 bins in SKX
2) grid intersector still used 16-wide AVX512
2018-03-06 08:52:50 +01:00
Sven Woop 399825ece1 merge-grids transformation uses global device 2018-03-06 07:52:53 +01:00
Sven Woop 34f58bb69d adding grid_geometry tutorial to ISPC to CPP conversion 2018-03-06 07:44:35 +01:00
Sven Woop a10ed0de14 moved device construction/destruction into TutorialApplication class 2018-03-06 07:41:23 +01:00
Sven Woop 8c311bcacb Merge remote-tracking branch 'origin/swoop' into devel 2018-03-06 06:45:47 +01:00
Chuck Atkins 3648854745 Move SSE2 options from CMAKE_CXX_FLAGS to common target properties 2018-03-05 15:17:16 -06:00
Chuck Atkins 2b7c126b3e Have Cray options include underlying compiler options 2018-03-05 15:17:15 -06:00
Chuck Atkins ed389c6198 Use compiler ID for CMake options file name 2018-03-05 15:17:06 -06:00
Sven Woop 96b580e4b1 fixed compile warning in rtcore_common.h 2018-03-05 11:33:05 +01:00
Sven Woop c2aa7f84dd compile fix when ray masks were enabled 2018-03-05 11:09:08 +01:00
Sven Woop c8de04f584 renamed convert_hair_to_curves to convert_flat_to_round_curves, bugfix in convert_float_to_round_curves 2018-03-05 10:57:38 +01:00
Sven Woop ab315c8ce7 bugfix in grid to quad conversion 2018-03-05 10:45:32 +01:00
Sven Woop 5a408d2652 Updates to scene graph conversions. Splitted some grid conversions
up to get more flexibility.
2018-03-05 10:39:41 +01:00
Sven Woop 9c2754fb72 Merge remote-tracking branch 'origin/devel' into swoop 2018-03-05 10:09:49 +01:00
Sven Woop 4b384e7ca5 printing size of scene graph meshes 2018-03-05 09:57:01 +01:00
Sven Woop 90f48f9b51 cleanup in merging of quads to grids 2018-03-05 09:33:19 +01:00
Sven Woop 38cdc35011 bugfix in merging of quads to grids 2018-03-05 09:30:55 +01:00
Sven Woop 22f6d1a6cb bugfix in merging of quads to grids 2018-03-05 09:21:57 +01:00
Sven Woop f10902f3a4 bugfix in merging of quads to grids 2018-03-05 08:39:53 +01:00
Sven Woop a57e1bce5c bugfix in merging of quads to grids 2018-03-05 08:20:56 +01:00
Sven Woop 69ddc5f1b3 bugfix in merging of quads to grids 2018-03-05 08:11:52 +01:00
Sven Woop 27d70b9324 bugfix in merging of quads to grids 2018-03-05 08:05:33 +01:00
cbenthin a38163e873 updates 2018-03-03 17:32:56 +01:00
cbenthin 28bbc82116 updates 2018-03-02 17:17:53 +01:00
atafra 8dbfdbe23c Merge remote-tracking branch 'origin/devel' into devel 2018-03-02 16:56:33 +02:00
atafra dd31ecde27 Merge remote-tracking branch 'origin/devel' into devel
# Conflicts:
#	kernels/bvh/bvh_intersector_stream.cpp
#	kernels/bvh/bvh_intersector_stream_bvh4.cpp
#	kernels/bvh/bvh_intersector_stream_bvh8.cpp
#	kernels/geometry/instance_intersector.cpp
2018-03-02 16:55:48 +02:00
cbenthin 058d336565 fixed settings for 8-wide grid builder 2018-03-02 15:50:47 +01:00
atafra bd5c48e814 Merge remote-tracking branch 'origin/release' into devel
# Conflicts:
#	kernels/bvh/bvh_builder_sah.cpp
#	kernels/bvh/bvh_intersector_stream.cpp
#	kernels/bvh/bvh_intersector_stream_bvh4.cpp
#	kernels/bvh/bvh_intersector_stream_bvh8.cpp
#	kernels/common/scene.cpp
#	kernels/geometry/bezier1i_intersector.h
#	kernels/geometry/bezier1v_intersector.h
#	kernels/geometry/curve_intersector_distance.h
#	kernels/geometry/curve_intersector_ribbon.h
#	kernels/geometry/curve_intersector_sweep.h
#	kernels/geometry/intersector_iterators.h
#	tutorials/common/scenegraph/scenegraph.h
2018-03-02 16:40:49 +02:00
Sven Woop a3e2e9ebba Bugfix in rtcGetGeometryOppositeHalfEdge 2018-03-02 14:59:51 +01:00
Sven Woop 8e3b0a4e04 added merging of quads to grids using --merge-quads-to-grids command line option, not working yet 2018-03-02 14:44:32 +01:00
Sven Woop 6f47214a47 Added rtcGetGeometryOppositeHalfEdge, rtcGetGeometryNextHalfEdge,
and rtcGetGeometryPreviousHalfEdge API functions to access half edge
structure of subdiv mesh.
2018-03-02 12:16:14 +01:00
Sven Woop 6b6babf595 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-02 11:07:56 +01:00
Sven Woop 0bfb3fccc1 further cleanups to init_dim for quantized nodes 2018-03-02 11:06:39 +01:00
Sven Woop 48de439450 Merge branch 'swoop' into devel 2018-03-02 10:51:08 +01:00
Sven Woop 977cc31050 cleanups to init_dim for quantized nodes 2018-03-02 10:39:35 +01:00
Sven Woop f03bbbeda5 bugfix in init_dim for quantized bounds 2018-03-02 10:32:35 +01:00
Sven Woop a136372ddf added proper destruction of grid mesh in ISPCScene 2018-03-02 09:57:34 +01:00
Sven Woop fe4a310acd Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-03-02 09:48:39 +01:00
Sven Woop c8653aa894 added clamping to QuantizedBaseNode 2018-03-02 09:48:26 +01:00
Sven Woop 922066b360 fixed bug in store(unsigned char*, vint8) AVX2 function 2018-03-02 09:48:07 +01:00
cbenthin 9990f766f4 fixes to pathtracer to support grid meshes 2018-03-02 09:25:18 +01:00
Sven Woop 04e9ee82c7 regenerated documentation 2018-03-02 09:22:48 +01:00
Sven Woop f364618c0f bugfix 2018-03-02 07:40:08 +01:00
Sven Woop 90ba4f6bf6 bugfix to embree-config.cmake, embree library is now called embree3 2018-03-02 07:34:02 +01:00
Sven Woop 674f5f13d5 bugfix to embree-config.cmake, embree library is now called embree3 2018-03-02 07:26:26 +01:00
Attila Afra 5cdcf16e1c use 16-wide SIMD in quad intersector only on KNL 2018-03-02 04:03:37 +02:00
Attila Afra c4dc08825d Merge remote-tracking branch 'origin/vsizel' into release 2018-03-02 03:34:36 +02:00
Attila Afra 3108be60e7 added an assert 2018-03-02 03:32:41 +02:00
Attila Afra edf4b495a3 removed AVX512 FMA unit count detection (reverted from commit 9638b58cba) 2018-03-02 03:20:26 +02:00
Attila Afra 0fbcbf5bbe cleanup 2018-03-02 03:16:48 +02:00
cbenthin 0de000a44b enabled filter fcts for grids 2018-03-01 20:41:59 +01:00
Attila Afra b8e383edc8 cleanup 2018-03-01 20:17:51 +02:00
cbenthin d56ff38b05 added -convert-triangles-to-grids-to-quads option 2018-03-01 18:47:38 +01:00
cbenthin c84be47e1e added parallel primref generation for grid meshes 2018-03-01 18:16:24 +01:00
Attila Afra 3704b58214 added detection of number of AVX512 FMA units 2018-03-01 18:08:17 +02:00
cbenthin 4e10b81696 clamping input tess values for grid 2018-03-01 16:59:09 +01:00
cbenthin 123f71699e fixed bug in tris-to-grid conversion 2018-03-01 16:53:43 +01:00
Sven Woop 62d01f656d added missing file 2018-03-01 15:18:00 +01:00
Sven Woop 69cbd82b3b removed singledevice stuff from Device 2018-03-01 14:17:53 +01:00
Sven Woop a08316c716 disabled 16-wide in-register binner for SKX 2018-03-01 14:11:23 +01:00
Sven Woop 7c92d705cb improved invokation of binner in heuristic_spatial_array.h 2018-03-01 14:11:01 +01:00
Sven Woop 9f2ce6dd33 removed duplicate userGeom pointer from AccelSet 2018-03-01 13:58:32 +01:00
Sven Woop ef7bb6e656 Instances have now separate traversal and no longer
depend on user geometries.
2018-03-01 13:47:14 +01:00
Attila Afra 317ac99455 optimized asBool for AVX512VL, added some missing cast functions 2018-03-01 12:56:02 +02:00
Attila Afra 30d9e9723e optimized asBool for AVX512VL, added some missing cast functions 2018-03-01 12:55:06 +02:00
Attila Afra 9638b58cba started to implement AVX512 FMA unit count detection 2018-03-01 12:21:06 +02:00
Sven Woop 33c5055b63 implemented separate BVH, builders and traversers for instances 2018-03-01 10:02:44 +01:00
cbenthin d93b9bf34c fixed crash when grids are disabled 2018-03-01 09:56:21 +01:00
Sven Woop 035ee5d345 compacted members in Geometry class 2018-03-01 08:36:31 +01:00
Sven Woop 17d8aefe7e reduced aligmnent for instances, this results in significant memory savings 2018-03-01 07:39:35 +01:00
Sven Woop ff36f706c8 Merge branch 'swoop' into devel 2018-02-28 15:32:51 +01:00
Sven Woop dcde5e3fd1 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-02-28 15:32:44 +01:00
Sven Woop e241414fa9 removed unused used field from Geometry 2018-02-28 14:47:58 +01:00
Attila Afra 802164ade9 Merge remote-tracking branch 'origin/release' into vsizel 2018-02-28 15:41:46 +02:00
Attila Afra fe042fe7a0 renamed CMake options EMBREE_GEOMETRY_TRIANGLES/QUADS/CURVES to *_TRIANGLE/QUAD/CURVE 2018-02-28 15:39:52 +02:00
Sven Woop 6cca401b02 reduced alignment from 64 to 16 of many class 2018-02-28 14:12:16 +01:00
Sven Woop e0466328fb reduced aligmnent for instances, this results in significant memory savings 2018-02-28 13:33:57 +01:00
Sven Woop d8aec0e93b compile fix for windows 2018-02-28 13:33:01 +01:00
Attila Afra 1dbea98dbb fixed bug in packet occlusion when compiled ONLY for AVX512SKX 2018-02-28 13:22:07 +02:00
Attila Afra fb3b3a7fc9 fixed bug in rtcOccluded4/8/16 when only AVX512 ISA was enabled (reverted from commit c33d3c01f0) 2018-02-28 13:21:27 +02:00
Attila Afra 5be525ff0b fixed bug in packet occlusion when compiled ONLY for AVX512SKX 2018-02-28 13:15:06 +02:00
Sven Woop 00b6f06861 improved tutorial timing/memory output, added --delta command line option 2018-02-28 11:16:43 +01:00
Sven Woop c90bc36942 added improved logging to tutorials 2018-02-28 10:58:46 +01:00
Sven Woop 90942b01f1 fixed problem with loading flattened XML with lights 2018-02-28 10:29:00 +01:00
Sven Woop 10b39147e7 XML writer can store normal oriented curves 2018-02-28 07:59:38 +01:00
Sven Woop d0bc45094f Merge branch 'devel' into swoop 2018-02-28 07:55:30 +01:00
Sven Woop 47c7ed06fb disabled some debug prints 2018-02-28 07:52:58 +01:00
Sven Woop cdf62f7a84 fixed scene graph statistics for number of materials and grid meshes 2018-02-28 07:52:45 +01:00
Sven Woop 6f2b25fed6 flat linear curve fix to xml_writer 2018-02-28 07:23:28 +01:00
cbenthin 6f4cf90254 updates to the grid builder 2018-02-27 19:38:01 +01:00
Sven Woop eb936a9e08 bugfix in XML writer 2018-02-27 16:26:05 +01:00
Sven Woop 8831da2271 added support to load some corrupted OBJ files 2018-02-27 13:40:35 +01:00
Sven Woop 8173460e59 improved performance of rtcCommitGeometry 2018-02-27 11:54:47 +01:00
Sven Woop 85ff154227 Merge remote-tracking branch 'origin/devel' into swoop 2018-02-27 11:39:38 +01:00
Sven Woop 1c0841442a compile fix 2018-02-27 11:39:20 +01:00
Sven Woop c3208ae63e increased verbosity level of some BVH build output 2018-02-27 10:25:37 +01:00
Sven Woop 8fd041eac3 added scene graph statistics 2018-02-27 10:21:00 +01:00
Sven Woop c33d3c01f0 fixed bug in rtcOccluded4/8/16 when only AVX512 ISA was enabled 2018-02-27 08:56:55 +01:00
Sven Woop 5ad3315ee2 added flattened instancing mode 2018-02-27 07:57:48 +01:00
Sven Woop 1ec8a0778e updates 2018-02-27 07:30:28 +01:00
Sven Woop bfa010855c removed spaces input from scene graph flattener 2018-02-27 07:24:52 +01:00
Attila Afra ca6a45c9f0 use VSIZEX for incoherent streams, and VSIZEL for coherent ones 2018-02-26 14:32:35 +02:00
Attila Afra 91fb545199 fixed previous commit 2018-02-26 14:16:36 +02:00
Attila Afra 228b3e2e78 simplified code 2018-02-26 14:15:48 +02:00
Attila Afra b7592b1fe0 minor cleanup 2018-02-26 14:08:04 +02:00
atafra ce81e876ee Merge remote-tracking branch 'origin/release' into vsizel
# Conflicts:
#	kernels/common/accel.h
2018-02-26 13:58:03 +02:00
Sven Woop e82b5887ee cleanup 2018-02-26 12:03:40 +01:00
Sven Woop 0575235e19 INSTANCING_SCENE_XXX -> INSTANCING_XXX 2018-02-26 11:58:03 +01:00
Sven Woop 5d21c19d95 added benchmark outputs 2018-02-26 11:54:21 +01:00
Sven Woop 7946fb8395 optimized set_scene performance 2018-02-26 11:49:08 +01:00
Sven Woop 4c8f9a1b99 improved obj_scene_add performance 2018-02-26 11:39:59 +01:00
Sven Woop 173b45365e removed geomID_to_scene array 2018-02-26 11:30:26 +01:00
Sven Woop 650ad52c65 always creating group even for single instanced geometries, this similifies the code 2018-02-26 11:09:31 +01:00
Sven Woop 13e85e4b0d no longer misusing inst->geom.geomID 2018-02-26 11:05:23 +01:00
Sven Woop 76257fe0c7 removed geomID_to_inst array, not required 2018-02-26 10:00:35 +01:00
Sven Woop cfc1f03816 cleanups 2018-02-26 09:11:56 +01:00
Sven Woop 8e98880e56 updates 2018-02-26 09:10:20 +01:00
Sven Woop c846042106 updates 2018-02-26 09:07:49 +01:00
Sven Woop 6a33c2f3c1 removed geometry instancing feature 2018-02-26 09:05:24 +01:00
Sven Woop e9a0f5b9c8 optimization to scene flattening 2018-02-26 08:58:10 +01:00
Attila Afra 8b6a464404 fixed bug in Instance which caused incorrect results for msmblur using 4/8-wide packets on SKX 2018-02-25 17:02:25 +02:00
Attila Afra 2c242473c9 added next_unique SIMD helper functions 2018-02-25 16:59:44 +02:00
Attila Afra e24f0f7b86 minor foreach_unique optimization 2018-02-25 15:48:07 +02:00
Attila Afra 09e9e0d619 added missing vbool andn functions 2018-02-25 15:47:23 +02:00
atafra 5ead7d6c5e fixed some dangerous casts 2018-02-24 00:56:54 +02:00
atafra 8e2ca9a44c preparing stream intersector to use different packet sizes for coherent and incoherent 2018-02-23 22:06:22 +02:00
atafra 7126b751bc cleanup 2018-02-23 21:28:25 +02:00
atafra 33e8ed33ce added missing vbool array accessors 2018-02-23 20:40:11 +02:00
cbenthin 8e4c07fbbe added -grid-res resX resY option to tutorials to force grid tessellation a resX x resY grid 2018-02-23 16:12:35 +01:00
Sven Woop bb5e8fb4b1 updates 2018-02-23 15:43:12 +01:00
Sven Woop e1a1cd0f64 updates 2018-02-23 15:36:20 +01:00
atafra 49f4bc3098 cleanups 2018-02-23 16:17:05 +02:00
Sven Woop 4fc2e70a91 optimized extraction of lights and cameras 2018-02-23 15:05:42 +01:00
atafra 8469e56c38 stream intersector cleanups 2018-02-23 15:56:10 +02:00
atafra e2ad0fae88 better separation of coherent and incoherent stream kernels 2018-02-23 15:43:48 +02:00
Sven Woop e031fe7833 updates to load statistics 2018-02-23 14:43:03 +01:00
cbenthin e2a2ce3261 first version of -convert-triangles-to-grids seems to work 2018-02-23 14:33:52 +01:00
Sven Woop e286da434e optimized finding closed subtrees in scenegraph 2018-02-23 14:26:58 +01:00
atafra 893ff86abf added VSIZEL, updated the internal stream interface 2018-02-23 14:21:29 +02:00
Sven Woop d5868c6e02 ignoring unbound materials 2018-02-23 13:11:37 +01:00
cbenthin 42d52c6031 more scenegraph/ispc layer updates 2018-02-23 11:20:39 +01:00
cbenthin 3a01ebb71e Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-02-23 11:15:44 +01:00
cbenthin 97e4cfdc5a updates 2018-02-23 11:15:32 +01:00
Sven Woop d5eafa64d8 forcing checkout of models 2018-02-23 10:38:35 +01:00
Sven Woop 2df80085d0 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-02-23 09:08:38 +01:00
Sven Woop d20794017a setting version to v3.1.0-alpha.0 2018-02-23 09:08:22 +01:00
Sven Woop d3d2043413 Merge branch 'release' into devel 2018-02-23 09:07:06 +01:00
Sven Woop e97de67c49 removed not required fallback from occludedN in accel.h 2018-02-23 09:06:46 +01:00
cbenthin 9129960d9a bugfix 2018-02-22 21:00:04 +01:00
cbenthin 21d59c0565 small updates 2018-02-22 19:22:31 +01:00
Sven Woop 234f501b7e compile fix for MacOSX 2018-02-22 07:10:59 +01:00
cbenthin 8a389a2ef3 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-02-21 19:14:06 +01:00
cbenthin 2a8983f993 starting to support grids in the scene graph layer 2018-02-21 19:13:55 +01:00
Sven Woop 6beed06a64 Merge branch 'swoop2' into devel 2018-02-21 17:19:40 +01:00
Sven Woop b0b5a60e24 using virtual primrefgen interface 2018-02-21 12:51:20 +01:00
Sven Woop 3ce28c9ca3 compile fix for windows 2018-02-21 12:17:58 +01:00
Sven Woop 84ebf20f83 first step for using virtual primrefgen interface 2018-02-21 12:08:21 +01:00
Sven Woop 6b84776cf7 compile fix for windows 2018-02-21 11:13:17 +01:00
Sven Woop ff0c243269 added virtual createPrimRefArray for single geometry 2018-02-21 11:07:30 +01:00
Sven Woop da4b9e6271 removed experimental geometry instancing feature 2018-02-21 10:54:07 +01:00
Sven Woop a25b809afd using BVH4 for compact quads in dynamic scene mode 2018-02-21 10:27:10 +01:00
Sven Woop da6cb5a755 compile fix 2018-02-21 10:15:19 +01:00
Sven Woop d3943d1793 removed define _CRT_SECURE_NO_WARNINGS 2018-02-21 09:50:37 +01:00
Sven Woop a46f6a20e4 __dllexport/import -> dllexport/import 2018-02-21 09:41:40 +01:00
Sven Woop 7b4f9ebab0 renames _mm_lookupmask -> mm_lookupmask 2018-02-21 09:30:15 +01:00
Sven Woop 95d5936f3b removed various __ from intrinsics.h 2018-02-21 09:23:35 +01:00
Sven Woop 74b95c9b42 bezier -> curve 2018-02-21 09:09:07 +01:00
Sven Woop 0e143a75d8 some subdiv related renames 2018-02-21 09:06:07 +01:00
Sven Woop 8afd3ee0f4 removed cached mode from SubdivPatch1CachedMBBuilder 2018-02-21 08:59:08 +01:00
Sven Woop 0a1a6f504a removed SubdivPatch1CachedBuilderSAH 2018-02-21 08:53:43 +01:00
Sven Woop a8a2ae633b removed dead code from cached subdiv intersector 2018-02-20 15:03:01 +01:00
Sven Woop 55fe496a3d removed subdivpatch1cached_intersector.h 2018-02-20 14:49:57 +01:00
Sven Woop 47875f1794 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-02-20 14:41:19 +01:00
cbenthin 891831d404 fixed bvh build stats 2018-02-20 14:24:13 +01:00
Sven Woop 8616b25d64 optimization to oriented curve intersector 2018-02-20 13:52:34 +01:00
Sven Woop 04e570b7c2 improvement to v clipping in oriented curve intersector 2018-02-20 13:44:07 +01:00
cbenthin eab2cbda56 builder updates 2018-02-20 13:43:39 +01:00
Sven Woop 653bc60724 AVX optimization for oriented curve intersector 2018-02-20 13:31:26 +01:00
Sven Woop b781f0af39 cleanups in curve_intersector_oriented.h 2018-02-20 12:09:49 +01:00
cbenthin a72f4bae28 updated grid builder settings 2018-02-20 12:00:25 +01:00
cbenthin b3f4ad5c4c Merge remote-tracking branch 'origin/devel' into grid 2018-02-20 11:45:16 +01:00
cbenthin 7a95a1e450 dealing with invalid tess levels per grid (<2) 2018-02-20 11:44:58 +01:00
cbenthin 150c477393 builder can now handle non-common geomIDs per leaf for subgrids 2018-02-20 11:14:21 +01:00
Sven Woop fec038ed2b installing static libraries when Embree compiled with EMBREE_STATIC_LIB=ON 2018-02-20 10:30:35 +01:00
cbenthin 50b68ea9cb added qbvh packet node intersectors 2018-02-20 10:20:34 +01:00
Sven Woop ae821334b4 Merge branch 'swoop' into devel 2018-02-20 10:11:21 +01:00
Sven Woop 169933b005 enabled zero derivative hair test 2018-02-20 09:50:22 +01:00
Sven Woop 07e16f375b added zero derivative hair test 2018-02-20 09:45:10 +01:00
Sven Woop 2234b4acdf added workaround for ribbon intersector when curve has zero derivatives 2018-02-20 09:42:04 +01:00
Sven Woop 3c41998a6e forcing checkout of models 2018-02-20 09:41:51 +01:00
cbenthin e27ae915b4 Merge remote-tracking branch 'origin/devel' into grid 2018-02-20 09:05:46 +01:00
Sven Woop a51524d16f some renames 2018-02-20 08:44:35 +01:00
Sven Woop c18b94a464 calculation of accurate bounds for oriented curves is working 2018-02-20 08:39:39 +01:00
Sven Woop 2e0b77eddf also checking normal array to determine of curve is valid 2018-02-20 08:34:04 +01:00
Sven Woop a7433844f4 next step to calculate proper bounds for oriented curve 2018-02-20 08:32:06 +01:00
Sven Woop 00fbdc294c extensions to scene_curves.cpp to calculate proper bounds of oriented curve 2018-02-20 08:24:04 +01:00
Sven Woop 65893fe4b5 linearBounds function of curves uses linearspace instead of affinespace now 2018-02-20 07:57:43 +01:00
Sven Woop 7d3e501a9d updates to scene_curves.cpp 2018-02-20 07:53:32 +01:00
Sven Woop 68991a9676 moved oriented curve construction to common place 2018-02-20 07:47:44 +01:00
Sven Woop 2dc91a108c cleanups to scene_curves.cpp 2018-02-20 07:37:41 +01:00
Sven Woop 6e54d4e383 cleanups to scene_curves.cpp 2018-02-20 07:29:50 +01:00
Sven Woop 3d182f2985 bugfix, curve radius may be negative for BSpline basis 2018-02-20 07:12:54 +01:00
cbenthin 20274cb34a updates for hybrid intersector 2018-02-19 19:38:13 +01:00
cbenthin 424e99e364 starting to adapt hybrid primitive intersector interface 2018-02-19 18:52:39 +01:00
cbenthin 1aa7f6b865 merged origin into grid 2018-02-19 17:19:39 +01:00
cbenthin 0d83692ce8 QBVH intersection test works now for SubGridQBVHN node 2018-02-19 17:02:25 +01:00
cbenthin 38c041dbe2 first version of SubGridQBVHN fat leaf intersector working 2018-02-19 14:55:52 +01:00
Sven Woop df69271330 Merge commit '5497366' into swoop 2018-02-19 14:54:40 +01:00
Sven Woop 54973667b5 bugfix in oriented curve builder 2018-02-19 14:54:31 +01:00
cbenthin 7afa445081 bug and compile fixes 2018-02-19 13:55:22 +01:00
cbenthin 94f7b2a435 bugfix 2018-02-19 13:11:27 +01:00
cbenthin f4be8614ec merging devel into grid branch 2018-02-19 11:52:22 +01:00
cbenthin bd8c954ea9 passing travray structure to leaf intersectors (currently only single ray isecs) 2018-02-19 11:36:31 +01:00
Sven Woop 984e1d507e enabled testing for oriented curves 2018-02-19 11:26:11 +01:00
Sven Woop e09963e039 added cameras to oriented curves model 2018-02-19 11:22:32 +01:00
Sven Woop b022615584 added mblur test cases 2018-02-19 11:07:48 +01:00
Sven Woop 23547380d0 bugfix in mblur for oriented curves 2018-02-19 10:58:22 +01:00
Sven Woop dd1380dc6b added oriented bspline curve model 2018-02-19 10:46:19 +01:00
Sven Woop e5960ebafc implemented oriented curves for BSpline basis 2018-02-19 10:09:50 +01:00
Sven Woop 488e9586c6 implemented mblur for oriented curves 2018-02-19 09:52:45 +01:00
Sven Woop 950e3e72f5 implemented fast mode for oriented curves 2018-02-19 09:33:38 +01:00
Sven Woop cb219303f1 implemented ray packet mode for oriented curve intersector 2018-02-19 09:22:46 +01:00
cbenthin 09d57e1068 updates 2018-02-17 17:01:10 +01:00
cbenthin 630afcbc5c QuantizedNode is now inherited from QuantizedBaseNode and regular BaseNode 2018-02-17 16:21:02 +01:00
cbenthin 899d57f49e bug fixes 2018-02-17 12:50:37 +01:00
cbenthin 7b3b9cae81 updates 2018-02-16 16:51:04 +01:00
cbenthin 569fd5d138 updates 2018-02-16 15:24:47 +01:00
Sven Woop 13c60db485 intersecting oriented curve using bezier clipping works again 2018-02-16 13:55:19 +01:00
cbenthin d25c20a71e moved two 3x3 bit flags from geomID to subdiv index x,y 2018-02-16 13:52:54 +01:00
Sven Woop c0103bfd74 cleanups 2018-02-16 13:09:32 +01:00
Sven Woop 520aa7b97e cleanups 2018-02-16 13:06:29 +01:00
Sven Woop 7b58b8852a unified two bezier curve classes 2018-02-16 13:03:37 +01:00
Sven Woop 4ec72e6e4e all bezier curves use vi vertex naming 2018-02-16 11:52:10 +01:00
Sven Woop 1875cf35d0 moved some bezier code in place 2018-02-16 11:35:38 +01:00
Sven Woop d70a94fd46 optimized usage of curve precalculations inside oriented curve intersector 2018-02-16 11:22:11 +01:00
Sven Woop 5e2a54f3d9 cleanups 2018-02-16 10:38:24 +01:00
Sven Woop 2a418287e4 bugfix 2018-02-16 10:33:27 +01:00
Sven Woop 9d1d8eb455 using curve precalculations inside oriented curve intersector 2018-02-16 10:26:41 +01:00
Sven Woop 03f8d5c802 curve related renames 2018-02-16 10:07:59 +01:00
Sven Woop 7e8acc0e7e cleanups 2018-02-16 09:13:30 +01:00
Sven Woop c2204767e1 curve related renames 2018-02-16 09:11:11 +01:00
Sven Woop 08dd1c9284 curve related renames 2018-02-16 09:00:30 +01:00
Sven Woop 415184c5a2 renamed various curve related files 2018-02-16 08:53:22 +01:00
Sven Woop e24fc2345b renamed curve_intersector.cpp to virtual_curve_intersector.cpp 2018-02-16 08:34:38 +01:00
Sven Woop 98bb603b43 updates to scene_curves.cpp 2018-02-16 08:29:40 +01:00
Sven Woop 773c55ff1a unifying bezier and bspline curves 2018-02-16 08:05:36 +01:00
Sven Woop f2624c2990 cleanups to bspline_curve.h 2018-02-16 07:55:35 +01:00
Sven Woop d486942295 cleanups to bspline_curve.h 2018-02-16 07:52:09 +01:00
Sven Woop aff573b895 using standard BSplineBasis also for BSplinePatch 2018-02-16 07:50:42 +01:00
Sven Woop f5edf03668 cleanups 2018-02-16 07:43:39 +01:00
Sven Woop b5e09c9a80 cleanups 2018-02-16 07:39:49 +01:00
Sven Woop fa3e9f5bc1 cleanups in bezier_curve.h 2018-02-16 07:36:39 +01:00
Sven Woop bc922b2124 cleanups 2018-02-16 07:22:56 +01:00
Sven Woop d89b0c8917 Merge branch 'devel' into swoop 2018-02-16 07:20:42 +01:00
Sven Woop 8b6a4c7613 KNL bugfix of virtual hair intersector 2018-02-16 07:20:28 +01:00
Sven Woop 88df96af88 fixed win32 compile issue 2018-02-16 07:16:50 +01:00
Sven Woop e11973b014 renamed scene_bezier_curves to scene_curves 2018-02-15 15:01:56 +01:00
Sven Woop 371dd0cc92 NativeCurves -> CurveGeometry 2018-02-15 14:54:54 +01:00
Sven Woop eaf216ad20 Merge branch 'devel' into swoop 2018-02-15 14:52:56 +01:00
Sven Woop 8f85f7b8da workaround for GCC compiler bug 2018-02-15 14:52:42 +01:00
Sven Woop a503ca8b35 compile fix 2018-02-15 14:27:00 +01:00
Sven Woop b6c59dc661 cleanups 2018-02-15 14:16:39 +01:00
Sven Woop 1e370177d7 cleanups 2018-02-15 14:09:34 +01:00
Sven Woop 6072d5f9f9 cleanups 2018-02-15 13:41:55 +01:00
Sven Woop beeb483e5d cleanups 2018-02-15 13:41:25 +01:00
Sven Woop 029b6824c9 bugfix in scene_bezier_curve.cpp 2018-02-15 13:21:28 +01:00
Sven Woop c703913fc1 cleanups 2018-02-15 13:19:06 +01:00
Sven Woop ed507f6b0b bugfix, oriented curve intersection works again 2018-02-15 13:16:09 +01:00
Sven Woop c081e03c6b bugfix in scene statistics output 2018-02-15 13:06:48 +01:00
Sven Woop 2aeb2a29a6 Merge branch 'swoop2' into swoop 2018-02-15 11:33:36 +01:00
Sven Woop 8f53a4a491 bugfix 2018-02-15 10:35:40 +01:00
Sven Woop 3c9d509b5c Removed EMBREE_NATIVE_SPLINE_BASIS cmake option.
Basis conversion on longer happening as a pre-process which saves much memory.
Virtual curve intersectors are properly instantiated to operate in the basis of the curve.
2018-02-15 09:29:55 +01:00
Sven Woop 8819065573 removed bezier1i and bezier1v 2018-02-15 09:06:35 +01:00
Sven Woop ad154d4e95 removed BVH4Bezier1v/1i with AABBs 2018-02-15 08:20:04 +01:00
Sven Woop 198946b5a8 removed inlined versions of bezierNi_intersector 2018-02-15 08:10:37 +01:00
Sven Woop 9c3960bfca fixed potential issue with curves with zero bounds 2018-02-15 07:47:35 +01:00
Sven Woop 7f54eb6b4a bugfix in benchmark.py script 2018-02-14 11:40:38 +01:00
Sven Woop c98c83225b temporary workaround to let testing run through 2018-02-14 11:11:57 +01:00
Sven Woop 358004dfbe reduced size of virtual function table 2018-02-14 11:06:30 +01:00
Sven Woop 4fb748b8a4 compile fix for AVX512 2018-02-14 11:02:18 +01:00
Sven Woop a975ed5f77 layout fixing for scene statistics output 2018-02-14 10:55:33 +01:00
Sven Woop 461472aff4 enabling virtual curve intersectors by default 2018-02-14 10:51:45 +01:00
Sven Woop a6436a9bb7 windows compile fix 2018-02-14 10:43:39 +01:00
Sven Woop 9474d34c6c finished virtual curve intersector implementation 2018-02-14 10:37:57 +01:00
Sven Woop 2e1a7cd0ea instantiating all virtual curve primitive intersectors 2018-02-14 09:53:59 +01:00
Sven Woop 59245ddb4e Extending internal geometry type to encode all geometry types
supported in API. This makes distinguishing curve type, and curve subtype
not necessary anymore.
2018-02-14 09:33:15 +01:00
Sven Woop d3100cb976 Merge branch 'devel' into swoop2 2018-02-14 08:04:55 +01:00
Sven Woop 84855f3a1e bugfix in bvh_access tutorial when linking statically 2018-02-14 08:04:40 +01:00
cbenthin 57ac4d5128 first version of u/v interpolation is working for hybrid intersectors: 2018-02-13 18:06:09 +01:00
Sven Woop bb8b75c89f first virtual curve intersector works 2018-02-13 16:48:09 +01:00
cbenthin d422038808 some progress 2018-02-13 16:30:41 +01:00
cbenthin 33ff1a88ca single ray mode in hybrid works 2018-02-13 16:16:21 +01:00
Sven Woop 23339329f1 BezierNi and BezierNiMB use virtual interface now 2018-02-13 15:38:44 +01:00
Sven Woop e36227fbbd improvement to computeAlignedSpaceMB 2018-02-13 15:31:04 +01:00
Sven Woop a9babda896 hair mblur builder uses virtual interface 2018-02-13 15:21:57 +01:00
cbenthin 1d4465a3ed still fighting to get u,v post-interpolation into hybrid intersectors...not working yet 2018-02-13 12:38:28 +01:00
Sven Woop b3e22069a4 hair mblur builder uses virtual interface to geometry 2018-02-13 12:28:40 +01:00
Sven Woop dff9fb52f1 hair mblur builder uses virtual createPrimRefMBArray interface of geometry 2018-02-13 12:03:04 +01:00
Sven Woop ef0bb390ea hair builder uses virtual interface to geometry 2018-02-13 11:52:16 +01:00
Sven Woop a3e8ad8e3b hair builder uses virtual createPrimRefArray function of geometry 2018-02-13 11:10:49 +01:00
cbenthin f7f2ec72e4 updates to single ray intersectors plus workaround for clang compiler issue 2018-02-13 10:32:18 +01:00
Sven Woop d34aa8acc2 passing Accel::Intersectors* to leaf intersectors 2018-02-13 10:12:13 +01:00
Sven Woop 56812dd4fb unified hair intersector interface 2018-02-13 09:21:49 +01:00
Sven Woop f575d74131 fixed memory consumption issue of compact hair, enabled memory_consumption tests for compact scene again 2018-02-13 08:19:53 +01:00
cbenthin 57da948942 first version of single intersector u/v computation works 2018-02-12 17:39:59 +01:00
Sven Woop cfcf5aba6f Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-02-12 14:59:38 +01:00
cbenthin be2d0ff2a2 updates for u,v computation 2018-02-12 14:10:32 +01:00
cbenthin 50f8178f28 updates 2018-02-12 11:53:10 +01:00
Sven Woop f3a79a4731 hair intersectors share common Precalculations 2018-02-12 09:50:29 +01:00
Sven Woop 9a2cb07424 Merge branch 'devel' into swoop2 2018-02-12 09:09:29 +01:00
Sven Woop bc1a8e2253 compile fix 2018-02-12 08:52:09 +01:00
Sven Woop 3a813dc132 cleanups 2018-02-12 08:46:25 +01:00
Sven Woop 3c8395b728 cleanups 2018-02-12 08:30:05 +01:00
Sven Woop c51c1ac000 cleanups 2018-02-12 08:27:11 +01:00
Sven Woop d4c56f6c38 cleanups 2018-02-12 08:19:06 +01:00
Sven Woop 00f0d5c45b only keeping best compact hair leaf representation with one quantized space per hair 2018-02-12 08:12:37 +01:00
Sven Woop 2c87d2618b added assertions in hair leaf encoding 2018-02-12 08:04:01 +01:00
Sven Woop dec7f8f98f bvh4obb.bezier8imb bugfix 2018-02-12 07:34:05 +01:00
Sven Woop bef62b484c Merge branch 'vikramambrose-vdouble-simd-fma' into devel 2018-02-12 07:10:48 +01:00
Vikram Ambrose 32147b113b Add fma templates for vdouble4/8. Similar to vfloat fma
Also add a broadcast template. Works just like the vfloat broadcasts
2018-02-09 19:33:25 +02:00
Sven Woop 1d05f317a6 compile fixes 2018-02-09 14:50:10 +01:00
Sven Woop 859de14aee removed remaining parts of leaf debug visualization mode 2018-02-09 14:06:10 +01:00
Sven Woop 5c675b53fc using bvh4obb.bezier4i/8i/4v and bvh8obb.bezier8v 2018-02-09 13:34:38 +01:00
Sven Woop d8b68b5bce completing new compact hair implementation 2018-02-09 11:54:05 +01:00
Sven Woop 1cb6e830e9 implemented packet intersector for new compact hair layout 2018-02-09 10:46:07 +01:00
cbenthin 574c6dfa50 updates 2018-02-09 10:13:01 +01:00
Sven Woop 0069384a8a implementing new and old hair leaves side by side 2018-02-09 09:58:56 +01:00
Sven Woop 7d9cb9c807 hair msmblur builder uses SAH block size 2018-02-09 09:36:22 +01:00
cbenthin b9d9921c79 testing packet intersectors 2018-02-09 09:23:16 +01:00
Sven Woop 97f69a4ca0 bugfix 2018-02-09 08:51:55 +01:00
Sven Woop 0b1edca83d compact motion blur using bezierNi_mb works 2018-02-09 08:49:05 +01:00
cbenthin 62cba18a6c udpates 2018-02-08 15:57:16 +01:00
cbenthin dc509c22da updates for getting packet intersectors to work 2018-02-08 15:29:04 +01:00
Sven Woop 885cc56bab removed debug output 2018-02-08 15:01:31 +01:00
Sven Woop 31640b05c0 started implementing bezierNi_mb 2018-02-08 15:00:25 +01:00
Sven Woop affa8eab9d bugfix in heuristic_binning_array_unaligned.h, curve orientation was not calculated properly for B-Spline basis 2018-02-08 14:33:22 +01:00
Sven Woop 3c12689a6d moved createLeafMB function to bezier1i.h 2018-02-08 14:21:39 +01:00
Sven Woop a6477a74e0 cleanups 2018-02-08 14:03:55 +01:00
Sven Woop 6c25448b55 cleanups 2018-02-08 13:58:21 +01:00
Sven Woop 864b245dbb cleanups 2018-02-08 13:51:24 +01:00
Sven Woop 52027b1397 adding prefetches 2018-02-08 13:27:56 +01:00
Sven Woop 836776eacc added bezierNv layout 2018-02-08 13:14:45 +01:00
Sven Woop 76b97a68f1 improved aligned space calculation 2018-02-08 12:41:19 +01:00
Sven Woop 23cfb3d476 improved aligned space calculation 2018-02-08 12:28:13 +01:00
Sven Woop 12554509fc improved support for hierarchical loading 2018-02-08 11:25:06 +01:00
cbenthin 0239e40f03 Merge remote-tracking branch 'origin/devel' into grid 2018-02-08 11:05:59 +01:00
Sven Woop d78b275431 XML writer can export material references 2018-02-08 10:55:57 +01:00
Sven Woop 18426b6765 bugfix in XML exporter 2018-02-08 10:08:22 +01:00
Sven Woop 1639d3f1ad Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-02-08 10:00:42 +01:00
Sven Woop 7f63254542 updates to XML loader 2018-02-08 08:35:31 +01:00
cbenthin 1fa2724987 2x2,2x3,3x2 pattern works using conditional delta expension 2018-02-07 18:21:25 +01:00
cbenthin fd17910b22 single ray mode somewhat works 2018-02-07 17:27:02 +01:00
cbenthin 33a9b5ba79 intersector updates 2018-02-07 14:47:50 +01:00
cbenthin efe2e646b1 updates 2018-02-07 13:32:38 +01:00
Sven Woop 818df77678 prefetching further 2018-02-07 11:11:28 +01:00
Sven Woop 5206c3c244 performance optimizations 2018-02-07 11:04:04 +01:00
Sven Woop 124eb6a894 updates 2018-02-07 11:02:15 +01:00
Sven Woop a47b31e5b6 storing only one geomID in bezierNi 2018-02-07 10:57:55 +01:00
cbenthin 2a2da2addf updates 2018-02-07 10:37:33 +01:00
Sven Woop 215605aacf hair builder splits by geometry 2018-02-07 10:36:36 +01:00
Sven Woop 9ab969d212 optimization and bugfix in prefetch 2018-02-07 10:16:29 +01:00
Sven Woop 96b9cadb8b adding prefetches 2018-02-07 10:08:54 +01:00
Sven Woop 603af0f3ce optimization 2018-02-07 09:58:57 +01:00
Sven Woop 59c8b64048 cleanups 2018-02-07 09:56:10 +01:00
Sven Woop dce11d55a2 using logBlockSize in hair builder 2018-02-07 09:40:02 +01:00
Sven Woop 286995e5c7 fixes to BVH statistics 2018-02-07 09:22:21 +01:00
Sven Woop ff8d77c0f4 updates 2018-02-07 08:59:31 +01:00
Sven Woop 5afcb40c17 cleanups 2018-02-07 08:55:14 +01:00
Sven Woop 28f4d754a9 reduced memory consumption further 2018-02-07 08:52:04 +01:00
cbenthin 5d834e7cb4 updates 2018-02-06 17:53:24 +01:00
Sven Woop f59208b53a updates 2018-02-06 14:39:04 +01:00
Sven Woop c03c60df95 bugfix in oriented bbox intersection 2018-02-06 14:29:44 +01:00
Sven Woop b1eb512243 restoring pathtracer 2018-02-06 13:18:59 +01:00
Sven Woop ef38b30968 updates to statistics 2018-02-06 13:16:57 +01:00
Sven Woop a2e6add7b6 bugfix to stat.cpp 2018-02-06 13:01:41 +01:00
Sven Woop 95d457d308 added further hair leaf mode 2018-02-06 12:44:00 +01:00
Sven Woop 8adafc3e20 bugfix in stats 2018-02-06 11:48:55 +01:00
Sven Woop 86cf5d1337 deactivated leaf debug visualization mode 2018-02-06 10:49:41 +01:00
Sven Woop 48eb104282 implemented occlusion query for compact hair 2018-02-06 10:42:45 +01:00
cbenthin 5c6f02c5fd Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-02-06 10:09:30 +01:00
cbenthin e1aab7b4a8 win32 fix 2018-02-06 10:09:20 +01:00
cbenthin a68148adf7 updates 2018-02-06 09:59:02 +01:00
Sven Woop 6a507a173b cleanups 2018-02-06 09:41:28 +01:00
Sven Woop 6c43248cb5 compact SOA layout 2018-02-06 09:18:04 +01:00
Sven Woop 4f9ae34ebc updates 2018-02-06 09:07:16 +01:00
Sven Woop ffc93c511a compressing more 2018-02-06 08:53:05 +01:00
Sven Woop c4e85b9c7f compact SOA layout 2018-02-06 08:47:38 +01:00
Sven Woop 2cd785e3a9 bugfix 2018-02-06 08:32:51 +01:00
Sven Woop 152af04898 allocating only required memory for compact SOA 2018-02-06 08:25:25 +01:00
Sven Woop ed98ba430f moved createLeaf function to bezier1i,bezierNi,bezier1v 2018-02-06 08:13:37 +01:00
Sven Woop 128a90ef65 compressing SOA layout further 2018-02-06 08:02:27 +01:00
cbenthin 6045ecd539 updates 2018-02-05 21:24:22 +01:00
cbenthin b9334f4cd3 updates 2018-02-05 18:54:03 +01:00
cbenthin 34ee23ab1a fixed win warnings 2018-02-05 14:12:55 +01:00
cbenthin 4640a10d81 updates 2018-02-05 11:54:54 +01:00
Sven Woop dd02d5edbc memory optimization 2018-02-05 11:45:19 +01:00
Sven Woop 80542d2435 cleanups 2018-02-05 11:43:05 +01:00
cbenthin 62f2e23a59 Merge remote-tracking branch 'origin/devel' into grid 2018-02-05 11:33:48 +01:00
cbenthin 970f2bfdf5 regenerated tutorials 2018-02-05 11:28:04 +01:00
Sven Woop a73096ed86 bugfix 2018-02-05 11:27:08 +01:00
Sven Woop 12456003d9 memory reductions 2018-02-05 11:16:27 +01:00
cbenthin 88ada8c7f2 Merge remote-tracking branch 'origin/cbenthin' into devel 2018-02-05 10:50:24 +01:00
Sven Woop fad52bea20 creating BVH with proper leaf type 2018-02-05 10:38:55 +01:00
cbenthin a3f7127daa Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-02-05 10:37:02 +01:00
Sven Woop 5ee9d990d2 quantizing space using chars, and bound using shorts 2018-02-05 10:31:49 +01:00
Sven Woop cf4ca51ff3 optimization to quantized oriented bounds 2018-02-05 10:27:36 +01:00
Sven Woop bbef3524b7 bugfix in quantized oriented bounds 2018-02-05 10:13:16 +01:00
Sven Woop f0b8c2ae3c added load(short*) 2018-02-05 09:31:18 +01:00
Sven Woop 377bd43f62 hair mode switchable in cmake 2018-02-05 09:07:33 +01:00
Sven Woop 3d978c2533 bugfix in quantized oriented bounds, works now 2018-02-05 08:49:42 +01:00
Sven Woop 7e38763b9d bugfix in quantized oriented bounds 2018-02-05 08:44:57 +01:00
cbenthin 52fcf0fb50 updates 2018-02-02 20:48:24 +01:00
cbenthin 705cbbf1ea skx fix 2018-02-02 19:51:34 +01:00
cbenthin 66cf27a194 fixes 2018-02-02 17:14:26 +01:00
cbenthin 34635bb93f compile fix 2018-02-02 17:08:58 +01:00
cbenthin 3fb3956d36 trying to make clang 4 happier 2018-02-02 16:51:40 +01:00
cbenthin dbcc322748 new SSE only sorting for >= 3hits, avoids LSF issues and gives ~2% more performance for protoray 2018-02-02 16:01:47 +01:00
cbenthin 364e40d662 first steps in supporting a special grid primitive 2018-02-01 17:44:57 +01:00
cbenthin c12f244dd0 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2018-02-01 13:37:04 +01:00
Sven Woop 7ac7c072dd updates 2018-02-01 09:38:59 +01:00
Sven Woop ae236f540a updates 2018-02-01 08:08:57 +01:00
Sven Woop b2c6b87e1f optimization 2018-01-31 13:26:35 +01:00
Sven Woop e63e83f445 implemented aligned space per hair inside leaf for benchmarking 2018-01-31 13:11:29 +01:00
Sven Woop 340334d437 optimization, using mini/maxi 2018-01-31 12:06:45 +01:00
Sven Woop 1ce8793725 updates 2018-01-31 12:02:26 +01:00
Sven Woop 0d5ff3b6ad bugfix 2018-01-31 11:55:51 +01:00
Sven Woop 802900582b large compressed leaves partially working for curves 2018-01-31 11:46:58 +01:00
Sven Woop 27067adc7e first attempt to add large compressed leaves for curves, not working yet 2018-01-31 11:08:49 +01:00
Sven Woop e6b534cf38 added leaf visualization debug mode 2018-01-31 08:52:44 +01:00
Sven Woop b38e4c9a39 veryfing itemCount input to rtcSetBuffer API functions 2018-01-31 07:53:12 +01:00
Sven Woop a268ff35a2 setting version to 3.0.0 2018-01-31 07:32:40 +01:00
Sven Woop 896bc79f76 cleanups 2018-01-30 13:05:57 +01:00
Sven Woop 84c9378736 cleanups 2018-01-30 13:00:18 +01:00
Sven Woop d20d27822a cleanups 2018-01-30 12:56:38 +01:00
Sven Woop eb632f9024 cleanups 2018-01-30 12:51:40 +01:00
Sven Woop a5cfcc51ed increased accuracy 2018-01-30 10:00:33 +01:00
Sven Woop a975d98fce cleanups 2018-01-30 09:35:12 +01:00
Sven Woop d13611aac0 performance optimization 2018-01-30 09:26:07 +01:00
Sven Woop 7c4ca53e91 cleanups 2018-01-30 09:23:14 +01:00
Sven Woop 4624415cec cleanups 2018-01-30 09:20:03 +01:00
Sven Woop 139f16fb4c cleanups 2018-01-30 09:14:09 +01:00
Sven Woop e352b1cfa3 cleanups 2018-01-30 09:12:16 +01:00
Sven Woop fb99034bb0 cleanups 2018-01-30 09:03:03 +01:00
Sven Woop 7febca9db2 cleanups 2018-01-30 08:52:46 +01:00
Sven Woop b8e95a78d7 cleanups 2018-01-30 08:47:07 +01:00
Sven Woop 314d353e20 cleanups 2018-01-30 08:44:22 +01:00
Sven Woop cbdfc6a670 cleanups 2018-01-30 08:35:04 +01:00
Sven Woop 5861da9c86 experiments with speeding up ray space transformation 2018-01-30 08:26:41 +01:00
Sven Woop fe19b2c9a5 updates 2018-01-29 11:10:31 +01:00
Sven Woop 2aef720354 more debug curves 2018-01-29 10:50:58 +01:00
Sven Woop 874453ba20 more debug curves 2018-01-29 10:41:21 +01:00
Sven Woop 6da6cb83dc fixed construction of linear-cubic-bezier patch from normals 2018-01-29 10:02:42 +01:00
Sven Woop c6c700bfcc fixes to buffer handling in embree2_to_embree3.patch 2018-01-29 07:47:43 +01:00
Sven Woop 7a7769c3f4 added more models 2018-01-26 12:00:34 +01:00
Sven Woop 9b781924aa added more models 2018-01-26 11:54:04 +01:00
Sven Woop e3075b8667 added more models 2018-01-26 11:51:55 +01:00
Sven Woop 2a1f478235 added more models 2018-01-26 11:39:48 +01:00
Sven Woop 5ba0c8a6d6 added more models, shadow rays work now 2018-01-26 11:34:47 +01:00
Sven Woop 593c39969b optimization to eval_dt 2018-01-26 11:08:50 +01:00
Sven Woop 730e8fcf13 using more fmadds 2018-01-26 11:02:47 +01:00
Sven Woop f0d1f978a7 optimizations 2018-01-26 10:54:04 +01:00
Sven Woop 89c7b1ff08 optimization to bezier clipping, some normalizations are not required 2018-01-26 10:00:29 +01:00
Sven Woop 11c7304080 improved usage of SSE 2018-01-26 09:42:36 +01:00
Sven Woop d9326a8f2b SSE compile fix 2018-01-26 07:15:33 +01:00
Sven Woop d544d3e619 updates 2018-01-25 14:11:01 +01:00
Sven Woop 7899aeb2d2 performance optimizations 2018-01-25 13:59:31 +01:00
Sven Woop 6b3e4c49a4 cleanups 2018-01-25 13:52:08 +01:00
Sven Woop 7a6cc4b5f5 improved convergence criterium 2018-01-25 13:50:27 +01:00
Sven Woop 2f7de7ad0b improved convergence criterium 2018-01-25 13:48:52 +01:00
Sven Woop fb7618391b updates 2018-01-25 13:45:48 +01:00
Sven Woop e318a493a4 optimizations 2018-01-25 13:42:56 +01:00
Sven Woop b7b7e7cf50 updates 2018-01-25 13:01:06 +01:00
Sven Woop 03e5800c12 added rtcSetDeviceProperty again, we need this to use our internal debug variables 2018-01-25 12:56:03 +01:00
Sven Woop 30d6a6abfe updates 2018-01-25 12:33:05 +01:00
Sven Woop 482ffd7c78 updates 2018-01-25 12:31:18 +01:00
Sven Woop 08af060f8a performing v-clipping late 2018-01-25 12:24:40 +01:00
Sven Woop a967d4d605 using SIMD v clipping 2018-01-25 12:02:10 +01:00
Sven Woop 53ef3c7cc7 clipping curve at different places 2018-01-25 11:52:40 +01:00
Sven Woop 4a6bfa9581 avoiding clipping v to narrow 2018-01-25 11:10:11 +01:00
Sven Woop 0b659aa023 proper eps test 2018-01-25 11:03:32 +01:00
Sven Woop d82c4ac9e6 updates 2018-01-25 10:18:52 +01:00
Sven Woop df9f1fdd55 using vec2fa 2018-01-25 09:49:35 +01:00
Sven Woop fe00bf6e86 added vec2fa class 2018-01-25 09:14:44 +01:00
Sven Woop 9008f8c9fe optimization 2018-01-25 08:56:20 +01:00
Sven Woop 96a189bb09 optimization 2018-01-25 08:51:27 +01:00
Sven Woop c80851b18e optimization 2018-01-25 07:56:43 +01:00
Sven Woop 96ee37d752 updates 2018-01-24 14:51:40 +01:00
Sven Woop db9a6c1f6d updates 2018-01-24 14:41:06 +01:00
Sven Woop 316de473a5 updates 2018-01-24 14:34:00 +01:00
Sven Woop fe87e5e055 cleanups 2018-01-24 14:29:28 +01:00
Sven Woop cdbfbd3ca4 bugfix 2018-01-24 14:27:44 +01:00
Sven Woop 19d13bfbf7 more accurate curve subdivision 2018-01-24 14:15:03 +01:00
Sven Woop 7fc029700a added counters 2018-01-24 12:14:12 +01:00
Sven Woop af3f34e9c5 updates 2018-01-24 11:38:07 +01:00
Sven Woop 964eab5cc1 better ray/curve test 2018-01-24 11:30:58 +01:00
Sven Woop d9f48578e2 preparations to do SIMD v clipping 2018-01-24 11:22:33 +01:00
Sven Woop 3df2c05b92 performance improvements to newton raphson solver 2018-01-24 10:20:46 +01:00
Sven Woop 99e6fa4229 fixes for lerp implementation 2018-01-24 10:17:00 +01:00
Sven Woop 0d8dc89ae5 started using SIMD in subdivision 2018-01-24 10:09:38 +01:00
Sven Woop cebff8cd91 updated readme.md 2018-01-24 07:41:28 +01:00
Sven Woop ae0cec29f3 fixed GCC compile warning in debug mode 2018-01-24 07:08:25 +01:00
Sven Woop 039cd65ff7 cleanups 2018-01-23 12:02:13 +01:00
Sven Woop 0559a4e77a cleanups 2018-01-23 11:54:51 +01:00
Sven Woop dd217ebbe6 cleanups 2018-01-23 11:43:19 +01:00
Sven Woop cd4a8bda84 cleanups 2018-01-23 11:28:35 +01:00
Sven Woop ea6233c5ac cleanups 2018-01-23 11:25:52 +01:00
Sven Woop 06389bb231 cleanups 2018-01-23 11:14:15 +01:00
Sven Woop e1c7b35b64 cleanups 2018-01-23 11:11:07 +01:00
Sven Woop 5dbd5a2cda cleanups 2018-01-23 10:54:38 +01:00
Sven Woop 350d25e339 moved interval arithmetic to separate file 2018-01-23 10:50:16 +01:00
Sven Woop fe461b76b6 cleanups 2018-01-23 10:46:50 +01:00
Sven Woop a73e620f6d moved u/v out of bezier curves 2018-01-23 10:25:18 +01:00
Sven Woop 4ffdfeeb47 cleanups 2018-01-23 09:53:58 +01:00
Sven Woop efe16daf64 optimizations 2018-01-23 09:40:17 +01:00
Sven Woop 6b40d73da9 cleanups 2018-01-23 09:34:51 +01:00
Sven Woop a60b77f898 krawcyk test works 2018-01-23 09:33:27 +01:00
Sven Woop a1421977bf krawcyk operator starts to work 2018-01-23 09:23:15 +01:00
Sven Woop 6bdf3d812a first version of krawcyk operator, still buggy 2018-01-23 08:04:32 +01:00
Sven Woop a4544ed736 Merge branch 'release' into devel 2018-01-23 07:08:03 +01:00
Sven Woop dfa3025a1c fixed fix to get MSI package build properly 2018-01-22 15:59:47 +01:00
Sven Woop 63b01eae42 fix to get MSI package build properly 2018-01-22 14:51:06 +01:00
atafra 522603677d replaced some 'unsigned' types with 'unsigned int' in the API 2018-01-22 15:26:08 +02:00
atafra 2a581780ce minor function param name update 2018-01-22 15:20:47 +02:00
Sven Woop 5739deccb4 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-22 11:26:50 +01:00
Sven Woop 2cb9ab860f compile fix 2018-01-22 11:26:44 +01:00
Sven Woop 014f4ca608 updated documentation 2018-01-22 11:22:44 +01:00
Sven Woop 9dbe2f1176 removed man pages temporarily 2018-01-22 11:20:36 +01:00
Sven Woop 33a5818523 klocwork fixes 2018-01-22 11:12:44 +01:00
Sven Woop ca872a5a68 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-22 11:11:48 +01:00
Sven Woop 863ad27d0f fixed klocwork issues 2018-01-22 11:11:41 +01:00
cbenthin bfe6fbed41 more kw fixes 2018-01-22 11:07:36 +01:00
cbenthin 30373f6a85 more klockwork fixes 2018-01-22 11:03:02 +01:00
cbenthin 3e8b4ab9b8 klockwork fixes 2018-01-22 10:49:45 +01:00
Sven Woop 4e7caa01e7 using interval class 2018-01-22 10:08:04 +01:00
Sven Woop c9273cf95b adding interval class 2018-01-22 09:40:38 +01:00
Sven Woop 0d23be8c66 setting version to 3.0.0-beta.0 2018-01-22 09:30:24 +01:00
Sven Woop 77949c31c3 RTCDisplacementFunctionN in embree2_to_embree3 script 2018-01-22 09:29:41 +01:00
atafra 141c8151dc fixed minor inconsistencies 2018-01-20 16:39:32 +02:00
atafra 4755371c42 minor comment fix 2018-01-20 16:08:11 +02:00
atafra f3b956391e minor comment cleanups 2018-01-20 13:38:35 +02:00
atafra d59b0e1b80 renamed RTCDisplacementFunction to RTCDisplacementFunctionN to fix inconsistency 2018-01-19 20:16:11 +02:00
atafra 0838a1e87c minor comment fixes and cleanups 2018-01-19 19:07:00 +02:00
atafra 4c48aabc07 fixed bug in ISPC ray layout 2018-01-19 18:58:34 +02:00
Sven Woop 8bbd45596c experiments 2018-01-19 14:19:01 +01:00
Sven Woop d4917407db updates 2018-01-19 14:01:27 +01:00
Sven Woop 5018e869d4 improvements to newton raphson solver 2018-01-19 13:53:05 +01:00
Sven Woop 57fa54b2d6 added newton raphton solver for normal oriented curves 2018-01-19 13:37:30 +01:00
Sven Woop 7dcee492fd calculating oriented curve from center curve and normals 2018-01-19 12:04:19 +01:00
Sven Woop 9095ebe2dc updates 2018-01-19 11:52:49 +01:00
Sven Woop 7be07069ab updates 2018-01-19 11:43:15 +01:00
Sven Woop 59078e1a1d updates 2018-01-19 11:15:03 +01:00
Sven Woop b90601d6d9 updates 2018-01-19 10:57:00 +01:00
Sven Woop 0dba2e8fce updates 2018-01-19 09:33:52 +01:00
cbenthin 12d6ba4bac sync with devel 2018-01-19 09:20:00 +01:00
cbenthin d4226e08dc sync 2018-01-19 09:16:02 +01:00
cbenthin 4c99ef4b64 Merge remote-tracking branch 'origin/devel' into cbenthin 2018-01-19 09:12:36 +01:00
Sven Woop ecc611b035 removed no longer required EMBREE_FILTER_FUNCTION_CONTEXT define 2018-01-19 08:35:58 +01:00
Sven Woop a380490f7b small optimization in intersection filter invokation 2018-01-19 07:19:46 +01:00
atafra 64dc2511dc minor comment update 2018-01-18 23:17:10 +02:00
atafra 8bc2d19a67 Merge remote-tracking branch 'origin/devel' into devel 2018-01-18 22:53:37 +02:00
atafra de58be88cd minor comment updates (maximal -> maximum, minimal -> minimum) 2018-01-18 22:52:43 +02:00
cbenthin 7bce4bb49e fixes for instancing 2018-01-18 19:45:33 +01:00
cbenthin 3180d98a23 fix permissions 2018-01-18 18:49:18 +01:00
cbenthin a15cbae149 minor fixes to make MSVC happy 2018-01-18 09:47:49 -08:00
cbenthin 7c99eedf22 fix due to ray layout change 2018-01-18 18:31:38 +01:00
cbenthin 7eea211e4c switch tfar and time in ray layout 2018-01-18 18:12:31 +01:00
Sven Woop 7b43a9c2e9 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-18 16:37:58 +01:00
Sven Woop 55bff1d137 small optimization in intersection filter invokation 2018-01-18 16:33:16 +01:00
cbenthin 0001c3774b Revert "fixes to address LSF issues due to the new ray layout"
This reverts commit 9f893e8e7b.
2018-01-18 16:28:09 +01:00
atafra 0d6e5a6aa0 minor comment fixes 2018-01-18 17:00:52 +02:00
cbenthin 9f893e8e7b fixes to address LSF issues due to the new ray layout 2018-01-18 11:02:37 +01:00
Sven Woop b78beb012e bugfix in oriented curve transformation 2018-01-18 09:58:31 +01:00
Sven Woop 26d28c6b5f bugfix in normal oriented curve loader 2018-01-18 09:40:48 +01:00
Sven Woop 2f4940f6c5 bugfix 2018-01-18 09:32:19 +01:00
Sven Woop 32af9b706b bugfix in loading of normal oriented curves 2018-01-18 09:25:20 +01:00
Sven Woop a58ff96a17 first version of normal oriented curve intersector compiles 2018-01-18 09:10:08 +01:00
Sven Woop 8830c796cd added empty OrientedBezierCurve1Intersector1 2018-01-18 08:22:26 +01:00
Sven Woop 84ac353972 introducing normal oriented curve 2018-01-18 08:03:11 +01:00
Sven Woop e615a6135f adding support to load normal oriented curves 2018-01-18 07:32:37 +01:00
Sven Woop fdc6708e6d bugfix for package generation under Linux (2) 2018-01-17 17:41:41 +01:00
Sven Woop 107e74850d bugfix for package generation under Linux 2018-01-17 15:52:55 +01:00
Sven Woop 566093d00a changing default handedness to right-handed 2018-01-17 10:30:11 +01:00
Sven Woop 7033779d80 Improved fix for issue that causes hair builder to be non-deterministic. 2018-01-17 10:27:52 +01:00
Sven Woop cfbfe736b5 Activating strand split only for less than 256 primitives. After this change
BVH is almost identical. Disabling parallel code in strand split.
2018-01-17 10:27:40 +01:00
atafra b651a2dbc1 minor API cleanups 2018-01-17 02:38:24 +02:00
atafra 85ab6f2633 updated embree2_to_embree3.patch 2018-01-17 02:10:23 +02:00
atafra ed5a087254 minor API naming changes 2018-01-17 02:05:00 +02:00
atafra 37275c61ae Merge remote-tracking branch 'origin/devel' into devel 2018-01-17 00:29:02 +02:00
atafra 147938a109 fixed minor inconsistencies and bugs in the API 2018-01-17 00:27:09 +02:00
Johannes Günther dd0ed9604b Update missing files to copyright year 2018 2018-01-16 10:15:46 +01:00
Sven Woop a41882c570 bugfix in embree2_to_embree3 2018-01-15 09:03:41 +01:00
Sven Woop 3b7f31e6b3 bugfix in embree2_to_embree3 2018-01-15 09:00:54 +01:00
Sven Woop d434fd4805 bugfix in embree2_to_embree3 2018-01-15 08:36:38 +01:00
Sven Woop 86b1f37874 bugfix in embree2_to_embree3 2018-01-15 08:33:27 +01:00
Sven Woop 7bb52f9599 bugfix in embree2_to_embree3 2018-01-15 08:24:21 +01:00
Sven Woop 69d5c11d84 FIXME -> EMBREE_FIXME in embree2_to_embree3 2018-01-15 07:57:11 +01:00
Johannes Günther 6c53df3409 CMake prior v3.7 does not support %a %b for TIMESTAMP 2018-01-12 14:46:13 +01:00
Sven Woop e8b6184377 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-12 11:37:56 +01:00
Sven Woop 679a5c7d33 cleanups to user_geometry tutorial 2018-01-12 11:29:51 +01:00
Sven Woop 674ed2ef63 removed t argument from rtcCopyXXX helper functions 2018-01-12 11:21:53 +01:00
cbenthin ca059afb31 merged devel into rayhit2 2018-01-12 11:04:46 +01:00
cbenthin 922fbcc300 fixed hit writing order in intersector epilog 2018-01-12 09:24:12 +01:00
cbenthin bb38ebec05 fixed order when writing hit data in ray.h 2018-01-12 09:17:16 +01:00
Sven Woop 84796020bf improved naming of RTCBuildArguments members 2018-01-12 08:20:39 +01:00
atafra 9c8fe1b445 fixed compile error 2018-01-12 00:30:06 +02:00
atafra 63773130f9 rayhit updates for subdivs 2018-01-12 00:04:06 +02:00
atafra 18d06c5b4b cleanups 2018-01-11 23:07:19 +02:00
atafra ce2406572a rayhit update for curves 2018-01-11 21:42:42 +02:00
atafra 5dfa235aa2 cleanups 2018-01-11 21:18:31 +02:00
atafra 46ddea3c1f rayhit update for quads 2018-01-11 21:13:46 +02:00
atafra a5922f66ec stream filters use RayK for occlusion 2018-01-11 20:51:37 +02:00
atafra 225fa580b1 removed unused code 2018-01-11 16:18:57 +02:00
Sven Woop e3010ba7c8 added RTCRayHitN_RayN and RTCRayHitN_HitN helper functions 2018-01-11 14:29:04 +01:00
Sven Woop 1c5e8306a0 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-11 13:37:41 +01:00
Sven Woop 5f1e98d071 regenerating tutorials 2018-01-11 13:37:24 +01:00
Sven Woop 43d2419380 fixed ISPC compile errors 2018-01-11 13:36:19 +01:00
Sven Woop 75d8dc54d3 changed copyright to 2018 2018-01-11 13:06:15 +01:00
Sven Woop cc54da1e27 removed const from API arguments 2018-01-11 12:48:14 +01:00
atafra a020a0c62d separate intersect/occluded stream filter funcs 2018-01-11 13:29:13 +02:00
Sven Woop 78e3c94220 added comments to rtcInterpolate0/1/2 functions 2018-01-11 12:16:40 +01:00
Sven Woop 24c53086ea extraSpace -> size_t 2018-01-11 12:10:42 +01:00
Sven Woop 8757dfdc80 loading geom for displacement conversion in embree2_to_embree3 script 2018-01-11 11:57:14 +01:00
Sven Woop bd66e40784 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-11 11:53:57 +01:00
Sven Woop f73f275ee6 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-11 11:53:28 +01:00
Sven Woop 2eb4981a32 Merge branch 'devel' of gitlab.com:embree/embree into devel 2018-01-11 11:51:58 +01:00
Sven Woop 0ea1ecb882 removed debug print from bvh_intersector_stream_filters, this caused crash of nightly testing by likely triggering an ICC compiler bug 2018-01-11 11:50:24 +01:00
cbenthin 38a7e1567d added rtcInterpolate (scalar) version to ispc header file 2018-01-11 11:34:13 +01:00
cbenthin a6947454b6 RTCIntersectContext instID -> instID[RTC_MAX_INSTANCE_LEVEL_COUNT] 2018-01-11 11:23:41 +01:00
cbenthin dfd984a0e1 numXXX -> XXXCount for builder API 2018-01-11 11:09:30 +01:00
cbenthin b4112c1bd5 rtcInterpolate0/1/2 -> rtcInterpolateV0/1/2 for ispc 2018-01-11 10:55:53 +01:00
cbenthin 4d240bda6a func -> progress 2018-01-11 10:48:46 +01:00
cbenthin daaa81f24d func -> filter, func -> displacement 2018-01-11 10:42:15 +01:00
cbenthin 8d42e8ca71 geometry to geom for displacement fct 2018-01-11 10:36:03 +01:00
Sven Woop dc8ade44b7 RTCBuildSettings to RTCBuildArguments in embree2_to_embree3 script 2018-01-11 09:50:17 +01:00
Sven Woop a054ce9aae fixes to embree2_to_embree3 script 2018-01-11 09:48:41 +01:00
Sven Woop 743766b0cf potentialHit->hit and ray->rayhit in embree2_to_embree3 conversion 2018-01-11 09:46:48 +01:00
Sven Woop 98726feae5 rtcIntersectV support in embree2_to_embree3 conversion 2018-01-11 09:43:02 +01:00
Sven Woop ee6cff4539 restored order of rtcIntersect4/8/16 in rtcore_scene.isph 2018-01-11 09:18:05 +01:00
atafra 94f7c4b61a getRayBy* in ray stream helpers return RayK instead of RayHitK 2018-01-11 02:15:10 +02:00
atafra dbef78ccaf added RTCRayHitNt 2018-01-11 01:11:28 +02:00
atafra fb92ccb22b fixed compile errors 2018-01-11 01:11:20 +02:00
atafra 1b42b4dd73 RayK constructor initializes only what's necessary 2018-01-11 00:39:01 +02:00
atafra 10cdba077b fix in RayStreamSOA 2018-01-11 00:32:33 +02:00
atafra f90e61d322 removed unusued code 2018-01-10 23:21:33 +02:00
atafra ca2f36c73a stream kernel uses RayK instead of RayHitK for occlusion (but filters still use RayHitK) 2018-01-10 19:00:48 +02:00
atafra e3fc1604c5 stream helpers don't read instID anymore 2018-01-10 18:28:31 +02:00
cbenthin c3e4319536 sflags -> flags, potentialHit -> hit 2018-01-10 17:00:04 +01:00
cbenthin 5de3fcf698 RTC_MAX_INSTANCE_LEVELS to RTC_MAX_INSTANCE_LEVEL_COUNT 2018-01-10 16:38:44 +01:00
cbenthin 2ed6c496e2 renamed RTCBuildSettings to RTCBuildArguments, *IDs in RTCBuildPrimitive now unsigned int 2018-01-10 16:32:02 +01:00
cbenthin 686cb79232 unsigned -> unsigned int in rtcore_ray.h, just for consistency 2018-01-10 16:20:04 +01:00
cbenthin 34fd8a391a removed SW cache and rtcSetDeviceProperty 2018-01-10 16:09:38 +01:00
cbenthin 641e4db9aa RTCIntersectFunctionNArguments RTRay to RTCRayHit 2018-01-10 15:59:28 +01:00
cbenthin 6f7e24724a ray -> rayhit, stride -> byteStride, the rayhit->ray transformation is coming from the rayhit2 branch 2018-01-10 15:28:29 +01:00
cbenthin 61f1a7edd5 itemCount is now size_t 2018-01-10 15:07:30 +01:00
cbenthin 73c9b3136f renamed ISPC versions of rtcIntersect/rtcOccluded to rtcIntersectV/rtcOccludedV 2018-01-10 14:52:47 +01:00
atafra 7b439d136c cleanup 2018-01-10 14:54:15 +02:00
atafra f303e85847 switched from internal RayHit to Ray for occlusion (for triangles only, TODO the rest) 2018-01-10 02:07:04 +02:00
atafra 47f08e143b separated RayK into RayK and RayHitK 2018-01-10 01:32:57 +02:00
cbenthin bb1a989705 rtcOccluded* now only take RTCRay* as argument, however, internal seperation for occluded fcts is very hard to do, also all stream occluded calls are currently broken 2018-01-09 11:56:04 +01:00
cbenthin add770d0bc Merge remote-tracking branch 'origin/rayhit2' into devel 2018-01-09 09:19:21 +01:00
atafra 6f4c6e1077 RTCFormat updates 2017-12-28 20:46:07 +02:00
cbenthin 62dec7ade5 lots of compile fixes 2017-12-22 15:51:09 +01:00
cbenthin 454d82b168 introduced RTCRayHit, adapted all API and first kernel layers (touched lots of code), rtcIntersect/rtcOccluded still take both a RTCRayHit as input 2017-12-22 15:09:28 +01:00
cbenthin bed4c59047 Merge remote-tracking branch 'origin/rayhit2' into devel 2017-12-21 20:48:24 +01:00
cbenthin eca7ed247a fixed user_geometry + AOS streams..stupid copy & paste bug...arghh 2017-12-21 20:38:19 +01:00
cbenthin 0ac09a61c7 still trying to track down nasty AOS occlusion stream bug 2017-12-21 19:26:03 +01:00
cbenthin a8b9f4b485 updates 2017-12-21 12:45:30 +01:00
cbenthin 1b72852850 fixes for streams in user_geometry_ispc 2017-12-21 12:43:00 +01:00
Sven Woop 13d0bae95d updating embree2_to_embree3 with RTCRayHit/RTCRay 2017-12-21 12:38:41 +01:00
Sven Woop 73d88fc8c4 reporting error if too many geometries are attached to a scene 2017-12-21 12:24:41 +01:00
cbenthin 38b9bb3b4f fixes for user_geometry tutorial 2017-12-21 10:29:34 +01:00
Sven Woop 088ae6f9b3 updated embree2_to_embree3, RTCORE_VERSION_XXX -. RTC_VERSION_XXX 2017-12-21 10:09:40 +01:00
cbenthin f3945b460c Merge branch 'rayhit2' of https://gitlab.com/embree/embree into rayhit2 2017-12-21 09:50:10 +01:00
cbenthin d76b4246c4 small fix 2017-12-21 09:50:02 +01:00
atafra a69f5a75bb minor ray.h fixes and cleanups 2017-12-21 01:55:02 +02:00
cbenthin 08c43aeeb2 updates 2017-12-20 17:03:05 +01:00
cbenthin f19da5ae0b first attempt of removing t from hit, and adapting all dependencies 2017-12-20 16:13:43 +01:00
cbenthin 374a8c8598 Merge remote-tracking branch 'origin/rayhit2' into devel 2017-12-20 11:31:58 +01:00
cbenthin 9a12ac05af fixes for motion_blur_geometry 2017-12-20 11:16:00 +01:00
cbenthin 6b54884ef0 fixed user_geometry tutorial 2017-12-20 10:54:15 +01:00
cbenthin b4ee736628 fixes for instanced geometry 2017-12-20 10:32:22 +01:00
Sven Woop e159fd3c38 fixes to verify 2017-12-20 08:38:43 +01:00
cbenthin 933b3db736 fixes and temporarily disabled direct occluded instance callbacks in user_geometry, does not work for unknown reasons but stream version does 2017-12-19 19:00:43 +01:00
cbenthin 41fa14e78b tutorials working except user_geometry 2017-12-19 18:27:48 +01:00
cbenthin a5ead912de verify runs through 2017-12-19 18:06:46 +01:00
cbenthin 1154fffc72 starting to change return semantics for occluded calls, return tfar = neg_inf in case of occlusion 2017-12-19 17:33:30 +01:00
Sven Woop 067a1bff40 commented out special tutorial-only rules in embree2_to_embree3.patch 2017-12-19 06:48:24 +01:00
Sven Woop 078b741009 pathtracer fix for zero ray.Ng for curves 2017-12-19 06:46:46 +01:00
Sven Woop f04b6e7efd returning zero tangent from hair and ribbon intersector 2017-12-18 14:43:03 +01:00
Sven Woop 2b8b2cf1cc Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-12-18 14:33:12 +01:00
Sven Woop f1fddf2daa bugfix in SSE fallback for rtcIntersect8 2017-12-18 14:33:01 +01:00
cbenthin 1d7930cbf0 replaced RTCORE with RTC 2017-12-18 14:24:28 +01:00
cbenthin 1c4be29d4e renamed RTCORE* to RTC* 2017-12-18 13:10:44 +01:00
Sven Woop ff2f72d5b0 updates to embree2_to_embree3 2017-12-18 10:54:27 +01:00
Sven Woop 8ddd646ba1 fix to embree2_to_embree3 script 2017-12-18 10:46:48 +01:00
atafra 44c94796e3 renamed RTC_DEVICE_PROPERTY_INTERSECT_STREAM_SUPPORTED to RTC_DEVICE_PROPERTY_RAY_STREAM_SUPPORTED 2017-12-15 23:46:19 +02:00
atafra cf36bc925c cleanup 2017-12-15 20:54:39 +02:00
atafra 91d2a537a2 ray helper function cleanups 2017-12-15 20:50:21 +02:00
atafra 875aca1121 renamed RTC_GEOMETRY_TYPE_LINEAR_CURVE to RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE 2017-12-15 19:13:03 +02:00
atafra d2c0a493b2 Merge remote-tracking branch 'origin/devel' into devel 2017-12-15 19:08:22 +02:00
atafra 9669bd9b71 API enum cleanups 2017-12-15 19:07:32 +02:00
Sven Woop c56b1c7b7b Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-12-15 14:08:17 +01:00
Sven Woop 77ce96e18b updates to embree2_to_embree3.patch 2017-12-15 14:04:13 +01:00
Sven Woop f428cf8b5a updates to embree2_to_embree3.patch 2017-12-15 13:32:46 +01:00
Sven Woop 9e64621779 updates to embree2_to_embree3.patch 2017-12-15 13:19:44 +01:00
Sven Woop b2fd7dc248 updates to embree2_to_embree3.patch 2017-12-15 13:11:37 +01:00
Sven Woop 5a5e66235b updates to embree2_to_embree3.patch 2017-12-15 12:44:42 +01:00
Sven Woop 11b0a30569 updates to embree2_to_embree3.patch 2017-12-15 12:31:55 +01:00
Sven Woop e620816198 updates to embree2_to_embree3.patch 2017-12-15 12:24:58 +01:00
Sven Woop 2f4ae13ec3 updates to embree2_to_embree3.patch 2017-12-15 12:10:50 +01:00
Sven Woop 9e4a0c1f67 updates to embree2_to_embree3.patch 2017-12-15 12:01:47 +01:00
cbenthin 33bda91c97 copyRTC* to rtcCopyRTC* 2017-12-15 11:55:53 +01:00
Sven Woop 4c779708a6 updates to embree2_to_embree3.patch 2017-12-15 11:12:48 +01:00
Sven Woop c1e563f326 updates to embree2_to_embree3.patch 2017-12-15 11:01:45 +01:00
Sven Woop 61794449bc updates to embree2_to_embree3.patch 2017-12-15 10:58:15 +01:00
Sven Woop 2b137a9137 updates to embree2_to_embree3.patch 2017-12-15 10:54:59 +01:00
Sven Woop 63ed1888dd updates to embree2_to_embree3.patch 2017-12-15 10:43:41 +01:00
Sven Woop f1cb1598ea updates to embree2_to_embree3.patch 2017-12-15 10:19:55 +01:00
Sven Woop 20b5fe0787 unsigned / unsigned int fix in cpp-patch.py 2017-12-15 10:10:30 +01:00
Sven Woop eeb1bbb9f1 updates to embree2_to_embree3.patch 2017-12-15 09:53:15 +01:00
Sven Woop bbd17d5de4 updates to embree2_to_embree3.patch 2017-12-15 09:33:49 +01:00
Sven Woop 412ae415ae updates to embree2_to_embree3.patch 2017-12-15 08:48:40 +01:00
Sven Woop 40b7e9b00e inline -> RTC_FORCEINLINE 2017-12-15 08:02:20 +01:00
Sven Woop ac883fdc28 ordering API calls 2017-12-15 07:59:54 +01:00
Sven Woop 08bd3e98b8 improved parsing of unsigned/unsigned int in cpp-patch.py 2017-12-15 07:29:42 +01:00
Sven Woop 48575730e3 updates to embree2_to_embree.patch, merging type and subtype 2017-12-15 07:15:21 +01:00
atafra d191d02641 merged geometry subtype into type 2017-12-15 00:59:52 +02:00
atafra c69a18498f minor instance implementation cleanup 2017-12-14 22:06:14 +02:00
atafra ff740d523b fixed inconsistent parameter order of rtcSetGeometryTransform 2017-12-14 21:21:05 +02:00
Sven Woop 05c4b95cb0 enabling EMBREE_FILTER_FUNCTION_CONTEXT by default, causes no performance regression 2017-12-14 15:05:27 +01:00
Sven Woop adef36b214 renamed SURFACE/RIBBON subtype to ROUND/FLAT following RenderMan naming convention 2017-12-14 14:53:59 +01:00
Sven Woop 07cf3a6b66 removed rtcMakeStaticBVH and added RTC_BUILD_FLAG_DYNAMIC instead 2017-12-14 14:46:01 +01:00
Sven Woop 4af6019bef changed some size_t and ssize_t usages of tutorials to int and unsigned int 2017-12-14 14:34:11 +01:00
Sven Woop fecc012404 fix in ispc2cpp.sh 2017-12-14 14:22:45 +01:00
Sven Woop 566a96bb8d using intptr_t and uintptr_t types in ISPC API headers 2017-12-14 14:18:37 +01:00
Sven Woop a2a1675588 removed __RTC from API headers 2017-12-14 14:08:27 +01:00
Sven Woop 4abe43dc66 one line comments in API headers 2017-12-14 12:20:13 +01:00
Sven Woop cc3bdc30be removed Doxygen comments from Embree API headers 2017-12-14 10:17:53 +01:00
Sven Woop 4294978f62 removed rtcNewInstance API call 2017-12-14 10:05:01 +01:00
Sven Woop 81b00eae85 added rtcSetGeometryInstancedScene function, supporting rtcSetGeometryTimeStepCount for instances 2017-12-14 09:21:18 +01:00
Sven Woop e5b613026f replacing local2world array by pointer to array in Instance class 2017-12-14 08:56:40 +01:00
Sven Woop b43300b673 converting RTCMatrixType to RTCFormat in embree2_to_embree3.patch 2017-12-14 08:46:53 +01:00
atafra 2f0e0b13dc use RTCFormat in rtcGetGeometryTransform too 2017-12-14 01:24:07 +02:00
atafra 3b55721c4b use RTCFormat for setting geometry transforms 2017-12-13 22:35:19 +02:00
Sven Woop 2045e6aa19 Merge branch 'swoop' into devel 2017-12-13 14:50:46 +01:00
cbenthin b4df94bf85 bugfix for ./intersection_filter --mode stream 2017-12-13 13:44:01 +01:00
Sven Woop 6216754fda Added rtcSetGeometryVertexAttributeCount and rtcSetGeometryTopologyCount functions. 2017-12-13 13:40:57 +01:00
Sven Woop 951605b942 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-12-13 11:36:57 +01:00
Sven Woop 84d60bb6eb supporting rtcIntersect8/16 also when AVX/AVX512 is not enabled, small performance regression, but assembly looks good 2017-12-13 11:36:49 +01:00
cbenthin 595f83a1ce regenerated *.cpp tutorials from ispc code 2017-12-13 10:57:17 +01:00
cbenthin ff7a836a59 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-12-13 10:49:33 +01:00
cbenthin 6abbe2a5a5 added RTC_MAX_INSTANCE_LEVELS and adapted ray and hit structures 2017-12-13 10:49:23 +01:00
Sven Woop c617cf46a8 Revert "fix for verify, 95447d4c4b commit is broken"
This reverts commit 9006f5e494.
2017-12-13 10:20:59 +01:00
Sven Woop 9006f5e494 fix for verify, 95447d4c4b commit is broken 2017-12-13 10:09:43 +01:00
Sven Woop 01700e59e6 added rtcGetGeometryTransform function 2017-12-13 09:05:37 +01:00
Sven Woop 502cd34c01 making test run when EMBREE_RAY_PACKETS is disabled 2017-12-13 08:47:51 +01:00
Sven Woop 95447d4c4b added RTC_DEVICE_PROPERTY_NATIVE_RAY16_SUPPORTED etc options, rtcIntersect/Occluded4/8/16 allways work 2017-12-13 08:14:32 +01:00
Sven Woop 718ac02070 rtcBuildBVH gets one struct as argument 2017-12-13 07:15:30 +01:00
atafra c538a4042b renamed some int "time" struct members to "timeStep" to be consistent and avoid confusion with float "time" 2017-12-13 00:51:56 +02:00
atafra 192c1dadd9 renamed some RTCDisplacementFunctionNArguments members to be consistent with other structs 2017-12-13 00:43:25 +02:00
atafra 09379a2a86 renamed RTCDisplacementFunctionArguments to RTCDisplacementFunctionNArguments to be consistent with other similar structs 2017-12-13 00:27:48 +02:00
atafra 78a657f055 more "num" cleanup 2017-12-13 00:22:56 +02:00
atafra 9a53813b9f renamed "num" to "count" in the API 2017-12-12 22:40:09 +02:00
cbenthin 2af797f8f7 renamed CURVE_* to *_CURVE 2017-12-12 16:01:14 +01:00
atafra a4069c3932 updated the format enum values 2017-12-12 14:39:14 +02:00
atafra 65fbcb1253 addded matrix format enums, enum initializers 2017-12-12 14:29:31 +02:00
Sven Woop e61d160489 compile fix 2017-12-12 12:52:34 +01:00
Sven Woop cfa2464ce9 checking slot argument of SubdivMesh::updateBuffer function 2017-12-12 12:47:44 +01:00
Sven Woop a03d5da4d4 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-12-12 12:41:02 +01:00
Sven Woop 6018715b06 refit also works when index buffer and number of primitives get changed 2017-12-12 12:40:40 +01:00
cbenthin 921b338b25 rtcCommitJoinScene => rtcJoinCommitScene in strings 2017-12-12 12:17:32 +01:00
Sven Woop 40b57ab867 removing lines and hair compile tests, adding curves compile test 2017-12-12 12:15:59 +01:00
cbenthin 0341bbd6de rtcCommitJoinScene => rtcJoinCommitScene 2017-12-12 12:14:19 +01:00
cbenthin 7c5c12b5d1 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-12-12 12:06:46 +01:00
cbenthin 0de4d645d8 RTC_DEVICE_PROPERTY_COMMIT_JOIN_SUPPORTED to RTC_DEVICE_PROPERTY_JOIN_COMMIT_SUPPORTED 2017-12-12 12:06:23 +01:00
Sven Woop 7a6713caad Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-12-12 10:59:59 +01:00
Sven Woop b838f6f93d Calling rtcUpdateGeometryBuffer required for each modified buffer.
Tracking modified buffers for each geometry type.
2017-12-12 10:58:29 +01:00
cbenthin a89bb87dcc EMBREE_GEOMETRY_LINES merged with EMBREE_GEOMETRY_CURVES 2017-12-12 10:14:35 +01:00
cbenthin 2d6cae8ecc EMBREE_GEOMETRY_HAIR => EMBREE_GEOMETRY_CURVES 2017-12-12 09:54:36 +01:00
Sven Woop 3a6f04fbbf fixes to embree2_to_embree3.patch 2017-12-12 09:54:00 +01:00
Sven Woop ac9a1e25f4 no longer infering number of time steps automatically 2017-12-12 09:51:59 +01:00
Sven Woop 25a4df668b added rtcRetainXXX API calls, properly reference counting RTCBVH object 2017-12-12 08:56:54 +01:00
Sven Woop e8bed0decd removed rtcAttachAndReleaseGeometry API call 2017-12-12 08:38:49 +01:00
Sven Woop e6c15c4caa buffer object properly reference counts device 2017-12-12 08:28:15 +01:00
Sven Woop cffe00183e removed rtcSetGeometrySubtype function and added subtype to rtcNewGeometry 2017-12-12 08:17:52 +01:00
atafra eacd477343 added missing buffer slot checks 2017-12-12 01:05:00 +02:00
atafra 67a9064a0b RTC_BUFFER_TYPE_CURVE_FLAGS renamed to RTC_BUFFER_TYPE_FLAGS 2017-12-12 00:58:44 +02:00
atafra 9a105d9b59 fixed bug in the tutorials 2017-12-12 00:53:06 +02:00
atafra 9f4d636df0 Merge remote-tracking branch 'origin/devel' into atafra/buffer
# Conflicts:
#	include/embree3/rtcore_geometry.h
#	include/embree3/rtcore_geometry.isph
#	kernels/common/rtcore.cpp
#	kernels/common/scene_bezier_curves.cpp
#	kernels/common/scene_bezier_curves.h
#	kernels/common/scene_line_segments.cpp
#	kernels/common/scene_line_segments.h
#	kernels/common/scene_quad_mesh.cpp
#	kernels/common/scene_subdiv_mesh.cpp
#	kernels/common/scene_triangle_mesh.cpp
#	tutorials/common/tutorial/scene_device.cpp
#	tutorials/dynamic_scene/dynamic_scene_device.cpp
#	tutorials/dynamic_scene/dynamic_scene_device.ispc
#	tutorials/interpolation/interpolation_device.cpp
#	tutorials/interpolation/interpolation_device.ispc
#	tutorials/verify/verify.cpp
#	tutorials/viewer_anim/viewer_anim_device.cpp
#	tutorials/viewer_anim/viewer_anim_device.ispc
2017-12-12 00:43:38 +02:00
atafra c6282fe972 updated all tutorials to use the new buffer API 2017-12-11 22:58:14 +02:00
cbenthin 760a128751 passing now RTCGeometry handle to displacement fct 2017-12-11 11:05:27 +01:00
Sven Woop 6fa4d53e66 toplevel builder properly re-creates object builder when geometry build quality changed 2017-12-11 09:47:34 +01:00
Sven Woop 466488b3ad bugfix in verify, refit build quality cannot resize geometries 2017-12-11 09:41:07 +01:00
Sven Woop bab6349a50 bugfix in regression_dynamic, scene was deleted before each commit, thus test was not very effective 2017-12-11 08:44:42 +01:00
Sven Woop a4a9bb5831 bugfix in rtcSetBuildQuality, scene and geometry modified flag was not set 2017-12-11 07:30:11 +01:00
Sven Woop e5685205ce throwing error if rtcCommitJoinScene is called with PPL tasking system 2017-12-11 07:23:37 +01:00
Sven Woop 4646a1feef added RTCLinearBounds type 2017-12-11 07:16:39 +01:00
Sven Woop d057c7734d fixed wrong buffer <= RTC_USER_VERTEX_BUFFER1 assertion in rtcInterpolate 2017-12-11 07:07:23 +01:00
Sven Woop cdfc68c324 removed rtcGetSceneBuildQuality API call 2017-12-11 07:00:04 +01:00
Sven Woop 304a9d238a Using 4-wide SIMD only for rtcInterpolate. Some codepaths have used
AVX (or AVX512) if lowest ISA was AVX (or AVX512).
2017-12-11 06:55:01 +01:00
Sven Woop 6fd6e8a1ad cleanups 2017-12-11 06:41:04 +01:00
Sven Woop bb434ca127 renamed item to primID in RTCBoundsFunctionArguments, RTCIntersectFunctionNArguments, and RTCOccludedFunctionNArguments 2017-12-11 06:40:25 +01:00
Sven Woop 8fb8f755aa removed rtcNewGeometryInstance and rtcNewGeometryGroup API calls 2017-12-11 06:27:38 +01:00
atafra 03b0dd03d6 RTCBuffer is now only an opaque block of memory [skip ci] 2017-12-09 14:07:14 +02:00
cbenthin 4ae648cb0c rtcAttachGeometryByID returns now void 2017-12-08 14:53:56 +01:00
cbenthin 74c90befc7 removed bounds argument from rtcSetGeometryDisplacementFunction 2017-12-08 14:38:30 +01:00
cbenthin 13fc5b205e removed userPtr member from RTCBoundsFunctionArguments 2017-12-08 14:29:49 +01:00
atafra f5f4a20b96 buffer updates (all verify tests pass) [skip ci] 2017-12-08 15:20:39 +02:00
cbenthin 894723e396 changed parameter of rtcSetGeometryMask to unsigned int 2017-12-08 14:16:17 +01:00
cbenthin e5fbce1c9f removed rtcAttachAndReleaseGeometry(ByID) 2017-12-08 14:08:03 +01:00
cbenthin e8af64f397 renamed EMBREE_GEOMETRY_SUBDIV to EMBREE_GEOMETRY_SUBDIVISION 2017-12-08 12:05:31 +01:00
cbenthin 1bbe894eee fixes for alignment test for uchar flags array 2017-12-07 15:52:19 +01:00
cbenthin 0e70446c06 fixes for curved geometry, flags array gets now correctly passed through the different layers 2017-12-07 15:48:20 +01:00
cbenthin 461305e8a1 curve flag buffer updates 2017-12-07 14:01:37 +01:00
Sven Woop e5a5322272 renamed man files 2017-12-07 12:07:37 +01:00
Sven Woop d0d1cfe837 installing man pages, uninstalling man pages 2017-12-07 11:57:10 +01:00
Sven Woop 82caf8a153 added man pages 2017-12-07 11:37:52 +01:00
cbenthin 081f10e725 support for curve/line flags in xml-scenegraph-loader layer 2017-12-06 21:22:06 +01:00
cbenthin 68c0ef27b5 adding curve flags to bezier1i,bezier1v plus fixes 2017-12-06 19:25:03 +01:00
cbenthin 8c1cb0b938 adding curve flags to bezier curves 2017-12-06 19:21:08 +01:00
atafra 7445283860 buffer updates [skip ci] 2017-12-06 00:29:12 +02:00
atafra d0c5ac3624 buffer updates [skip ci] 2017-12-06 00:20:31 +02:00
atafra 48cb95580d buffer updates [skip ci] 2017-12-05 19:49:33 +02:00
cbenthin b48eec44c5 added RTC_CURVE_FLAGS_BUFFER to RTCBufferType 2017-12-05 17:08:08 +01:00
cbenthin 268736e7e2 masking out the two most significiant bits when returning the geomIDs 2017-12-05 17:04:08 +01:00
cbenthin 1a3b806499 moving RTCCurveFlags encoding to geomID 2017-12-05 16:42:15 +01:00
cbenthin d800222b32 removed some previously introduced infrastructure for line segments 2017-12-05 15:38:12 +01:00
atafra 7c33b77223 buffer update [skip ci] 2017-12-04 22:59:43 +02:00
atafra 6ebb05de67 buffer update [skip ci] 2017-12-04 22:55:08 +02:00
atafra a1e4c0e5af buffer updates [skip ci] 2017-12-04 22:48:00 +02:00
atafra 79813e48d0 minor cleanup [skip ci] 2017-12-04 21:02:47 +02:00
cbenthin c2459cbd51 working on getting the hairset ranges through the different layers 2017-12-04 20:01:14 +01:00
atafra 342ec38315 added RTC_FORMAT_UINT types [skip ci] 2017-12-04 20:11:53 +02:00
atafra 0d13b0b709 renamed userbuffers to vertexAttribs [skip ci] 2017-12-04 19:59:04 +02:00
cbenthin e7197fa880 Merge remote-tracking branch 'origin/devel' into cbenthin3 2017-12-04 13:42:39 +01:00
atafra 03cc0519e1 RTCBuffer is starting to work [skip ci] 2017-12-04 14:07:10 +02:00
cbenthin 33df3d7cdb renamed to rtcSetGeometryUserPrimitiveCount, throws RTCError when called for non-user geom 2017-12-01 14:14:09 +01:00
cbenthin 74b9243984 renamed rtcSetGeometryNumPrimitives to rtcSetGeometryPrimitiveCount and rtcSetGeometryNumTimeSteps to rtcSetGeometryTimeStepCount 2017-11-30 15:18:10 +01:00
cbenthin 317992a8ac renamed rtcSetGeometryIndexBuffer to rtcSetGeometryVertexAttributeTopology 2017-11-30 14:36:36 +01:00
cbenthin 5ed469048c renamed rtcGetBuffer to rtcGetBufferData 2017-11-30 14:18:03 +01:00
Sven Woop 6285427fa0 switching to ISPC 1.9.2 for CI testing 2017-11-30 06:25:22 +01:00
Sven Woop a6a28d701e removed all print invokations from tutorials 2017-11-30 06:21:16 +01:00
Sven Woop eec88df77e enabled ribbons again in verify.update test 2017-11-30 06:08:26 +01:00
cbenthin bbceae03c6 Merge remote-tracking branch 'origin/devel' into cbenthin3 2017-11-29 18:08:07 +01:00
cbenthin 089c8c53b8 updates 2017-11-29 18:07:52 +01:00
Sven Woop 1b4d6b8adf temporary workaround to get verify running through again 2017-11-29 17:41:12 +01:00
cbenthin 5d3cb4ba44 added bitmask for first and last segment to each line segment's start vertex index 2017-11-29 17:11:26 +01:00
Sven Woop 41180f92dd fixed reference images 2017-11-29 12:44:09 +01:00
Sven Woop 1006be76a2 Merge branch 'swoop' into devel 2017-11-29 12:27:03 +01:00
Sven Woop 485f61c785 fix in t<r test for lines and ribbons 2017-11-29 12:08:53 +01:00
Sven Woop ff8c019205 removed RTC_MAX_USER_BUFFERS and RTC_MAX_INDEX_BUFFERS limitation 2017-11-29 11:44:20 +01:00
Sven Woop a4ede1c35c removed remaining occurances of RTCRay1 in ISPC headers 2017-11-29 11:37:01 +01:00
Sven Woop 21f844f3ef updates to embree2 to embee3 conversion 2017-11-29 11:32:16 +01:00
Sven Woop e534759167 updates to embree2 to embee3 conversion 2017-11-29 08:48:38 +01:00
Sven Woop bd9498115c updates to embree2 to embee3 conversion 2017-11-29 08:18:24 +01:00
Sven Woop 24f74b2042 updates to embree2 to embee3 conversion 2017-11-29 08:00:45 +01:00
Sven Woop f32f1c9ffd updates to embree2 to embee3 conversion, added LHS 2017-11-29 07:41:03 +01:00
Sven Woop 70478cb176 updates to embree2 to embee3 conversion 2017-11-29 07:28:34 +01:00
Sven Woop 700c8e6822 bugfix in depth counting of cpp-patch.py 2017-11-29 07:22:08 +01:00
Sven Woop 245ff6d239 updates to embree2 to embee3 conversion 2017-11-29 06:57:18 +01:00
Sven Woop baf7bde6e5 added rule to convert ray member names 2017-11-29 06:26:20 +01:00
Sven Woop 1e2c8b6ec6 fixes to ISPC mode in embree2_to_embree3.patch 2017-11-29 06:23:07 +01:00
Sven Woop 5011f13d4c fixes to ISPC mode of cpp-patch.py 2017-11-29 06:21:41 +01:00
Sven Woop 772f9ecd24 fixed compile warnings 2017-11-29 05:41:34 +01:00
Sven Woop b8911c5993 enabled t<r test for lines and ribbons 2017-11-29 05:32:27 +01:00
Sven Woop 300ef89492 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-11-29 05:30:48 +01:00
cbenthin 409294590b Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-11-28 18:05:50 +01:00
cbenthin 154d7d8945 switch position of geomID and primID in the ray structure to be complient #282 2017-11-28 16:42:03 +01:00
Sven Woop 2bbcd8594e fix to embree2_to_embree3.patch 2017-11-28 14:39:06 +01:00
Sven Woop ea3b5dda8b fixes to support ISPC in embree2_to_embree3.patch 2017-11-28 13:27:44 +01:00
cbenthin 3e73baf708 Merge remote-tracking branch 'origin/devel' into extended_ray_by_id_flags 2017-11-28 10:52:56 +01:00
Sven Woop 4096c4b879 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-11-28 10:52:34 +01:00
Sven Woop 1eee73ab3d changed default MSI install path to Embree3 2017-11-28 10:51:49 +01:00
cbenthin 212d6d4566 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-11-28 10:49:59 +01:00
cbenthin 5298a04b0e fixed packet tracing regression, isCoherent() check was wrong 2017-11-28 10:49:48 +01:00
Sven Woop acf8462495 compile fix for GCC and ICC 2017-11-28 10:44:55 +01:00
Sven Woop 4014c9b747 renamed EMBREE_INTERSECTION_FILTER cmake option to EMBREE_FILTER_FUNCTION 2017-11-28 10:11:56 +01:00
Sven Woop a748d3b04e renamed rtcReportIntersection to rtcFilterIntersection 2017-11-28 09:52:39 +01:00
Sven Woop e2f855c6b3 rtcInterpolate API calls get RTCInterpolateArguments struct as input.
Added helper functions rtcInterpolate0/1/2 that get arguments as before.
2017-11-28 09:45:35 +01:00
Sven Woop dd2e225d6c merged RTCAccelFlags and RTCSceneFlags again 2017-11-28 08:34:27 +01:00
cbenthin a5c3ece437 Merge remote-tracking branch 'origin/devel' into extended_ray_by_id_flags 2017-11-27 14:08:26 +01:00
atafra 6c90ef221e fixed subdiv creation 2017-11-27 13:52:33 +02:00
atafra 60d7e8a053 Merge remote-tracking branch 'origin/devel' into devel 2017-11-27 13:07:58 +02:00
atafra fc37fe1241 create all geometry types with rtcNewGeometry (except instances) 2017-11-27 13:07:49 +02:00
Sven Woop cad471a23b updates to embree2_to_embree3.patch 2017-11-27 08:15:50 +01:00
Sven Woop eefe466c58 compile fix when compiling Embree as static library 2017-11-27 06:28:00 +01:00
atafra 27d8a78d6c renamed RTCIntersectMode to RTCGeometrySubtype 2017-11-24 18:37:54 +02:00
cbenthin 9211327353 fixes for AOS/AOP stream conversion 2017-11-24 17:07:23 +01:00
cbenthin a64b136de5 updates 2017-11-24 16:54:16 +01:00
atafra 1450344d5e Merge remote-tracking branch 'origin/devel' into devel
# Conflicts:
#	scripts/embree2_to_embree3.patch
2017-11-24 16:25:05 +02:00
atafra f821c69cb9 RTCGeometry renames 2017-11-24 16:07:48 +02:00
Sven Woop 2ceb52259b Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-11-24 14:02:00 +01:00
Sven Woop 1d3d45b54c added rules to embree2_to_embree3.patch to convert user geometry 2017-11-24 13:58:07 +01:00
Sven Woop d1becebc98 updates to embree2_to_embree3.patch 2017-11-24 12:13:13 +01:00
Sven Woop d076f7569a updates to embree2_to_embree3.patch 2017-11-24 11:32:19 +01:00
Sven Woop 678a702c46 updates to embree2_to_embree3.patch, removing more RTCAlgorithmFlags 2017-11-24 11:14:34 +01:00
Sven Woop 2c4abb195b updates to embree2_to_embree3.patch, added COMMENT feature 2017-11-24 10:56:57 +01:00
Sven Woop 01074aee8d updates to embree2_to_embree3.patch 2017-11-24 10:53:29 +01:00
Sven Woop 6b30a7f4c5 updates to embree2_to_embree3.patch 2017-11-24 10:37:48 +01:00
Sven Woop 67a4cd9e65 added support to cpp-patch.py to insert unique identifiers 2017-11-24 10:14:34 +01:00
Sven Woop 3539bf0e02 fixes to embree2_to_embree3.patch to remove RTCAlgorithmFlags 2017-11-24 10:02:16 +01:00
Sven Woop c49bea76fa fixes to embree2_to_embree2.patch, added rules for BVH builder API 2017-11-24 09:49:16 +01:00
Sven Woop 7b25f032ca fixes to embree2_to_embree3.patch 2017-11-24 08:52:37 +01:00
Sven Woop d4834c7ffd fixes to embree2_to_embree3.patch 2017-11-24 08:44:10 +01:00
Sven Woop 2df7c762ef fixes to embree2_to_embree3.patch 2017-11-24 08:40:14 +01:00
Sven Woop 2d7bf27eb2 fixes to embree2_to_embree3.rules 2017-11-24 08:35:59 +01:00
Sven Woop 5db6faf9d0 fixes to embree2_to_embree3.rules 2017-11-24 08:29:41 +01:00
Sven Woop f5cc973567 bugfixes to embree2_to_embree3.patch 2017-11-24 07:57:04 +01:00
Sven Woop 7b5f5ada33 bugfixes to cpp-patch.py 2017-11-24 07:52:56 +01:00
Sven Woop a84bb0daee updates to embree2_to_embree3 rules 2017-11-24 07:20:38 +01:00
Sven Woop 50855d366d added rtcCommitGeometry call 2017-11-24 06:57:39 +01:00
Sven Woop 0d1e066ca6 bugfix in cpp-path.py, identifier match was broken 2017-11-24 06:51:16 +01:00
Sven Woop f77ad0e1a7 small bugfix in cpp-patch.py 2017-11-24 06:40:09 +01:00
atafra 07b787cc06 RTCScene renames 2017-11-24 01:03:02 +02:00
atafra 888f207a34 RTCDevice renames 2017-11-24 00:32:13 +02:00
Sven Woop b16304c8af added some basic support for regexpr to cpp-patch.py 2017-11-23 15:02:34 +01:00
Sven Woop fa9c7117f9 bugfix to cpp-patch.py 2017-11-23 13:52:46 +01:00
Sven Woop 3b55b61da2 bugfixes to cpp-patch.py 2017-11-23 11:59:01 +01:00
Sven Woop 802ec56af5 updates to cpp-patch.py 2017-11-23 11:31:31 +01:00
Sven Woop cc83f32f0c performance optimization in cpp-patch.py 2017-11-23 11:28:18 +01:00
Sven Woop 4959146013 performance optimization in cpp-patch.py 2017-11-23 11:26:49 +01:00
Sven Woop dc5ed6adf2 fixes to rules, improved error printing when parsing patch file 2017-11-23 09:09:16 +01:00
Sven Woop 2f4b588348 removed cocci rules 2017-11-23 08:31:32 +01:00
Sven Woop 0ccfa6fdd7 converted all cocci rules 2017-11-23 08:31:22 +01:00
Sven Woop f3e0c76d77 bugfixes in cpp-patch.py 2017-11-23 07:38:32 +01:00
atafra 6984e2d42f fixed bug in Buffer 2017-11-23 02:39:05 +02:00
cbenthin f7ca0548a4 merge from release 2017-11-22 16:39:46 +01:00
Sven Woop b8a8b7111f Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-11-22 15:58:35 +01:00
Sven Woop 3026e38b11 bugfixes and added embree2_to_embree3.rules file 2017-11-22 15:57:40 +01:00
Sven Woop 37c8a76cd3 embree2_to_embree3.py supports parsing rules file 2017-11-22 15:46:58 +01:00
atafra 1e92a656b4 Merge remote-tracking branch 'origin/devel' into devel 2017-11-22 16:30:56 +02:00
cbenthin 61f6b3455d always use the subdiv-eager variant, regardless whether the scene is static or dynamic 2017-11-22 15:30:01 +01:00
atafra 957566ae94 buffer type cleanups 2017-11-22 16:24:42 +02:00
Sven Woop 7597e59501 added support for multiple follow rules 2017-11-22 14:37:10 +01:00
Sven Woop b4d4d59d64 cleanups to embree2_to_embree3.py 2017-11-22 14:28:53 +01:00
Sven Woop 372dfbfb59 first version of embree2_to_embree3.py 2017-11-22 14:26:25 +01:00
cbenthin debce58e63 fixed order in internal hit structure 2017-11-22 13:36:52 +01:00
cbenthin c9f7c57dd1 reordered members of RTCHitN/RTCHit to make it more consistent with RTCRayN/RTCRay 2017-11-22 11:10:04 +01:00
cbenthin 327103fe16 added copyHitFromRTCRayToRTCRayN helper function 2017-11-22 10:53:20 +01:00
cbenthin 9edc365420 added copyRTCHitToRTCRayN 2017-11-22 10:11:05 +01:00
cbenthin 0713f17838 added RTCHitToRTCRay helper function, used in user_geometry tutorial 2017-11-22 09:33:15 +01:00
cbenthin 14777ecdc4 removed default arguments for RTCRay* helper functions 2017-11-22 09:13:58 +01:00
cbenthin e4d83b2447 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-11-21 16:14:22 +01:00
cbenthin 13d44cb428 Merge branch 'devel3' into devel 2017-11-21 16:10:43 +01:00
Sven Woop 0e44af4ba0 Merge branch 'devel3' into devel 2017-11-21 16:07:33 +01:00
Sven Woop 96681954a0 added embree2_to_embree3.cocci 2017-11-21 13:42:38 +01:00
Sven Woop 669e48e22e Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-11-21 13:42:12 +01:00
atafra e2b6d4b74d minor header fix 2017-11-21 13:57:52 +02:00
atafra 9ef01bcef9 rtcore header cleanup 2017-11-21 13:55:21 +02:00
cbenthin 860c8b8ef8 test 2017-11-21 12:35:33 +01:00
Sven Woop 70d7d81c82 bugfix to tutorials/Makefile, viewer_anim_device.cpp was generated into wrong folte 2017-11-21 07:18:00 +01:00
Sven Woop bbde549c6c Merge branch 'devel3' into devel 2017-11-21 07:07:55 +01:00
Sven Woop afca09d728 enabling klocwork testing again 2017-11-21 07:07:05 +01:00
cbenthin 1d70dd845b fixed compile errors 2017-11-20 15:12:26 +01:00
Sven Woop bbf0c301df Merge branch 'swoop3' into devel3 2017-11-20 15:02:23 +01:00
cbenthin 0d64962488 merged cbenthin3 into devel3, enabled packet code path with new rtcReport interface 2017-11-20 14:57:26 +01:00
cbenthin 86c2b3bbf5 user_geometry tutorial uses now different intersect/filter fcts based on stream mode on/off 2017-11-20 13:45:20 +01:00
cbenthin 60baccae69 working on rtcReportIntersection for standard packet path 2017-11-20 11:58:46 +01:00
cbenthin 89bf21c9ce added missing packet version of sphereFilterFunction 2017-11-20 10:53:51 +01:00
cbenthin e1d417d073 added missing packet version of sphereFilterFunction 2017-11-20 10:53:24 +01:00
Sven Woop 596baae146 removed RTCGeometryIntersector argument from rtcNewCurveGeometry 2017-11-20 10:28:05 +01:00
Sven Woop 9deac117f0 removing num_time_steps argument from rtcNewUserGeometry API call 2017-11-20 10:00:07 +01:00
Sven Woop ac136d8240 added rtcGetNumTimeSteps API call 2017-11-20 09:44:52 +01:00
Sven Woop 0278153166 removed numPrimitives argument from rtcNewUserGeometry call 2017-11-20 09:31:16 +01:00
Sven Woop 76c6f43f6c added rtcSetNumPrimitives call 2017-11-20 09:17:05 +01:00
Sven Woop 603aa1d05c Removed RTCRay1 from rtcore_ray.isph. As ray layouts are now
compatible one can just use uniform RTCRay instead.
2017-11-20 07:45:13 +01:00
Sven Woop bf5ddb0b1b Renamed orgx to org_x, dirx to dir_x, Ngx to Ng_x etc. to make naming consistent with RTCRay_org_x etc. functions. 2017-11-20 07:34:28 +01:00
Sven Woop 74fb958f87 cleanups to rtcore_scene.isph, tnear<tfar test is not required here 2017-11-17 14:33:57 +01:00
cbenthin a55508fdca ..same for occlusion filters 2017-11-17 14:25:06 +01:00
Sven Woop 4239e414f8 bugfix in intersection filter semantics in user_geometry tutorial 2017-11-17 14:23:15 +01:00
Sven Woop f5ed2d69ea cleaned up implementation of rtcReportIntersection 2017-11-17 14:17:20 +01:00
cbenthin 1394acc898 set single ray/packet intersectionFilter or stream intersectionFilter based on g_mode 2017-11-17 14:11:03 +01:00
Sven Woop 68b9409e26 Implemented --lefthanded and --righthanded command line options
to switch handedness of coordinate system. Default is still
lefthanded.
2017-11-17 11:57:51 +01:00
Sven Woop 0e6a59bd49 renamed RTCCurveType to RTCGeometryIntersector 2017-11-17 09:37:11 +01:00
Sven Woop 99957106e1 fixed ray/rays naming inconsistency between RTCIntersectFunctionNArguments and RTCFilterFunctionNArguments 2017-11-17 09:22:39 +01:00
Sven Woop 14c544f177 Merge branch 'swoop3' into devel3 2017-11-17 07:10:25 +01:00
Sven Woop 0b45d1878d enabled rtcReportIntersection again in user_geometry tutorial 2017-11-17 07:10:16 +01:00
cbenthin 80f373eeb2 deactivated rtcReport* also in single ray user_geometry tutorial due to artifacts 2017-11-16 18:17:23 +01:00
cbenthin 6de6b70066 deactivating rtcReport* in user_geometry 2017-11-16 16:45:21 +01:00
cbenthin fb75b68a67 some minor simplications 2017-11-16 16:15:05 +01:00
Sven Woop 008025c3fc using right hand rule to calculate Ng 2017-11-16 16:01:31 +01:00
Sven Woop 1a6bb4b159 bugfix in backface culling test in verify 2017-11-16 13:07:33 +01:00
Sven Woop 8784460cef changed eyelight shader to visualize Ng direction 2017-11-16 12:24:38 +01:00
Sven Woop ed543ddc13 Merge commit '4186d361127c6ffe28658067b71ef8686eaafb43' into devel3 2017-11-16 11:08:00 +01:00
cbenthin 3990371b7e added intersection filter helper functions, simplified intersection_filter tutorial 2017-11-16 10:57:41 +01:00
Sven Woop 6a97f3510d added tighten again to testing 2017-11-16 09:19:18 +01:00
Sven Woop 4186d36112 added rtcGetSceneFlags, rtcGetBuildQuality, rtcGetAccelFlags API calls 2017-11-16 08:52:56 +01:00
Sven Woop 2c60bd5a02 demonstrating intersection filter usage for user geometries in user_geometry tutorial 2017-11-16 08:32:59 +01:00
cbenthin 417a6dfd6a added default args to RTCRay* helper functions 2017-11-15 19:39:23 +01:00
Sven Woop f7a60ef9ea added rtcReportIntersection and rtcReportOcclusion API calls 2017-11-15 12:06:58 +01:00
Sven Woop 6f0ba056de introduced reportIntersection calls in filter.h 2017-11-15 09:47:02 +01:00
Sven Woop c5f9b8d641 instancing bugfix for AVX512 2017-11-15 09:46:36 +01:00
Sven Woop 60527ca659 Fixed instancing. instID is managed in RTCIntersectionContext.
All intersectors, including user geometries, need to set ray.instID
to context->instID.
2017-11-15 08:08:25 +01:00
cbenthin e940551ae2 one pass on windows to remove 100s of warnings 2017-11-14 07:02:06 -08:00
cbenthin 97db15c941 renamed getSeconds to getTime 2017-11-14 15:13:35 +01:00
cbenthin 15b519682a renamed getSeconds to getTime 2017-11-14 15:09:33 +01:00
Sven Woop 88a37377f5 Merge branch 'swoop3' into devel3 2017-11-14 15:06:39 +01:00
cbenthin 12e1407f61 fix for viewer_stream, readded sampler 2017-11-14 14:19:49 +01:00
Sven Woop 9d4f025888 user_geometry tutorial transforms Ng during shading 2017-11-14 14:10:29 +01:00
Sven Woop 30b6fbbe52 cleanups to user_geometry tutorial 2017-11-14 14:04:10 +01:00
Sven Woop 46a5fc3c8c RTCIntersectContext no longer const 2017-11-14 13:32:42 +01:00
Sven Woop 45e89e84a3 removed unused flags member from IntersectContext 2017-11-14 12:48:23 +01:00
cbenthin ed4ae27caf merge from cbenthin3 and devel 2017-11-14 11:50:24 +01:00
cbenthin 1bb052b67c ispc2cpp works again, regenerated all *_device.cpp files 2017-11-14 11:41:51 +01:00
cbenthin 088144415d updates 2017-11-14 11:34:43 +01:00
Sven Woop c67758786f renamed rtcDeleteBVH to rtcReleaseBVH 2017-11-14 11:30:28 +01:00
cbenthin 1d4af950a2 intersection_filter tutorial update 2017-11-14 11:29:33 +01:00
Sven Woop cab25ae9b3 Renamed rtcDeleteDevice to rtcReleaseDevice.
Properly reference counting device.
2017-11-14 11:27:00 +01:00
cbenthin 7b87fc1acc pathtracer updates 2017-11-14 11:07:16 +01:00
Sven Woop 5e95d8f930 added rtcSetCurveType API call 2017-11-14 11:07:12 +01:00
cbenthin af8452c5d1 merge from devel3 2017-11-14 11:05:28 +01:00
Sven Woop 482d382238 Removed userRayExt from RTCIntersectContext.
Tutorials use extended IntersectContext struct
when required.
2017-11-14 10:55:10 +01:00
Sven Woop 90e49f2437 fixed artefact search for linux build 2017-11-14 09:35:23 +01:00
Sven Woop b46a868251 putting namelink to devel RPM 2017-11-14 09:26:33 +01:00
cbenthin 48c50ed486 tempor. disabled klockwork test for cbenthin3 branch 2017-11-14 09:22:22 +01:00
Sven Woop b715a63592 renamed RTCBuildHints to RTCSceneFlags 2017-11-14 09:20:15 +01:00
Sven Woop 8f782a62ac Merge commit 'e3295e5' into swoop3 2017-11-14 08:46:00 +01:00
Sven Woop e3295e5c5e moved smooth normal subdiv code to original place in viewer to fix performance regression 2017-11-14 08:45:45 +01:00
cbenthin f7a49734cd converted viewer* tutorials 2017-11-13 19:27:58 +01:00
cbenthin d45c7c0a1a updated user_geometry tutorial 2017-11-13 18:42:31 +01:00
cbenthin 03fb2c637c updated subdivision_geometry tutorial 2017-11-13 17:47:34 +01:00
cbenthin 6d607d841a updated motion_blur_geometry tutorial 2017-11-13 17:44:25 +01:00
cbenthin 1febe3d6d9 interpolation tutorial works 2017-11-13 17:33:06 +01:00
Sven Woop e14dc78115 updated documentation 2017-11-13 17:11:56 +01:00
Sven Woop 973e3befc7 setting version to 2.17.1 2017-11-13 17:07:21 +01:00
cbenthin 37da45340a updated instanced_geometry tutorial 2017-11-13 17:02:24 +01:00
cbenthin 218865c6ae updating hair geometry 2017-11-13 16:33:19 +01:00
cbenthin 94893e2c93 updating hair geometry 2017-11-13 16:30:55 +01:00
cbenthin 97318b61a5 updates 2017-11-13 16:15:03 +01:00
cbenthin 62970be32f conversion of triangle_geometry and curve_geometry works 2017-11-13 16:07:47 +01:00
cbenthin 8a8dfd3465 updates 2017-11-13 15:49:19 +01:00
cbenthin 90db4e7de5 cleaned up ray.isph 2017-11-13 11:08:25 +01:00
Sven Woop 712ca24754 Merge branch 'devel' into swoop3 2017-11-13 11:05:45 +01:00
Sven Woop 7689b0f6ad fixed bug where far hit was reported for curvy hair segment 2017-11-13 11:00:18 +01:00
Sven Woop a76dd84b1d disabling klockwork run temporarily 2017-11-13 10:41:46 +01:00
Sven Woop 8a10c92e27 bugfix in xml_loader, compatibility mode for BezierHair and BezierCurve nodes was broken 2017-11-13 10:24:29 +01:00
Sven Woop bf9cc4c8d9 removed rtcGetGeometry usage from viewer_stream 2017-11-13 09:03:43 +01:00
Sven Woop 892c825175 cleanups to subdivision_geometry tutorial 2017-11-13 08:58:47 +01:00
Sven Woop 997417ac5d pathtracer bugfix of smooth normal calculation for subdivs 2017-11-13 08:54:42 +01:00
Sven Woop 74d3ac77f9 removed rtcGetGeometry usages from viewer_anim 2017-11-13 08:48:00 +01:00
Sven Woop 25a1625697 Storing RTCGeometry inside ISPC scene geometries.
Removes usages of rtcGetGeometry.
2017-11-13 08:39:12 +01:00
Sven Woop ddb65ba1af removed numBenchmarkRepetitions feature from tutorial.cpp, implementation was anyway buggy 2017-11-13 07:49:05 +01:00
cbenthin 059f0be2c9 Merge remote-tracking branch 'origin/devel' into cbenthin3 2017-11-10 20:29:21 +01:00
cbenthin 7cd6905e07 Merge remote-tracking branch 'origin/devel3' into cbenthin3 2017-11-10 20:19:22 +01:00
cbenthin 1706f95d44 fixes for intersection_filter_ispc 2017-11-10 20:19:02 +01:00
cbenthin 93e2a33227 Ng fix 2017-11-10 13:40:42 +01:00
cbenthin 9d39f047ae removed dbg #if 2017-11-10 13:26:52 +01:00
Sven Woop 417ed67ee1 Merge branch 'swoop3' into devel3 2017-11-10 12:28:33 +01:00
cbenthin ff52bc7673 Ng fix 2017-11-10 12:05:57 +01:00
cbenthin c57aca0921 merged devel into cbenthin3 2017-11-10 11:23:15 +01:00
Sven Woop db016cab3f removed RTCBuildQuality from rtcNewXXX API calls 2017-11-10 09:28:39 +01:00
cbenthin 051b784e6e fixed user_geometry tutorial 2017-11-10 09:21:42 +01:00
Sven Woop 33765d388c Added rtcSetGeometryBuildQuality API call.
Added build quality input checks to API.
2017-11-10 08:26:06 +01:00
Sven Woop 70047b7cfb Replaced RTCGeometryFlags with RTCBuildQuality.
Added RTC_BUILD_QUALITY_REFIT.
2017-11-10 08:10:37 +01:00
Sven Woop e0be4e93f7 added EMBREE_INTERSECTION_FILTER_CONTEXT to embree-config.cmake 2017-11-10 06:44:23 +01:00
Sven Woop bad7a9d89e Added support for context filter functions.
The feature is disabled by default, use
EMBREE_INTERSECTION_FILTER_CONTEXT to enable it
at compile time.
2017-11-10 06:37:30 +01:00
Sven Woop f04ba2c73e cleaned up counting of filter functions inside scene 2017-11-10 05:37:35 +01:00
cbenthin 2db4bbdb01 merged cbenthin3 into devel3 2017-11-09 22:47:08 +01:00
cbenthin c9c83923ca added sse-only sequence to update 4th component in vec3fa 2017-11-09 22:31:42 +01:00
cbenthin 9717ea5366 updates/fixes 2017-11-09 20:59:05 +01:00
cbenthin 769b7bd469 tutorial ray structure now also combines tnear/tfar with ray.org/ray.dir, introduced tnear(),tfar() access fcts 2017-11-09 20:58:16 +01:00
cbenthin 313ba6370a tutorial ray structure now also combines tnear/tfar with ray.org/ray.dir, introduced tnear(),tfar() access fcts 2017-11-09 20:57:55 +01:00
cbenthin 80b9eae647 fixed msvc warnings 2017-11-09 20:47:46 +01:00
atafra 3cd56c2240 minor naming cleanup 2017-11-09 20:21:33 +02:00
atafra 144a79f49a minor optimizations 2017-11-09 20:18:34 +02:00
atafra b045bd9178 implemented octant sorting to SOA streams 2017-11-09 20:13:17 +02:00
cbenthin 9d9697c55f merge with cbenthin3 2017-11-09 17:50:31 +01:00
cbenthin 7b0164ecb2 trying to get ray init working without scalar stores 2017-11-09 17:42:30 +01:00
Sven Woop 01455cfdd1 Merge branch 'swoop2' into devel3 2017-11-09 17:39:17 +01:00
Sven Woop 08a6c03431 Merge branch 'swoop' into devel 2017-11-09 17:34:19 +01:00
cbenthin b3c6831e48 update to reduce_add 2017-11-09 16:37:38 +01:00
cbenthin 0e5e6c79cc merged devel 2017-11-09 16:05:49 +01:00
cbenthin 4ae2234bce reduce_add for vec3fa now also uses shuffles, and vec3fa+float constructor _mm_insert_ps 2017-11-09 15:12:09 +01:00
cbenthin 12828d3b49 Merge branch 'devel3' into cbenthin3 2017-11-09 15:04:29 +01:00
Sven Woop 3421560cd3 removed acceptHit from filter function arguments 2017-11-09 14:45:09 +01:00
Sven Woop a4cebb5510 enabled primrefalloc for lines 2017-11-09 14:12:08 +01:00
Sven Woop 24ebddee3a using primrefalloc mode for hair 2017-11-09 13:56:08 +01:00
Sven Woop 0fc33ecc9e removed rtcInterpolate2 API call 2017-11-09 12:43:13 +01:00
Sven Woop ef7ac487c8 simplified geometry code, setNumPrimitives function now manges counting of number of primitives in scene 2017-11-09 12:32:45 +01:00
Sven Woop d5c98f0fe8 bugfix of primitive counting when changing number of primitives of a disabled geometry 2017-11-09 11:57:46 +01:00
Sven Woop 6d00556992 bugfix of primitive counting when changing number of primitives of a disabled geometry 2017-11-09 11:49:01 +01:00
Sven Woop 62fb02da85 cleanups in geometry.h, isEnabled and isModified also true for empty geometries 2017-11-09 11:44:35 +01:00
Sven Woop d54b39e41c cleanups to geometries 2017-11-09 11:37:55 +01:00
atafra 660a68c9bc added some missing scatter functions 2017-11-09 12:18:13 +02:00
atafra d55b897fa6 compiler error and bug fix 2017-11-09 11:52:37 +02:00
Sven Woop 4c1231c644 started implementing context filter 2017-11-09 10:50:37 +01:00
Sven Woop 1c94626dc4 removed numTimeSteps from most rtcNewXXX API calls 2017-11-09 10:50:05 +01:00
atafra 0499f5b111 compiler error fix 2017-11-09 11:44:21 +02:00
Sven Woop ec09ea72c4 started implementing context filter 2017-11-09 07:50:52 +01:00
atafra e95f689dc4 implemented octant sorting for SOP streams 2017-11-08 22:09:31 +02:00
atafra 65caa81a8b implemented octant sorting for AOP streams 2017-11-08 19:39:44 +02:00
atafra 8a41e330e7 RayStreamAOP::getRayByIndex now gets a vector of indices 2017-11-08 16:18:19 +02:00
atafra 89665b41b7 optimized RayStreamAOS::getRayByOffset 2017-11-08 16:04:42 +02:00
atafra da3c703686 minor stream filter cleanup 2017-11-08 15:35:50 +02:00
atafra bcef855a73 minor stream intersector cleanups 2017-11-08 15:26:49 +02:00
Sven Woop f407d75cd5 removed ray extensions from tutorials/common/core/ray.h 2017-11-08 13:58:52 +01:00
Sven Woop afee8cec19 bugfix in pathtracer, rtcGetGeometry got called with wrong arguments 2017-11-08 13:57:35 +01:00
Sven Woop eefeffcfbf optimization to rtcGetGeometry 2017-11-08 12:52:48 +01:00
Sven Woop 5c86499015 changed rtcGetGeometry call to get geometry unlocked 2017-11-08 12:44:24 +01:00
Sven Woop 8fcbc8d432 removed numMappedBuffers counter from scene 2017-11-08 12:41:56 +01:00
Sven Woop 8f0ffb7688 Verify no longer adds geometry to scene to interpolate.
Fixed subdiv mesh to initialize half edges in rtcCommitGeometry call.
2017-11-08 12:37:57 +01:00
cbenthin b6a14ce20f added proper vuint4/16 conversion to vfloat4/vfloat16 2017-11-08 11:34:14 +01:00
Sven Woop f916c36a8a rtcInterpolate gets RTCGeometry as argument 2017-11-08 11:30:37 +01:00
Sven Woop 0a11ea9a80 fixed some compile warnings in release mode 2017-11-08 11:03:57 +01:00
Sven Woop 90ca5a77ed removed EMBREE_INTERSECTION_FILTER_RESTORE cmake option, was no longer used 2017-11-08 10:58:15 +01:00
Sven Woop ac371cd7cb removed rtcCommitThread API call, one can use rtcCommitJoin instead 2017-11-08 10:52:19 +01:00
cbenthin 7a77e1ebf0 new vuint4 to vfloat4 conversion code 2017-11-08 09:25:50 +01:00
Sven Woop 753830fd33 using RTCBoundsFunctionArguments struct to pass arguments to RTCBoundsFunction 2017-11-08 08:54:08 +01:00
Sven Woop 021811e695 using RTCIntersectFunctionNArguments struct to pass arguments to RTCIntersectFunctionN 2017-11-08 08:15:09 +01:00
Sven Woop 5159bfb1d4 simplifications to accelset.h 2017-11-08 07:24:12 +01:00
cbenthin 59eff5c6d6 added sequence for vuint4 to vfloat4 conversion 2017-11-07 19:48:29 +01:00
cbenthin 5da87e659b changed binner 'counts' from vint4/vint16 to vuint4/vuint16 in standard and spatial binner to allow support for 4B primitives 2017-11-07 18:55:05 +01:00
Sven Woop cf2854b91e using ispc1.9.1 again for testing 2017-11-07 17:09:10 +01:00
Sven Woop 9d4630256d merge rtcore_geometry_user.h into rtcore_geometry.h 2017-11-07 13:58:34 +01:00
Sven Woop e6d05fc2e3 using RTCDisplacementFunctionArguments struct to pass arguments to RTCDisplacementFunction 2017-11-07 13:42:05 +01:00
Sven Woop c9d6f89103 fix to verify 2017-11-07 13:25:00 +01:00
Sven Woop 4f1492e1c7 using RTCFilterFunctionNArguments struct to pass arguments to RTCFilterFunctionN 2017-11-07 13:23:46 +01:00
Sven Woop c4fa141f94 further simpilications to filter.h 2017-11-07 12:39:10 +01:00
Sven Woop 1bdca0e3e1 fixed path to ISPC 2017-11-07 12:29:50 +01:00
Sven Woop 1db6e13d79 simplifications in filter.h 2017-11-07 12:26:42 +01:00
Sven Woop af96d40327 disabling ispc1.9.2rc2 on V120 2017-11-07 11:31:24 +01:00
Sven Woop 7ce114d4ff fixed parsing of ISPC version 2017-11-07 11:29:21 +01:00
Sven Woop 05b8b48943 creating hit outside of runIntersection/OccludionFilter helper functions 2017-11-07 09:19:35 +01:00
Sven Woop 555c2cfe05 enabling ISPC 1.9.2rc2 for testing 2017-11-07 08:23:40 +01:00
Sven Woop 5bab51c45b renamed RTC_BUILD_QUALITY_NORMAL to RTC_BUILD_QUALITY_MEDIUM 2017-11-07 08:21:35 +01:00
Sven Woop cc6287b8a4 renamed RTC_ACCEL_DEFAULT to RTC_ACCEL_FAST 2017-11-07 08:06:49 +01:00
Sven Woop 0c13ffffe9 renamed RTCXXXFunc to RTCXXXFunction 2017-11-07 08:01:03 +01:00
cbenthin 01601729c2 more MSVC warning fixes 2017-11-06 13:23:50 +01:00
cbenthin c0cf5a43ea more MSVC warning fixes 2017-11-06 13:17:37 +01:00
Sven Woop 3e10d7011c Merge branch 'swoop3' into devel3 2017-11-06 12:07:57 +01:00
Sven Woop 4912c58a3c removed rtcUpdate API call 2017-11-06 11:18:46 +01:00
Sven Woop 17c4a02cfd using rtcCommitGeometry in buildbench 2017-11-06 11:13:16 +01:00
Sven Woop b2fc19fccb added rtcCommitGeometry API call 2017-11-06 10:40:07 +01:00
Sven Woop 7a336a1814 added EMBREE_INSTALL_DEPENDENCIES cmake option to enable/disable install of dependencies 2017-11-06 09:17:29 +01:00
cbenthin bd742bd72b fixed Vec3fa+tnear/tfar layout issue in bvh_traverser1 for instances 2017-11-03 09:59:37 +01:00
cbenthin 8e3c531aeb fixed instances with new tnear,tfar mechanism 2017-11-02 19:07:26 +01:00
cbenthin 0cbd38eaf1 Merge branch 'devel3' into cbenthin3 2017-11-02 17:20:08 +01:00
cbenthin e9531aab9f simplified filter implementation for packets 2017-11-02 17:19:51 +01:00
cbenthin ed24f9b05b replaced tnear,tfar in internal by _tnear,_tfar plus access fcts, allows for keeping ray.org, ray.dir as Vec3fa in single ray mode 2017-11-02 17:08:56 +01:00
cbenthin fab7c7ee20 compile fixes, activating filter fcts in path tracer 2017-11-02 13:15:57 +01:00
cbenthin 282d368288 removed const from struct RTCHitN* potentialHit, some more updates to filter fcts 2017-11-02 11:34:00 +01:00
cbenthin 412742094f added new intersection filter interface, disabled filter fcts in pathtracer for now 2017-10-27 19:18:33 +02:00
cbenthin 85aef4afc9 added new intersection filter interface, disabled filter fcts in pathtracer for now 2017-10-27 19:13:33 +02:00
cbenthin d6213110e6 merge with devel 2017-10-27 15:17:53 +02:00
cbenthin 8d46fa6d3a Merge remote-tracking branch 'origin/devel' into devel3 2017-10-27 15:15:19 +02:00
cbenthin 6a9da150d6 fixed some MSVC warnings 2017-10-27 00:16:58 -07:00
Sven Woop 8d444137c0 added alternate search path for TBB under windows, fixed #138 2017-10-27 08:17:48 +02:00
Sven Woop 74edd51aec compile fix for Clang 3.9.0 for Windows 2017-10-27 07:54:37 +02:00
cbenthin d16ea286ce Merge remote-tracking branch 'origin/devel' into devel3 2017-10-26 19:12:43 +02:00
Sven Woop d227c720c8 bugfix in setting accel_flags for testing 2017-10-26 18:52:54 +02:00
cbenthin 92802a382e added new robust mode also for stream interface 2017-10-26 18:22:03 +02:00
cbenthin 4ee3479ff4 Merge branch 'devel' of https://gitlab.com/embree/embree into devel 2017-10-26 18:05:55 +02:00
cbenthin b3ce0274fb hybrid intersector checks now for opposing ray direction signs 2017-10-26 18:04:59 +02:00
Sven Woop dd603b1da2 renamed libembree.so to libembree3.so 2017-10-26 14:32:09 +02:00
Sven Woop 2b7186282a changed version to v3.0.0-alpha.0 and set RPM package name to embree3 2017-10-26 13:37:16 +02:00
Sven Woop 37a094b424 removed ISPC* from export maps 2017-10-26 13:36:46 +02:00
Sven Woop 2015ab6774 bugfix in intensive testing, low/medium/high quality builder were selected wrong 2017-10-26 13:03:04 +02:00
Sven Woop 0d4c063641 renamed include/embree2 folder to include/embree3 2017-10-26 12:45:42 +02:00
Sven Woop ba8c6fbc8c changed RTCRayN access functions to use unsigned int as type for N and i 2017-10-26 12:20:46 +02:00
Sven Woop 21482d2914 Using unsigned int for numChildren parameters in build API. 2017-10-26 12:13:35 +02:00
Sven Woop 27b9ead0ac compile fix for Clang 4 2017-10-26 12:00:43 +02:00
Sven Woop c507b39a15 Using RTCProgressMonitorFunc callback also for BVH build API. 2017-10-26 11:39:50 +02:00
Sven Woop 554bbd89f6 Renamed rtcDeleteScene to rtcReleaseScene.
Properly reference counting scene.
2017-10-26 11:20:09 +02:00
Sven Woop d1f9d744a7 using division to calculate rcp_dir in robust mode, this increases accuracy 2017-10-26 09:57:08 +02:00
Sven Woop 23054cb7a0 Improved performance of robust hybrid traversal by 1.1%.
Epsilon corrections are now only performed to tfar and not
to tnear and tfar.
2017-10-26 09:40:36 +02:00
Sven Woop a7a3bde31c Improved single ray performance of robust traversal by 5%.
The epsilon corrections are now precomputed into two versions
of rdir.
2017-10-26 09:36:12 +02:00
cbenthin b27ebe24d7 Merge branch 'devel3' of https://gitlab.com/embree/embree into devel3 2017-10-25 17:37:21 +02:00
cbenthin 07ca26ccde merge devel in devel3 2017-10-25 17:31:21 +02:00
cbenthin 17702b834f Merge remote-tracking branch 'origin/devel' into devel3 2017-10-25 17:19:44 +02:00
cbenthin 99da7c502d cleanups 2017-10-25 15:33:37 +02:00
cbenthin 5b96102fbc fixed KNL code path for occlusion streams 2017-10-25 14:58:35 +02:00
Sven Woop ddd9b40ee7 compile fix 2017-10-25 14:29:33 +02:00
Sven Woop 0ad2634c2f experiment to workaround v120 C compiler bug 2017-10-25 14:15:58 +02:00
Sven Woop 346b3c9b0e renamed rtcSetBuildHint to rtcSetBuildHints 2017-10-25 14:08:32 +02:00
Sven Woop 6c06311ea6 splitting rtcSetBuildMode into 3 functions, rtcSetAccelFlags, rtcSetBuildQuality and rtcSetBuildHint 2017-10-25 13:55:07 +02:00
Sven Woop b35e115de3 making names of RTCRayN members identical to RTCRay members 2017-10-25 13:22:55 +02:00
Sven Woop dd14472261 Made API headers C99 compatible. 2017-10-25 13:12:29 +02:00
Sven Woop d5acaca6c7 Changed mask type from void* to int*. This makes the mask format transparent. 2017-10-25 08:35:39 +02:00
Sven Woop 868da4617f not exporting ISPC tasking system anymore 2017-10-25 08:28:16 +02:00
Sven Woop e63bcfc682 added doc folder to .gitignore file 2017-10-25 08:18:37 +02:00
cbenthin 4731adf427 added robust code path 2017-10-24 15:43:44 +02:00
cbenthin c8c324730a fixed unnecessary SIMD upconversion in stream-prim intersector code 2017-10-24 12:41:01 +02:00
cbenthin 4ab08b603e avoid the costly gather path in AOS-SOA conversion 2017-10-24 11:54:27 +02:00
cbenthin 5ac5293593 enabled obj material shading in viewer_stream 2017-10-24 10:39:14 +02:00
cbenthin 2a1101af94 enabled simple shading in viewer_stream tutorial 2017-10-24 10:02:36 +02:00
cbenthin 10033ecc2d starting to re-introduce a special code path for occlusion ray streams, starting with AOS input rays 2017-10-23 22:34:47 +02:00
Sven Woop d8b64665f9 Removed RTCSceneFlags and RTCAlgorithmFlags.
Using new RTCAccelFlags, RTCBuildQuality, and RTCBuilHint flags.
rtcInterpolate of disabled subdiv meshes no longer supported.
Not required Embree managed buffers no longer freed for static scenes.
2017-10-20 14:57:10 +02:00
Sven Woop c9a4ac4d7a using new flags in kernel 2017-10-20 09:11:16 +02:00
Sven Woop e150849c62 cleanups 2017-10-20 08:25:25 +02:00
Sven Woop 841f428594 performing BVH selection late 2017-10-20 08:24:04 +02:00
Sven Woop e0ad376f85 added rtcSetBuildMode function 2017-10-20 08:07:50 +02:00
cbenthin 91e4e63714 deactivate octant sorting in pure chunk mode (user geometry intersector), otherwise traversal performance goes down 2017-10-19 15:13:53 +02:00
Sven Woop 54811ef5e1 Handling all curve types using ISPCHairSet class. 2017-10-19 12:40:25 +02:00
Sven Woop ffb74d6f4a Removed LineSegments class from scenegraph and tutorials. 2017-10-19 11:40:36 +02:00
Sven Woop 9b039d77d9 Merge branch 'devel' into devel3 2017-10-19 11:23:44 +02:00
Sven Woop 68a329285f further bugfix to embree.rc file 2017-10-19 11:23:32 +02:00
Sven Woop 8b192d70ec Merged all API calls to create hair/curves into a single rtcNewCurveGeometry call. 2017-10-19 10:36:44 +02:00
Sven Woop 8efcbd5add Merge branch 'devel' into devel3 2017-10-19 10:23:00 +02:00
Sven Woop 631fd40435 bugfix to embree.rc file 2017-10-19 10:22:47 +02:00
Sven Woop e12ab1dd31 Merge branch 'devel' into devel3 2017-10-19 09:06:58 +02:00
Sven Woop 38f84be109 moved real type to embree namespace 2017-10-19 08:53:28 +02:00
Sven Woop 443f44af1f Merge branch 'devel' into devel3 2017-10-19 08:48:03 +02:00
Sven Woop 8e198185f6 Fixed some relative include paths.
No longer adding include nor build folder to include path.
Generating config.h and hash.h into kernels folder.
Added config.h, hash.h, build, tbb, models to .gitignore.
2017-10-19 08:46:31 +02:00
Sven Woop 2ac277d8f7 fix in .gitlab-ci.yml 2017-10-19 08:10:26 +02:00
Sven Woop 60b65a8297 Merge branch 'devel' into devel3 2017-10-19 08:10:00 +02:00
Sven Woop 4e05357c5a Better naming of test file in models repo.
Added test intensity 4.
Using test intensity 2 for Win32 testing.
2017-10-19 08:08:29 +02:00
Sven Woop ba03892ee4 enabling continuous Win32 test again, running nightly Win32 test only for schedules 2017-10-18 16:27:44 +02:00
cbenthin 9facacc075 Merge branch 'devel3' of https://gitlab.com/embree/embree into devel3 2017-10-18 15:26:11 +02:00
cbenthin c11bba9979 first iteration of removing subdiv-cached intersectors 2017-10-18 15:25:50 +02:00
Sven Woop c25d459359 Removed rtcore_ispc.ispc/.cpp files. This way the Embree library no longer
contains ISPC symbols. A big advantage of this is that an ISPC app can
link against Embree, no matter which ISAs are enabled in the ISPC app and
Embree.
2017-10-18 12:38:38 +02:00
Sven Woop fa464e0627 moved intersect functions out of rtcore_ispc file 2017-10-18 12:26:07 +02:00
Sven Woop 51e98e8872 Tutorials to no longer define RTCRay type, but their own Ray type. 2017-10-18 12:13:19 +02:00
Sven Woop 5653c781f4 bugfix in rtcore_ray.isph 2017-10-18 11:14:29 +02:00
Sven Woop 0d1c22ad59 cleanups to rtcore_ispc 2017-10-18 10:49:47 +02:00
Sven Woop 4f4bd10055 cleanups to rtcore_ispc.ispc 2017-10-18 10:43:37 +02:00
Sven Woop c0a7d56823 removed Win32 continuous test 2017-10-18 10:41:51 +02:00
Sven Woop def348af97 Changed some size_t to unsinged int in API. For the changed arguments
we anyway do not support more than 4B items (and will not in forseeable future).
2017-10-18 10:39:55 +02:00
Sven Woop e5ae9934e7 removed RTCIntersectFunc1/4/8/16 2017-10-18 09:44:09 +02:00
Sven Woop 8e736d26cf moved win32 test to intensive tests 2017-10-18 09:43:20 +02:00
Sven Woop 1e4824e453 removing size arguments from rtcNewGeometry calls 2017-10-18 08:58:03 +02:00
Sven Woop 69ef6a1cd0 added rtcNewBuffer and rtcGetBuffer API call
removed rtcMapBuffer and rtcUnmapBuffer API calls
2017-10-17 11:46:21 +02:00
Sven Woop 3d08acc9eb renamed rtcNewInstance2 to rtcNewInstance 2017-10-17 09:48:19 +02:00
Sven Woop fa7c1a12ec regenerated tutorials 2017-10-17 09:37:54 +02:00
Sven Woop 5a83661a68 updates to user_geometry tutorial 2017-10-17 09:29:16 +02:00
Sven Woop 6895cff694 bugfix 2017-10-17 09:15:37 +02:00
Sven Woop ace01048f7 cleanups to motion_blur_geometry tutorial 2017-10-17 09:13:03 +02:00
Sven Woop 5778310200 cleanups to lazy_geometry tutorial 2017-10-17 09:09:57 +02:00
Sven Woop d7776d91fd making intersection_filter tutorial compatible with ispc2cpp convert 2017-10-17 09:07:14 +02:00
Sven Woop add473fb8f removed RTCRay2 struct from hair_geometry tutorial 2017-10-17 08:56:56 +02:00
Sven Woop fd55a45672 bugfix to verify 2017-10-17 08:45:33 +02:00
Sven Woop 27026b5184 Fixed bugs in pathtracer. We should not access ray.geomID field in filter functions. 2017-10-16 12:50:20 +02:00
Sven Woop 882b0ad54f bugfix in intersection filter callback, have to test valid input 2017-10-16 12:14:30 +02:00
Sven Woop 8c1f57f797 removed wrong assert in intersection_filter_device.cpp 2017-10-16 11:15:36 +02:00
Sven Woop 9317c8d3e2 Merge branch 'devel' into devel3 2017-10-16 11:01:34 +02:00
Sven Woop 32eba73b8c test intensity 2 for KNL 2017-10-14 06:34:14 +02:00
Sven Woop db2c0a2ba3 always adding default SSE2 flags, this allows compilation on 32 bit Linux 2017-10-13 12:01:23 +02:00
Sven Woop d6a0359b00 disabled some features that require barrier bit in NodeRef when compiling for 32 bit 2017-10-13 11:59:13 +02:00
Sven Woop 7e1dd5e32c enabling all continuous tests again 2017-10-13 10:08:20 +02:00
Sven Woop 4392d147a7 updates to kw test 2017-10-13 09:57:27 +02:00
Sven Woop 7816d4ce7b docker tests 2017-10-13 09:09:42 +02:00
Sven Woop a65f070c3b setting testing intensity to 2 for KNL 2017-10-13 08:29:18 +02:00
Sven Woop 6ebd0d4074 updates 2017-10-12 15:01:06 +02:00
Sven Woop 6eb96a9ec1 enabled all continuous tests again 2017-10-12 12:58:02 +02:00
Sven Woop 24e7d54827 retry in klocwork.sh 2017-10-12 12:43:40 +02:00
Sven Woop 0ce4a696ed updates to klockwork.sh 2017-10-12 12:26:53 +02:00
Sven Woop 07486d7a7a updates to klockwork.sh 2017-10-12 12:24:23 +02:00
Sven Woop 6501479e74 even more fixes to docker-kw test 2017-10-12 12:07:14 +02:00
Sven Woop d7bccd1bad more fixes to docker-kw test 2017-10-12 12:05:22 +02:00
Sven Woop 83166d37d8 fix to docker-kw test 2017-10-12 12:01:46 +02:00
Sven Woop aa64d94ffe docker-kw tests 2017-10-12 11:57:38 +02:00
Sven Woop 50e9e66954 Enabled edge level in viewer_stream. Enabled subdiv tests for viewer_stream. 2017-10-12 11:17:29 +02:00
Sven Woop f1eabe2b82 disabled address sanitizer 2017-10-12 10:46:16 +02:00
Sven Woop 7fc05db316 bugfixes in .gitlab-ci.yml 2017-10-12 10:30:40 +02:00
Sven Woop bc7296e128 some reorderings in .gitlab-ci.yml 2017-10-12 10:27:26 +02:00
Sven Woop a95a523255 running knl tests using docker 2017-10-12 09:48:23 +02:00
Sven Woop 703db81ae0 running skx tests on docker 2017-10-12 09:24:05 +02:00
Sven Woop 3d94159db8 setting name of artifacts to job name 2017-10-12 07:40:23 +02:00
Sven Woop 23c41e9a16 running ICC15 and ICC16 tests using CentOS 6.0 2017-10-12 07:32:40 +02:00
Sven Woop 7158614071 disabling address sanitizer intensive test 2017-10-12 07:29:28 +02:00
Sven Woop 0ba7f9c37a bugix in .gitlab-ci.yml 2017-10-12 07:27:55 +02:00
Sven Woop 51adb1b981 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-10-12 07:23:23 +02:00
Sven Woop c1e3794807 sending release artifacts always and let them expire in 2 months 2017-10-12 07:22:09 +02:00
Sven Woop 465c87dcd8 enabling RPM changelog again 2017-10-11 20:06:22 +02:00
Sven Woop b5098db771 Merge branch 'swoop' into devel 2017-10-11 19:28:46 +02:00
Sven Woop e3f63bce82 fixing RPM package name 2017-10-11 19:13:14 +02:00
Sven Woop 32cac1efb1 disabling RPM changelog, timestamp creates issues in CentOS 6.0 2017-10-11 18:45:25 +02:00
Sven Woop 3573480351 Revert "disabling RPM changelog, timestamp creates issues in CentOS 6.0"
This reverts commit 27d6b7b83d.
2017-10-11 14:48:38 +02:00
Sven Woop 9ca429aeae moving materialID into ISPCGeometry class 2017-10-11 14:48:28 +02:00
Sven Woop da5339089e disabling subdiv tests for viewer_stream, these are still 2017-10-11 14:39:26 +02:00
Sven Woop e1f9e585e6 adding CI tests for viewer_stream 2017-10-11 14:19:28 +02:00
Sven Woop c7b1fd47bb properly determining of OpenGL was found 2017-10-11 13:44:30 +02:00
Sven Woop cbc5fcaa66 regenerating tutorials works again 2017-10-11 13:32:11 +02:00
Sven Woop 27d6b7b83d disabling RPM changelog, timestamp creates issues in CentOS 6.0 2017-10-11 12:40:56 +02:00
Sven Woop 063f2e638a removed -g from ISPC compile flags to workaround ISPC 1.9.2 bug 2017-10-11 12:33:02 +02:00
Sven Woop 27eb99c55d improved error message when GLUT and OpenGL not found 2017-10-11 12:27:06 +02:00
Sven Woop 9113ed09db using proper ISPC version 2017-10-11 11:14:49 +02:00
Sven Woop ee09125573 cleanups to test.cmake 2017-10-11 10:10:53 +02:00
Sven Woop e2a757a562 bugfix in GLIBC version check in package_linux.sh script 2017-10-11 09:00:52 +02:00
Sven Woop 5176e2f9b2 fixed configuring TBB 2017-10-11 08:42:38 +02:00
Sven Woop ebbf4c48f5 bugfix in test.py script 2017-10-11 07:57:19 +02:00
Sven Woop abc751a5d5 using proper TBB version 2017-10-11 07:46:08 +02:00
atafra 36fd411e45 Merge remote-tracking branch 'origin/devel' into devel 2017-10-10 18:44:25 +03:00
atafra 0acacf383a frustum cleanups 2017-10-10 18:43:14 +03:00
atafra e68bc0504f coherent stream kernel cleanups 2017-10-10 18:04:31 +03:00
atafra 951e66c3c2 renamed, moved, and cleaned up Packet used in the coherent stream kernel 2017-10-10 17:59:01 +03:00
Sven Woop 45872fef9e further bugfix in release build 2017-10-10 16:15:14 +02:00
Sven Woop ad2934406d bugfix in release build 2017-10-10 16:05:57 +02:00
Sven Woop 0c20de4564 moved many CI tests to docker 2017-10-10 16:02:47 +02:00
Sven Woop 21622b2d1d building release under CentOS 6.0 using Docker container 2017-10-10 15:52:51 +02:00
Sven Woop 0e4a87cea6 enabled CI testing with Clang address sanitizer again 2017-10-10 13:43:22 +02:00
Sven Woop e558ac7a91 fixed memory leak in parallel radix sort in case exception was thrown 2017-10-10 13:32:36 +02:00
Sven Woop 1393105a6e Fixed raise condition that caused memory leak when using internal task scheduler
and rtcCommitJoin mode.
2017-10-10 12:45:49 +02:00
Sven Woop f4d6d661b6 fixed too small array size in feature_adaptive_eval_grid.h, we need to add padding as we operate with SIMD on this array 2017-10-10 11:57:16 +02:00
Sven Woop a3b3abc22e fixed wrong calculation of number of shading normals for subdiv meshes 2017-10-10 11:39:25 +02:00
Sven Woop 1c47d7593c fixed memory leak in scene.cpp 2017-10-10 11:16:50 +02:00
Sven Woop e67a6f07c1 enabling AVX2 again for linux distro tests 2017-10-10 09:00:32 +00:00
Sven Woop 5803218992 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-10-10 08:47:18 +00:00
Sven Woop ddc2ee8765 Removed explicit vzeroupper instructions as these called issues with GCC 7.
Further vzeroupper is anyway automatically added before function calls for AVX code,
thus there is no need to add them manually.
2017-10-10 08:45:13 +00:00
atafra 2c46238f97 minor cleanup 2017-10-09 23:00:42 +03:00
atafra 0b2290d31b fixed octant masking in hybrid intersect() 2017-10-09 22:52:00 +03:00
atafra c997c4b349 Merge remote-tracking branch 'origin/devel' into devel 2017-10-09 18:35:08 +03:00
atafra fc36364e46 minor single-ray traversal cleanup 2017-10-09 18:32:27 +03:00
atafra 6a1d8dafa9 added TravRayK, hybrid kernel cleanups 2017-10-09 17:52:12 +03:00
atafra b0faabe164 minor cleanup 2017-10-09 15:21:10 +03:00
Sven Woop 26530243dc disabling address sanitizer tests again, still failing 2017-10-09 12:10:27 +02:00
atafra 3e56e59dbe cleanups in frustum.h 2017-10-09 12:57:32 +03:00
atafra 390db3d4bc added comments 2017-10-09 12:52:19 +03:00
Sven Woop ee322bebfd fixing LINKER_LANGUAGE for some projects 2017-10-09 11:31:43 +02:00
Sven Woop 7d781307ba disabled continuous KNL tests 2017-10-09 11:01:08 +02:00
Sven Woop 8d7ae5392c properly distinguishing source and binary version of TBB for new TBB versions 2017-10-09 10:51:25 +02:00
Sven Woop 003cf7e127 enabled address sanitizer for continuous tests 2017-10-09 10:37:44 +02:00
Sven Woop 24684f2863 moved some code from scen_device.h to scene_device.cpp 2017-10-09 09:51:51 +02:00
Sven Woop 91944b1628 properly deleting lights 2017-10-09 09:12:10 +02:00
Sven Woop b7d4611379 hack to free ISPC lights again 2017-10-09 08:36:06 +02:00
Sven Woop d7f61b619c workaround for failing mem consumption test on KNL 2017-10-09 07:29:49 +02:00
Sven Woop 2b8b750d4a Revert "fixed to memory_consumption test"
This reverts commit fc028927f6.
2017-10-09 07:23:29 +02:00
Sven Woop 786cf56f8b fixed detection of Clang for new CMake versions 2017-10-09 07:06:10 +02:00
Sven Woop 9fa7490bf0 compile fix 2017-10-07 20:16:41 +02:00
Sven Woop 2261c29e18 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-10-07 19:11:49 +02:00
Sven Woop e0947e6318 testing SSE2 only on linux distros for now 2017-10-07 19:11:33 +02:00
atafra 6a77811ba9 moved tnear and tfar into TravRay 2017-10-07 14:33:20 +03:00
atafra bde87b1dd9 naming inconsistency fix 2017-10-07 12:08:51 +03:00
Sven Woop f35bfe49f2 Revert "hack to free ISPC lights again"
This reverts commit 41d1d557ee.
2017-10-07 08:49:41 +02:00
Sven Woop 04074d25ee bugfix in test.py 2017-10-06 19:52:49 +02:00
Sven Woop 266dcaad87 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-10-06 15:01:58 +02:00
Sven Woop 41d1d557ee hack to free ISPC lights again 2017-10-06 14:48:20 +02:00
atafra 12d12bc991 cleanup 2017-10-06 15:44:06 +03:00
Sven Woop 73313bd167 fixed memory leak in motion_blur_geometry tutorial 2017-10-06 14:42:59 +02:00
Sven Woop 7210ffabbe fixed memory leak in lazy_geometry tutorial 2017-10-06 14:31:46 +02:00
atafra 98be30f9da Merge remote-tracking branch 'origin/devel' into devel 2017-10-06 15:26:59 +03:00
atafra c9d3bae315 separated node intersectors into different files, renamed some files to improve consistency 2017-10-06 15:26:14 +03:00
Sven Woop 19714e038d fixed wrong buffer size in curve_geometry_tutorial 2017-10-06 14:20:21 +02:00
Sven Woop aeab922980 fixed memory leak in user_geometry_device tutorial 2017-10-06 14:09:38 +02:00
Sven Woop 27ed78adc6 disabled address sanitizer test again 2017-10-06 13:56:54 +02:00
Sven Woop 1add14cf82 cleanups in CI testing 2017-10-06 13:55:07 +02:00
Sven Woop 2ede4e24fa added tests with CLANG address sanitizer 2017-10-06 13:31:57 +02:00
Sven Woop 363fdf625c enabled continuous tests again, removing --docker option from test.py 2017-10-06 13:26:24 +02:00
Sven Woop 79c9ce44d3 more docker tests 2017-10-06 12:15:08 +02:00
Sven Woop fbdc2f1b46 more docker tests 2017-10-06 12:14:00 +02:00
Sven Woop 535de2714a docker tests 2017-10-06 11:44:11 +02:00
Sven Woop 47a498c314 docker tests 2017-10-06 11:43:58 +02:00
Sven Woop 9fd360ddf3 docker test 2017-10-06 11:38:19 +02:00
Sven Woop bd6a1b9e14 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-10-06 11:24:53 +02:00
Sven Woop 29a6c63a05 added address sanitizer cmake option for clang 2017-10-06 11:24:35 +02:00
Sven Woop 2d44c1c340 fixed potential memory leak when exception was thrown when using internal tasking system 2017-10-06 11:22:03 +02:00
Sven Woop 7b5569e4ae fixed 16 byte padding of some vertex arrays in verify 2017-10-06 11:08:02 +02:00
Sven Woop 27b8903017 fixed issue reported by clang address sanitizer 2017-10-06 10:55:18 +02:00
Sven Woop 87bda666b4 docker tests 2017-10-06 09:42:09 +02:00
Sven Woop e874f916c5 compile fix 2017-10-06 08:30:35 +02:00
Sven Woop edb57de000 memory consumption test reports more data when test fails 2017-10-06 07:51:39 +02:00
atafra 715d78e06b Merge remote-tracking branch 'origin/release' into devel 2017-10-06 01:05:58 +03:00
atafra 5abcd41a4b stream kernel cleanup 2017-10-06 01:03:43 +03:00
atafra 2b86282db0 minor stream kernel cleanup 2017-10-06 00:55:12 +03:00
Sven Woop 443ba4a51a enabled all continuous tests again 2017-10-05 19:16:18 +02:00
Sven Woop 7153d24f91 bugfix 2017-10-05 19:14:24 +02:00
Sven Woop 4378a9b14d checking of GLUT is found is not working yet 2017-10-05 19:13:34 +02:00
Sven Woop 4549d3fb9a updates 2017-10-05 18:57:58 +02:00
Sven Woop 13a8adf2dc updates 2017-10-05 18:56:38 +02:00
Sven Woop 7257d369b3 updates 2017-10-05 18:53:07 +02:00
atafra a2caad2543 updated StackItemMaskT 2017-10-05 18:13:35 +03:00
Sven Woop e7ea4b0caa updates 2017-10-05 15:25:31 +02:00
Sven Woop d0c105ec22 updates 2017-10-05 15:23:28 +02:00
Sven Woop d7457f0e4f updates 2017-10-05 15:09:16 +02:00
Sven Woop 84038a96e2 docker test 2017-10-05 14:12:12 +02:00
Sven Woop 731772fac0 docker test 2017-10-05 14:10:12 +02:00
Sven Woop eaaa3e8a7a docker test 2017-10-05 14:02:32 +02:00
Sven Woop 3373df95a6 docker test 2017-10-05 14:00:29 +02:00
Sven Woop ff195702e4 docker test 2017-10-05 13:58:00 +02:00
Sven Woop e7f8ad3690 docker test 2017-10-05 13:57:05 +02:00
Sven Woop 64afa7aa05 docker test 2017-10-05 13:55:55 +02:00
Sven Woop 4cbfe4226d docker test 2017-10-05 13:40:31 +02:00
Sven Woop 5e47d4c951 docker test 2017-10-05 13:39:37 +02:00
Sven Woop 22fd208f43 docker test 2017-10-05 13:37:10 +02:00
Sven Woop 49736bf8f8 docker test 2017-10-05 13:34:35 +02:00
Sven Woop 999fac4c6b docker test 2017-10-05 13:32:19 +02:00
Sven Woop e38af807ae docker test 2017-10-05 13:30:53 +02:00
Sven Woop 1c276740a1 docker test 2017-10-05 13:25:02 +02:00
Sven Woop 29e4a7f6cc docker test 2017-10-05 13:19:29 +02:00
Sven Woop 0209e71406 docker test 2017-10-05 13:14:40 +02:00
Sven Woop 6bca9cece0 docker test 2017-10-05 13:11:21 +02:00
Sven Woop 44b16a4d29 docker test 2017-10-05 13:10:42 +02:00
Sven Woop 42d73703d9 directly specifying ICC 2017-10-05 12:10:04 +02:00
Sven Woop 353e3cc164 directly specifying ICC 2017-10-05 12:07:51 +02:00
cbenthin 54f287207a sync with devel 2017-10-05 11:34:39 +02:00
cbenthin f12f81de51 Merge remote-tracking branch 'origin/devel' into devel3 2017-10-05 11:31:27 +02:00
Sven Woop 18826fba08 updates to .gitlab-ci.yml 2017-10-05 10:52:45 +02:00
Sven Woop 8fd4235bd9 not building tutorials when GLUT and OpenGL not found 2017-10-05 10:51:19 +02:00
Sven Woop 5370aaa4bf Merge branch 'devel' of https://github.com/embree/embree into devel 2017-10-05 10:42:11 +02:00
Sven Woop 22706dd7ca bugfix when interpolated shading normals are zero 2017-10-05 10:35:44 +02:00
Sven Woop 243a04fd38 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-10-05 09:14:48 +02:00
Sven Woop fc028927f6 fixed to memory_consumption test 2017-10-05 09:14:08 +02:00
Sven Woop 63b7ee111c CI tests 2017-10-05 08:07:56 +02:00
Sven Woop ebd67ebf57 CI tests 2017-10-05 07:41:47 +02:00
Sven Woop 41d9a48c57 CI tests 2017-10-05 07:38:44 +02:00
Sven Woop c91d0492c8 Revert "not building tutorials when GLUT and OpenGL not found"
This reverts commit db046182f0.
2017-10-04 20:28:18 +02:00
Sven Woop 9c63948322 removed some old NSIS stuff from CMake files 2017-10-04 11:58:39 +02:00
Sven Woop db046182f0 not building tutorials when GLUT and OpenGL not found 2017-10-04 11:56:31 +02:00
Sven Woop c0d6aba30a more debug output from test.cmake script 2017-10-04 11:07:48 +02:00
Sven Woop efab7d00b2 updates to .gitlab-ci.yml 2017-10-04 09:18:51 +02:00
Sven Woop c7163a5967 bugfix in accurateBounds function when compiled for KNL and SKX 2017-10-04 09:15:58 +02:00
Sven Woop 5c17fd4833 enabled verify test again, continous test get only run for pushes 2017-10-04 08:27:01 +02:00
cbenthin 73665c5247 updates to occlusion filter, mask input parameter should not be changed anymore 2017-10-03 23:06:49 +02:00
atafra cb559dbe90 fixed bug in BVH_MB flag 2017-10-02 13:25:49 +03:00
atafra dc961964ee cleanup 2017-10-01 16:16:20 +03:00
atafra cb1fb07edf cleanups 2017-10-01 16:05:16 +03:00
atafra d7ce521c89 fixed inefficiency in hybrid occluded_coherent() (~5% speedup) 2017-10-01 15:34:08 +03:00
atafra 3bf2e5d694 cleanup 2017-10-01 12:38:02 +03:00
atafra f3aa55fa73 cleanup 2017-09-30 16:52:52 +03:00
atafra d93226eedf cleanups 2017-09-30 15:03:18 +03:00
atafra 2d780d85fb hybrid occluded() cleanup 2017-09-30 14:21:46 +03:00
atafra e8aa112afa removed distance-based sorting from the hybrid occluded(), which improves performance significantly 2017-09-29 19:41:22 +03:00
Sven Woop 49872fd775 updates to .gitlab-ci.yml 2017-09-29 13:30:07 +02:00
Sven Woop 8824fc3c62 updates to .gitlab-ci.yml 2017-09-29 13:29:38 +02:00
Sven Woop 82e6788c84 docker tests 2017-09-29 11:17:36 +02:00
Sven Woop 621529b985 docker tests 2017-09-29 10:03:20 +02:00
Sven Woop b4c3cfcf70 updates to .gitlab-ci.yml 2017-09-29 09:10:35 +02:00
Sven Woop 76f13df892 windows build experiments 2017-09-29 09:05:49 +02:00
Sven Woop bec36b25fd more docker testing 2017-09-29 08:55:30 +02:00
Sven Woop 55edf7e92b new location for docker 2017-09-29 08:43:10 +02:00
Sven Woop 54f3ede6c6 compare experiments 2017-09-29 07:45:45 +02:00
Sven Woop 4d34dd3cb4 compare experiments 2017-09-29 07:28:53 +02:00
Sven Woop 97937c1776 compare experiments 2017-09-29 07:14:54 +02:00
Sven Woop d867f80c21 compare experiments 2017-09-29 07:14:29 +02:00
Sven Woop 958cedba81 merge 2017-09-29 07:12:02 +02:00
Sven Woop a6a3aa581d compare CI test 2017-09-29 07:11:22 +02:00
Sven Woop fd2649ab63 bugfix in viewer tests, viewer was passed as command line argument 2017-09-29 07:07:45 +02:00
Sven Woop 249a6beaa6 updates to test.cmake 2017-09-28 18:39:54 +02:00
Sven Woop faade958a0 updates to test.py 2017-09-28 18:17:35 +02:00
Sven Woop 9ccd2d9c03 updates to invoke_test.py, more debug outputs 2017-09-28 17:18:38 +02:00
Sven Woop 86d96005ed updates to .gitlab-ci.yml 2017-09-28 17:03:38 +02:00
Sven Woop f4280a1238 not using freeglut lib pragmas 2017-09-28 16:46:01 +02:00
Sven Woop 9402f63211 reverting invoke_test.py 2017-09-28 16:32:48 +02:00
Sven Woop dac24bbba1 updated tests 2017-09-28 14:53:17 +02:00
Sven Woop b131ea3c8c Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-28 14:33:55 +02:00
Johannes Günther f34b975536 More robust FindTBB 2017-09-28 14:11:02 +02:00
Sven Woop 2adb825771 updates to .gitlab-ci.yml 2017-09-28 11:36:15 +02:00
Sven Woop 0241c0e911 updates to .gitlab-ci.yml 2017-09-28 11:31:47 +02:00
Sven Woop d664621960 updates to .gitlab-ci.yml 2017-09-28 11:30:31 +02:00
Sven Woop 2825ea771f updates to .gitlab-ci.yml 2017-09-28 11:29:18 +02:00
cbenthin 946b22b6e0 fixed some missing RTCORE_API in ispc headers 2017-09-28 11:26:26 +02:00
Sven Woop 4934a9a369 added intensity cmake option 2017-09-28 11:23:27 +02:00
Sven Woop 7434b15721 added intensity cmake option 2017-09-28 11:19:45 +02:00
Sven Woop 67757ee34e added intensity cmake option 2017-09-28 11:17:42 +02:00
Sven Woop b79a185616 adding EMBREE_TESTING_INTENSITY 2017-09-28 11:00:37 +02:00
Sven Woop 30a9cbead1 updates to invoke_test.py 2017-09-28 09:38:06 +02:00
Sven Woop 60f1926864 added docker test 2017-09-28 09:24:19 +02:00
Sven Woop 1a33ecb2f9 updates to .gitlab-ci.yml 2017-09-28 08:03:22 +02:00
Sven Woop 124ff6912d updates to .gitlab-ci.yml 2017-09-28 07:59:27 +02:00
Sven Woop 0cdce1fe23 fixed some bugs in CI testing 2017-09-28 07:58:30 +02:00
Sven Woop 457483a01f fixed some bugs in CI testing 2017-09-28 07:56:50 +02:00
cbenthin 969da177c1 motion_blur_geometry_ispc works 2017-09-27 18:57:59 +02:00
cbenthin feb8498dbb lazy_geometry_ispc works now 2017-09-27 18:53:39 +02:00
cbenthin 9868338028 user_geometry_ispc working 2017-09-27 18:29:44 +02:00
cbenthin c41f85d36f only general RTCIntersectFuncN/RTCOccludedFuncN functions are now supported 2017-09-27 16:58:38 +02:00
Sven Woop 48b37a7b70 updates to .gitlab-ci.yml 2017-09-27 14:56:52 +02:00
Sven Woop 0515f3fea6 updates to .gitlab-ci.yml 2017-09-27 14:53:23 +02:00
Sven Woop a357bd1207 updates to .gitlab-ci.yml 2017-09-27 14:51:07 +02:00
Sven Woop abab4d1c33 updates to .gitlab-ci.yml 2017-09-27 14:45:43 +02:00
Sven Woop cc6d33f5c9 updates to .gitlab-ci.yml 2017-09-27 14:42:00 +02:00
Sven Woop 2703fb283b updates to .gitlab-ci.yml 2017-09-27 14:35:23 +02:00
Sven Woop 3951e2b64e updates to .gitlab-ci.yml 2017-09-27 14:31:27 +02:00
Sven Woop 6858715dec updates to .gitlab-ci.yml 2017-09-27 14:20:10 +02:00
Sven Woop a58494cd0e updates to .gitlab-ci.yml 2017-09-27 13:49:37 +02:00
Sven Woop 1b85509883 updates to .gitlab-ci.yml 2017-09-27 13:38:55 +02:00
Sven Woop 16f659e409 updates to .gitlab-ci.yml 2017-09-27 13:33:34 +02:00
Sven Woop b80940be56 updates to .gitlab-ci.yml 2017-09-27 13:25:39 +02:00
Sven Woop 98ec03dc7b updates to .gitlab-ci.yml 2017-09-27 13:22:10 +02:00
Sven Woop 57d95a7c41 updates to .gitlab-ci.yml 2017-09-27 13:17:35 +02:00
Sven Woop 64e29136eb updates to .gitlab-ci.yml 2017-09-27 13:16:42 +02:00
Sven Woop 3c5fdd3ed0 updates to .gitlab-ci.yml 2017-09-27 12:58:26 +02:00
cbenthin 793eb66559 new filter fcts for pathtracer_device.ispc 2017-09-27 11:51:29 +02:00
Sven Woop e46ee94ef4 updates to .gitlab-ci.yml 2017-09-27 11:31:02 +02:00
Sven Woop 6644f30f39 updates to .gitlab-ci.yml 2017-09-27 11:23:08 +02:00
cbenthin 54c665efe2 updates 2017-09-27 11:05:46 +02:00
Sven Woop c8e4110884 updates to .gitlab-ci.yml 2017-09-27 11:03:39 +02:00
Sven Woop 28a8377d7d updates to .gitlab-ci.yml 2017-09-27 10:53:50 +02:00
Sven Woop 1b4d5354bc updates to .gitlab-ci.yml 2017-09-27 10:52:02 +02:00
Sven Woop bd6087f58f updates to .gitlab-ci.yml 2017-09-27 10:49:50 +02:00
Sven Woop e993c13043 updates to .gitlab-ci.yml 2017-09-27 10:47:39 +02:00
Sven Woop 5352d50374 updates to .gitlab-ci.yml 2017-09-27 10:45:56 +02:00
Sven Woop c5d0619fdd updates to .gitlab-ci.yml 2017-09-27 10:42:30 +02:00
Sven Woop c8bc10f825 updates to .gitlab-ci.yml 2017-09-27 10:38:54 +02:00
Sven Woop 76fc190fec updates to .gitlab-ci.yml 2017-09-27 10:34:49 +02:00
Sven Woop b0351b8177 updates to .gitlab-ci.yml 2017-09-27 10:32:11 +02:00
Sven Woop 1e1b82d346 updates to .gitlab-ci.yml 2017-09-27 10:30:59 +02:00
Sven Woop f01ee267d4 updates to .gitlab-ci.yml 2017-09-27 10:29:06 +02:00
Sven Woop 77e5789fd5 updates to .gitlab-ci.yml 2017-09-27 10:26:35 +02:00
Sven Woop 482a0f558d updates to .gitlab-ci.yml 2017-09-27 10:24:57 +02:00
Sven Woop a95f9550b0 updates to .gitlab-ci.yml 2017-09-27 10:23:37 +02:00
Sven Woop fe28120cfe updates to .gitlab-ci.yml 2017-09-27 10:20:39 +02:00
cbenthin a96292cfa9 added fast path for ispc occlusion filter 2017-09-27 10:12:20 +02:00
Sven Woop 64595c1cf6 updates to .gitlab-ci.yml 2017-09-27 09:55:02 +02:00
Sven Woop 60a54bc184 updates to .gitlab-ci.yml 2017-09-27 09:54:28 +02:00
Sven Woop 68970980db updates to .gitlab-ci.yml 2017-09-27 09:47:39 +02:00
cbenthin 26ed014dd4 cleanups 2017-09-27 09:47:33 +02:00
Sven Woop 2509639c90 updates to .gitlab-ci.yml 2017-09-27 09:44:47 +02:00
Sven Woop 441f29fb16 updates to .gitlab-ci.yml 2017-09-27 09:44:15 +02:00
Sven Woop 1744ead51f updates to .gitlab-ci.yml 2017-09-27 09:41:22 +02:00
Sven Woop e7bbcc39f2 updates to .gitlab-ci.yml 2017-09-27 09:38:48 +02:00
Sven Woop 3ce3a8024b updates to .gitlab-ci.yml 2017-09-27 09:37:44 +02:00
Sven Woop ba07077b7e updates to .gitlab-ci.yml 2017-09-27 09:32:38 +02:00
Sven Woop a0f99f6471 updates to .gitlab-ci.yml 2017-09-27 09:29:30 +02:00
Sven Woop 19abcfc972 updates to .gitlab-ci.yml 2017-09-27 09:26:17 +02:00
Sven Woop 3a3d2c30ac updates to .gitlab-ci.yml 2017-09-27 09:25:01 +02:00
Sven Woop 790cb8a237 updates to .gitlab-ci.yml 2017-09-27 09:17:47 +02:00
Sven Woop c62e5d6c4e updates to .gitlab-ci.yml 2017-09-27 09:10:25 +02:00
Sven Woop 3b14164e58 updates to .gitlab-ci.yml 2017-09-27 09:01:15 +02:00
cbenthin 83f5487221 Merge remote-tracking branch 'origin/devel' into devel3 2017-09-27 08:56:26 +02:00
Sven Woop e95f89eafd updates to .gitlab-ci.yml 2017-09-27 08:47:06 +02:00
Sven Woop b03713d1c5 updates to .gitlab-ci.yml 2017-09-27 08:32:00 +02:00
Sven Woop da2ea49985 updates to .gitlab-ci.yml 2017-09-27 08:30:40 +02:00
Sven Woop 791e517dc4 updates to .gitlab-ci.yml 2017-09-27 08:27:38 +02:00
Sven Woop f2425cf81a updates to .gitlab-ci.yml 2017-09-27 08:25:02 +02:00
Sven Woop 3165f5ace6 updates to .gitlab-ci.yml 2017-09-27 08:20:12 +02:00
Sven Woop 3df6f333ad updates to .gitlab-ci.yml 2017-09-27 08:18:40 +02:00
Sven Woop 03b76ff02f updates to .gitlab-ci.yml 2017-09-27 08:16:09 +02:00
Sven Woop 0741f61825 updates to .gitlab-ci.yml 2017-09-27 08:13:42 +02:00
Sven Woop 642b76c07a updates to .gitlab-ci.yml 2017-09-27 08:12:16 +02:00
Sven Woop 55afef15c9 updates to .gitlab-ci.yml 2017-09-27 08:09:38 +02:00
Sven Woop 441de40bb4 updates to .gitlab-ci.yml 2017-09-27 08:08:05 +02:00
Sven Woop f2ae3ba435 updates to .gitlab-ci.yml 2017-09-27 08:06:53 +02:00
Sven Woop 0f991e8259 updates to .gitlab-ci.yml 2017-09-27 07:57:00 +02:00
cbenthin 5740bc2c72 updates 2017-09-26 18:59:03 +02:00
cbenthin 5c09beda8d fixed hair_geometry tutorial 2017-09-26 18:46:48 +02:00
cbenthin 4d3757c7f5 added fast path when N == programCount to intersection filter ispc 2017-09-26 18:29:20 +02:00
cbenthin af5f6b2da9 fixes and cleanups 2017-09-26 18:08:33 +02:00
cbenthin 22a4ba8791 fixed transpose in ray.h to accomodate for new ray layout 2017-09-26 18:03:07 +02:00
cbenthin deec581efd fixed 4,8-wide AOS transpose due to the new ray layout 2017-09-26 16:57:40 +02:00
Sven Woop 5e83c5623e updates to .gitlab-ci.yml 2017-09-26 15:48:34 +02:00
Sven Woop 6b6e10d779 updates to .gitlab-ci.yml 2017-09-26 15:44:10 +02:00
Sven Woop e484ec03cf updates to .gitlab-ci.yml 2017-09-26 15:36:10 +02:00
cbenthin 68d3571687 unified ray layout, added fast path for N == 1 to intersection_filter 2017-09-26 15:23:44 +02:00
Sven Woop 73288463a2 updates to .gitlab-ci.yml 2017-09-26 15:19:59 +02:00
Sven Woop e723d69fd6 updates to .gitlab-ci.yml 2017-09-26 15:09:47 +02:00
Sven Woop ad47a25a95 updates to .gitlab-ci.yml 2017-09-26 15:09:17 +02:00
Sven Woop e830368237 updates to .gitlab-ci.yml 2017-09-26 14:52:03 +02:00
Sven Woop c479917dbe updates to .gitlab-ci.yml 2017-09-26 14:46:33 +02:00
Sven Woop 54bd46dfa7 updates to .gitlab-ci.yml 2017-09-26 14:33:22 +02:00
Sven Woop e30d95408e updates to .gitlab-ci.yml 2017-09-26 14:31:19 +02:00
Sven Woop d91c94ba4f updates to .gitlab-ci.yml 2017-09-26 14:28:49 +02:00
Sven Woop a50afb4ba4 updates to .gitlab-ci.yml 2017-09-26 14:15:14 +02:00
Sven Woop c288f2b22e updates to .gitlab-ci.yml 2017-09-26 14:08:08 +02:00
Sven Woop 72822e253d updates to .gitlab-ci.yml 2017-09-26 13:53:06 +02:00
Sven Woop 8e06e3f253 updates to .gitlab-ci.yml 2017-09-26 13:51:23 +02:00
Sven Woop 6ae0919548 updates to .gitlab-ci.yml 2017-09-26 13:48:58 +02:00
Sven Woop 63e8b73853 updates to .gitlab-ci.yml 2017-09-26 13:45:29 +02:00
Sven Woop 1383e8316b updates to .gitlab-ci.yml 2017-09-26 13:42:59 +02:00
Sven Woop 6b5bcf93d2 updates to .gitlab-ci.yml 2017-09-26 13:40:32 +02:00
Sven Woop 434e8aefbb updates to .gitlab-ci.yml 2017-09-26 13:33:11 +02:00
Sven Woop 4ecc229938 updates to .gitlab-ci.yml 2017-09-26 13:30:29 +02:00
Sven Woop cdd5ca02ed updates to .gitlab-ci.yml 2017-09-26 13:28:08 +02:00
Sven Woop 2177d44af9 updates to .gitlab-ci.yml 2017-09-26 13:24:21 +02:00
Sven Woop c952070bd0 updates to .gitlab-ci.yml 2017-09-26 13:23:32 +02:00
Sven Woop d065ab22f7 updates to .gitlab-ci.yml 2017-09-26 13:13:51 +02:00
Sven Woop 4993b046e8 updates to .gitlab-ci.yml 2017-09-26 13:10:06 +02:00
Sven Woop 280c2a22d4 updates to .gitlab-ci.yml 2017-09-26 13:07:13 +02:00
Sven Woop 04e306f51d updates to .gitlab-ci.yml 2017-09-26 12:46:35 +02:00
Sven Woop 48f29b5f4e updates to .gitlab-ci.yml 2017-09-26 12:40:11 +02:00
Sven Woop eab26b1f79 updates to .gitlab-ci.yml 2017-09-26 12:37:25 +02:00
Sven Woop bb017f1533 updates to .gitlab-ci.yml 2017-09-26 12:35:06 +02:00
Sven Woop 9f3ae4ef77 updates to .gitlab-ci.yml 2017-09-26 12:24:06 +02:00
Sven Woop a677fa4d78 updates to .gitlab-ci.yml 2017-09-26 12:22:11 +02:00
Sven Woop fd1252baf9 updates to .gitlab-ci.yml 2017-09-26 12:19:14 +02:00
cbenthin 58d792c4f2 fixes 2017-09-26 12:09:54 +02:00
Sven Woop 528dfd03a5 updates to .gitlab-ci.yml 2017-09-26 12:06:15 +02:00
Sven Woop a74711e3ca updates to .gitlab-ci.yml 2017-09-26 12:05:20 +02:00
Sven Woop 1f626bfb33 updates to .gitlab-ci.yml 2017-09-26 12:01:59 +02:00
Sven Woop 987907579c updates to .gitlab-ci.yml 2017-09-26 12:00:32 +02:00
Sven Woop 973d084570 updates to .gitlab-ci.yml 2017-09-26 11:59:20 +02:00
Sven Woop e52248f568 updates to .gitlab-ci.yml 2017-09-26 11:53:39 +02:00
Sven Woop 0015fb9c6c updates to .gitlab-ci.yml 2017-09-26 11:52:56 +02:00
Sven Woop 600bf861d0 updates to .gitlab-ci.yml 2017-09-26 11:50:40 +02:00
Sven Woop 93c4a001ad updates to .gitlab-ci.yml 2017-09-26 11:46:58 +02:00
Johannes Günther b8c30540ba Let WIX set CMake registry ==> Embree will be found without embree_DIR 2017-09-26 11:43:36 +02:00
Sven Woop 78b0d65860 updates to .gitlab-ci.yml 2017-09-26 11:35:33 +02:00
Sven Woop c144a17824 updates to .gitlab-ci.yml 2017-09-26 11:21:21 +02:00
Sven Woop 83c2060a1c updates to .gitlab-ci.yml 2017-09-26 11:13:10 +02:00
Sven Woop 551c06668a updates to test.py 2017-09-26 11:06:01 +02:00
cbenthin d344a7ac4c fixed intersection_filter tutorial 2017-09-26 10:56:30 +02:00
Sven Woop a9404238f0 updates to test.py 2017-09-26 10:56:18 +02:00
Sven Woop cdb86d76d6 bugfix in ctest.cmake 2017-09-26 10:38:14 +02:00
cbenthin 4cbde0882c fixes 2017-09-26 10:32:15 +02:00
Sven Woop 786b131e9f printing proxy settings, faster tests 2017-09-26 10:28:19 +02:00
Sven Woop 42979151c2 added missing precompiled freeglut 3.0.0 library 2017-09-26 10:25:21 +02:00
Sven Woop 94c7c31771 checking error code in test.cmake 2017-09-26 10:09:04 +02:00
Sven Woop 7294976e82 updates to test.cmake 2017-09-26 09:55:48 +02:00
Sven Woop 171b440941 fixed TBB path under MacOSX and Windows 2017-09-26 09:42:18 +02:00
Sven Woop e8610e6886 enabled linux test 2017-09-26 09:20:14 +02:00
Sven Woop 6bafe12b19 replacing old freeglut with freeglut 3.0.0 2017-09-26 08:48:19 +02:00
Sven Woop eddd6117c8 using NAS also for testing under MacOSX 2017-09-26 07:20:37 +02:00
cbenthin a23f998e77 removed old intersection/occlusion filter 1/4/8/16 support, only supporting filterN interface, temporarely disabled filter functions in pathtracer and hair geometry tutorial 2017-09-25 15:37:34 +02:00
Sven Woop 33bd380a08 updates to test.py, disabling proxy under Windows 2017-09-25 12:10:38 +02:00
Sven Woop ff76dea7db updates to test.py, finding ispc and tbb under Windows 2017-09-25 11:44:56 +02:00
Sven Woop 5a893e0556 updates to .gitlab-ci.yml 2017-09-25 11:31:04 +02:00
Sven Woop b3e3c62ddc updates to .gitlab-ci.yml 2017-09-25 11:30:15 +02:00
Sven Woop e3c59bb56f updates to .gitlab-ci.yml 2017-09-25 11:29:26 +02:00
Sven Woop c5a9e7248e updates to .gitlab-ci.yml 2017-09-25 11:28:14 +02:00
Sven Woop a5d3ca562c updates to .gitlab-ci.yml 2017-09-25 11:25:26 +02:00
Sven Woop aa2f6fec01 updates to .gitlab-ci.yml 2017-09-25 11:24:00 +02:00
Sven Woop 7bef688a95 updates to .gitlab-ci.yml 2017-09-25 11:22:29 +02:00
Sven Woop fc15e5d184 updates to .gitlab-ci.yml 2017-09-25 11:10:03 +02:00
Sven Woop 379bbb42c8 updates to test.cmake 2017-09-25 10:13:38 +02:00
Sven Woop 7af24625ae updates to test.cmake 2017-09-25 09:54:37 +02:00
Sven Woop 32e723e2da updates to .gitlab-ci.yml 2017-09-25 09:31:41 +02:00
Sven Woop faaab25816 updates to .gitlab-ci.yml 2017-09-25 09:22:13 +02:00
Sven Woop 3b921c1944 updates to .gitlab-ci.yml 2017-09-25 09:17:16 +02:00
Sven Woop 4b078bb1bc package scripts properly return errors now 2017-09-25 08:39:56 +02:00
Sven Woop 66f21608e0 improved MacOSX uninstall script, calling rm and pkgutil using global path /bin/rm and /usr/sbin/pkgutil 2017-09-25 08:25:58 +02:00
Sven Woop c41d484595 Merge branch 'release' into devel 2017-09-25 07:37:54 +02:00
cbenthin 88b23dd622 merge with devel 2017-09-22 16:42:26 +02:00
Sven Woop c48d21814c updates 2017-09-22 15:09:48 +02:00
Sven Woop a7d313ad41 Merge branch 'release' into devel 2017-09-22 13:12:05 +02:00
Sven Woop fe52f5d6b7 setting version to v2.17.1-alpha.0 2017-09-22 13:11:57 +02:00
Sven Woop 729ece7292 update 2017-09-22 13:10:44 +02:00
Sven Woop 9722b4c30d Merge branch 'release' into devel 2017-09-22 12:21:36 +02:00
Sven Woop ed8ee37967 setting product and upgrade GUI for WiX 2017-09-22 12:02:50 +02:00
Sven Woop 7a50a2d692 WiX also installs Embree to Intel folder under Program Files 2017-09-22 11:52:19 +02:00
Sven Woop 357c6f24c5 no longer installing tbb.dll into lib folder (but only to bin folder) 2017-09-22 11:49:52 +02:00
Sven Woop 83fcf53b95 replaced NSIS by WiX to generate MSI installer for Windows 2017-09-22 11:47:13 +02:00
Sven Woop 2c724c529f fixed stripping of releases under MacOSX 2017-09-22 10:11:18 +02:00
Sven Woop 11b243931c added security comment to stipping of binaries 2017-09-22 09:08:15 +02:00
Sven Woop 28e11c9857 updates to release_win.bat, removed 32 bit build 2017-09-22 08:28:13 +02:00
Sven Woop 4c9c026a1b updates to release_win.bat, enabling stack protector for all builds 2017-09-22 08:27:30 +02:00
cbenthin 1fb988cd6b sync with master/release 2017-09-21 13:49:25 +02:00
Sven Woop d5ece51a4d converted all tutorials, did some bugfixes 2017-09-21 10:59:24 +02:00
Sven Woop c6498a29d0 compile fix for internal task scheduler 2017-09-21 07:19:34 +02:00
cbenthin fcd747217b set -inline-factor to 150 for the intel compiler to reduce compile times, moved mb builders from bvh_builder_hair.cpp into bvh_builder_hair_mb.cpp 2017-09-20 17:02:06 +02:00
Sven Woop b0768fdd0d converted some tutorials, did some bugfixes 2017-09-20 14:55:11 +02:00
Sven Woop 6bf725ba7c fixed compile issues with ICC and internal task scheduler 2017-09-20 14:14:46 +02:00
CDash e9a402ecd1 reduced inline-factor to 150 for intel compiler on mac os to prevent internal compiler error 2017-09-20 06:26:17 -05:00
Sven Woop 23b6ff263f all rtcNew API function return RTCGeometry type, many API functions get RTCGeometry as input 2017-09-20 11:57:21 +02:00
Sven Woop b41d26f50c renaming all rtcIntersectXEx API calls to rtcIntersectX 2017-09-20 10:14:44 +02:00
Sven Woop f5427f1d17 reference counting geometry class 2017-09-20 09:39:55 +02:00
Sven Woop 37e582c257 renamed rtcIntersect1Ex to rtcIntersect, renamed rtcOccluded1Ex to rtcOccluded1 2017-09-20 08:58:41 +02:00
Sven Woop d3b47d7c1a removed old style context free rtcIntersect and rtcOccluded API calls 2017-09-20 08:53:16 +02:00
Sven Woop a7dd991418 bugfix in test.py 2017-09-20 07:34:42 +02:00
Sven Woop 2f6af2832d updated documentation 2017-09-19 16:28:30 +02:00
Sven Woop 640c6daa85 setting version to 2.17.0 2017-09-19 16:27:07 +02:00
Sven Woop 512811023f bugfix in rtcOccluded1 and rtcOccluded1Ex API functions for ISPC 2017-09-19 12:11:35 +02:00
Sven Woop f4e26c2e3c cleanups in rtcore_ispc.cpp 2017-09-19 12:01:46 +02:00
Sven Woop b2f4a130bd using new RTC_VERTEX_BUFFER_(i) style to access i'th vertex buffer 2017-09-19 11:52:27 +02:00
Sven Woop ed0509b132 fixed constants of RTCBufferType 2017-09-19 11:34:39 +02:00
Sven Woop 2ef779c547 renamed rtcSetBoundsFunction3 to rtcSetBoundsFunction 2017-09-19 11:27:04 +02:00
Sven Woop cf84c93fc7 removed old rtcSetBounds API calls 2017-09-19 11:21:33 +02:00
Sven Woop c638488667 removed old rtcNewUserGeometry API calls 2017-09-19 10:58:08 +02:00
Sven Woop 2441823d7a declaring all ISPC API calls as extern C unmasked 2017-09-19 10:41:48 +02:00
Sven Woop c0a1dbb5d8 cleanups 2017-09-19 10:18:31 +02:00
Sven Woop 045c418031 fixed some Clang 5 compile warnings 2017-09-19 10:01:58 +02:00
Sven Woop 8956aee21c enabling stack protector for releases 2017-09-19 09:48:27 +02:00
Sven Woop 0d9bc8df72 enabled stack protector for releases 2017-09-19 09:45:43 +02:00
Sven Woop ca96c96cb3 disabled stack protector by default 2017-09-19 09:43:38 +02:00
Sven Woop 4c50caa6b1 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-19 09:19:21 +02:00
Sven Woop 9edba0f4ea reduced stack requirement for verify IntersectWithMode function 2017-09-19 09:19:06 +02:00
Sven Woop f4626bb22e reduced stack requirement for subdiv code 2017-09-19 09:18:44 +02:00
cbenthin 7d66ef477b fixed few msvc compile warnings 2017-09-18 05:49:12 -07:00
cbenthin 1b3b7ecb38 fixed few msvc compile warnings 2017-09-18 05:39:24 -07:00
Sven Woop d8b019b304 using proper size_t/ssize_t type in ISPC API headers 2017-09-18 11:55:30 +02:00
Sven Woop d532e721de fix in verify 2017-09-18 10:52:23 +02:00
Sven Woop 32ebce2f5f removed deprecated rtcNewScene API call 2017-09-18 10:38:11 +02:00
Sven Woop b98b464ab1 removed deprecated rtcNewHairGeometry and rtcNewCurveGeometry API calls 2017-09-18 10:33:26 +02:00
Sven Woop c6c1525ae8 removed old rtcSetBuffer API call 2017-09-18 10:21:21 +02:00
Sven Woop 1cafe84b0b renamed rtcSetTransform2 to rtcSetTransform 2017-09-18 09:04:37 +02:00
Sven Woop 46185dae68 removed deprecated rtcSetTransform API call 2017-09-18 09:01:41 +02:00
Sven Woop 2e89ce818d removed deprecated rtcNewInstance API call 2017-09-18 08:58:50 +02:00
Sven Woop d85cf668db renamed RTCDisplacementFunc2 to RTCDisplacementFunc 2017-09-18 08:54:06 +02:00
Sven Woop d8dcf755d8 removed old displacement API call 2017-09-18 08:47:24 +02:00
Sven Woop fb01923ae7 removed deprecated rtcSetBoundaryMode API function 2017-09-18 08:39:15 +02:00
Sven Woop 97435abef5 renamed ErrorFunc2 to ErrorFunc, renamed MemoryMonitorFunc2 to MemoryMonitorFunc 2017-09-18 08:34:38 +02:00
Sven Woop e8cc22f78c removed old memory monitor callback 2017-09-18 08:23:06 +02:00
Sven Woop 96b32159cf removed deprecated error function callback 2017-09-18 08:16:49 +02:00
Sven Woop c26978094f removed rtcInit/rtcExit and API functions that did not explicitely use device 2017-09-18 08:12:10 +02:00
Sven Woop d0ec5ff970 using pragma once in embree3 headers 2017-09-18 07:49:11 +02:00
Sven Woop e082712373 enabling stack protector by default 2017-09-18 07:05:17 +02:00
Sven Woop 185ffc39d3 added more tests to gitlab-ci 2017-09-15 14:47:28 +02:00
Sven Woop 3f4c6ac6e3 verbose=0 for tests 2017-09-15 14:20:21 +02:00
Sven Woop 5e3b4cf0e2 updates to CI 2017-09-15 14:11:40 +02:00
Sven Woop dec21a5f65 updates to CI 2017-09-15 14:08:14 +02:00
Sven Woop 2b0c400355 updates to CI 2017-09-15 14:06:52 +02:00
Sven Woop 058e820efb updates 2017-09-15 14:04:55 +02:00
Sven Woop d633a5541d updates to test.cmake 2017-09-15 13:59:16 +02:00
Sven Woop 563fa8b32c updates to test.cmake 2017-09-15 13:51:44 +02:00
Sven Woop 0894d751f1 updates to test.cmake 2017-09-15 13:50:45 +02:00
Sven Woop 23e8a0389d updates to test.cmake 2017-09-15 13:44:51 +02:00
Sven Woop 54f29c991b updates to test.cmake 2017-09-15 13:42:12 +02:00
Sven Woop fd3af84024 updates 2017-09-15 13:34:06 +02:00
Sven Woop a9a868f252 updates to test.cmake 2017-09-15 13:24:09 +02:00
Sven Woop 870e7adc71 updates to test.cmake 2017-09-15 13:19:25 +02:00
Sven Woop bec88b6568 Merge branch 'devel' of gitlab.com:embree/embree into devel 2017-09-15 13:13:16 +02:00
Sven Woop 85a6d9c54c updates to test.py 2017-09-15 13:11:35 +02:00
Sven Woop 63919c188c updates 2017-09-15 12:40:05 +02:00
Sven Woop 76892f8577 updates to test.py script 2017-09-15 12:38:12 +02:00
Sven Woop 44e783d59d updates to test.py 2017-09-15 12:31:08 +02:00
Sven Woop 0a642420af updates to test script 2017-09-15 12:25:20 +02:00
Sven Woop d208cbb4d9 added embree test scripts 2017-09-15 11:15:39 +02:00
Sven Woop 0419f1d8cc bugfix in FindTBB.cmake 2017-09-15 09:56:31 +02:00
Sven Woop c2309bbf79 updates to CI 2017-09-15 09:48:31 +02:00
Sven Woop e9149e8e9a added .gitlab-ci.yml with experimental settings 2017-09-15 09:30:26 +02:00
Sven Woop c15bb92593 Added support for BVH8 when AVX target was not enabled but targets higher than AVX.
Previously we did not use BVH8 in this case. This makes it e.g. possible to build
Embree properly for AVX2 only.
2017-09-15 08:51:35 +02:00
Sven Woop a1b56e8adc never enabling stack protector for traversal kernels 2017-09-14 13:38:38 +02:00
Sven Woop d85aea4c1a cleanups in frustum.h 2017-09-14 11:50:19 +02:00
Sven Woop 4498acd035 setting max internal stream size to 32 for 32 bit platforms 2017-09-14 11:43:56 +02:00
Sven Woop 152073d7ac cleanups 2017-09-14 11:42:43 +02:00
Sven Woop a90002157c cleanups in bvh_intersector_stream.h 2017-09-14 11:37:15 +02:00
Sven Woop f8c8d55c44 specializing frustum for robust and fast mode 2017-09-14 11:34:56 +02:00
Sven Woop 97600fb260 cleanups 2017-09-14 11:28:54 +02:00
Sven Woop b6d6cba2a2 specializing Packet for robust and non-robust mode 2017-09-14 11:23:27 +02:00
Sven Woop ead4835d35 cleanups in Packet class 2017-09-14 11:17:30 +02:00
Sven Woop eb4906c79c adding Packet constructor 2017-09-14 11:13:55 +02:00
Sven Woop 85b65574bb NearFarPreCompute no longer templated 2017-09-14 10:55:21 +02:00
Sven Woop 363c005f8e moved more code into packet struct 2017-09-14 10:42:48 +02:00
Sven Woop 4422ca608c re-using packet box test 2017-09-14 10:05:56 +02:00
Sven Woop d38ac50b2b moving packet intersection code to packet struct 2017-09-14 09:51:53 +02:00
Sven Woop 4d05b49867 moving Packet struct 2017-09-14 09:41:20 +02:00
Sven Woop a22e54cc49 cleanups 2017-09-14 09:36:44 +02:00
Sven Woop 46d131e056 re-using frustum intersection in stream frustum kernel 2017-09-14 09:36:06 +02:00
Sven Woop f1d23c57ed updates to frustum intersection interface 2017-09-14 09:30:53 +02:00
Sven Woop 265044e73f using new frustum struct in frustum stream traverser 2017-09-14 09:25:44 +02:00
Sven Woop ca84d3425e modifying frustum interface 2017-09-14 09:08:35 +02:00
Sven Woop 418ec0bdfb unifying frustm intersection interface 2017-09-14 08:52:45 +02:00
Sven Woop 2d1f8a6a97 updates to bvh_intersector_stream.h 2017-09-14 08:45:24 +02:00
Sven Woop 9813d6a6ee re-using NearFarPreCompute struct 2017-09-14 08:40:44 +02:00
Sven Woop 255ab75c5f first step to separate frustum structure 2017-09-14 08:26:45 +02:00
Sven Woop ece6b8345c removed unused file 2017-09-14 08:09:15 +02:00
Sven Woop 59ec5d0fcd Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-14 08:08:34 +02:00
Sven Woop 2cd05a8b2b Removing KNL optimization of frustum code for ray packet mode.
This caused a 5% slowdown, but frustum path is still significantly
faster (38%) than hybrid kernel. This change will make it easier
having a single frustum infrastructure for all frustum kernels.
2017-09-14 08:06:15 +02:00
cbenthin 08e54eb4c1 cleanups 2017-09-13 13:57:01 +02:00
cbenthin fb13a85505 cleanups 2017-09-13 13:45:46 +02:00
Sven Woop fb81cb34de removed no longer required packet fallback from bvh_intersector_stream.cpp 2017-09-13 12:27:02 +02:00
Sven Woop 3ceca55050 enabling stream kernels also for SSE, this codepath was already implemented but not selected 2017-09-13 12:20:48 +02:00
Sven Woop 87d45e6096 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-13 12:07:29 +02:00
Sven Woop 872ced9934 printing camera before rendering 2017-09-13 12:07:16 +02:00
cbenthin f987d717ef removed validIsec checks in stream filters 2017-09-13 12:01:59 +02:00
cbenthin 9b40fcb862 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-13 11:56:58 +02:00
cbenthin 19605e0738 added fallback to packet intersectorNs to isa namespaces, removed fallback in accel.h 2017-09-13 11:56:52 +02:00
Sven Woop fe56a4dc3c renames in bvh_intersector_hybrid.h 2017-09-13 11:55:53 +02:00
Sven Woop 4994f64729 implemented robust stream traversal 2017-09-13 11:29:08 +02:00
Sven Woop 7b4af861f4 adding first robust code to bvh_intersector_stream.h 2017-09-13 11:10:20 +02:00
Sven Woop 82ef698bcf Passing Accel::Intersectors* instead of BVH* to all intersector routines.
This way all intersectors can properly fallback to other interectors.

Moved intersect helper functions from Accel to Accel::Intersectors struct.

Fixed issue in stream kernels, that did fallback to packet traversal
using scene->intersect. This is wrong as causes iteration over all BVH
types again.
2017-09-13 08:59:00 +02:00
cbenthin ca70fc388b re-added accels.validIsecN test in stream filters otherwise verify crashes 2017-09-12 21:04:08 +02:00
Sven Woop ae06ac06a9 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-12 16:12:17 +02:00
Sven Woop e2656563b1 cleanups in stream filters, not isRobust and validISecN tests are not required 2017-09-12 16:12:04 +02:00
cbenthin 752e905ecc increased benchmark iterations for more consistent results 2017-09-12 15:17:45 +02:00
Sven Woop d9e046d0c3 cleanups 2017-09-12 12:58:17 +02:00
Sven Woop 5945b87db9 cleanups in bvh_intersector_stream.cpp 2017-09-12 12:26:40 +02:00
Sven Woop 0c92fff315 Removed MAX_RAYS_PER_OCTANT (we have no octant sorting anymore). Only using MAX_INTERNAL_STREAM_SIZE. 2017-09-12 12:24:50 +02:00
Sven Woop 360ad9d0c3 fixed interface of intersectN/occludedN functions to RayK<VSIZEX> 2017-09-12 12:03:52 +02:00
Sven Woop 6c34e0d090 variable renames in frustum traverser 2017-09-12 11:39:34 +02:00
Sven Woop 794d90069c variable renames in frustum traverser 2017-09-12 11:27:09 +02:00
Sven Woop fb8e4405c7 cleanups in frustum packet traverser, added docu to frustum packet traverser 2017-09-12 11:23:20 +02:00
Sven Woop 36d53847c7 cleanups 2017-09-12 09:45:06 +02:00
Sven Woop e45aabfb8a added docu to maxDepth BVH member 2017-09-12 09:12:14 +02:00
Sven Woop d66fbeb235 making occlusion rays always incoherent in pathtracer 2017-09-12 08:50:21 +02:00
Sven Woop af13b7704f adding coherent/incoherent tests for viewer and pathtracer 2017-09-12 08:38:29 +02:00
Sven Woop 649d39f3a8 coherent/incoherent mode can be set from command line for viewer 2017-09-12 08:30:27 +02:00
Sven Woop 9b3362a394 fixed warning 2017-09-12 08:15:40 +02:00
Sven Woop fdb80242af returning in feature_adaptive_eval for out of bounds subpatch ID 2017-09-12 08:14:24 +02:00
Sven Woop fa7d1b4f89 bugfix of potential out of range access in stringstream.h 2017-09-12 08:00:18 +02:00
cbenthin f6cdaeb732 added AVX512VL sorting code to both 4 and 8-wide code paths 2017-09-11 18:27:06 +02:00
cbenthin a9d59ed6c8 Merge remote-tracking branch 'origin/devel' into cbenthin 2017-09-11 17:21:34 +02:00
cbenthin 5633e5233d deactivating all prefetches for large nodes on Xeon but still keep L2 prefetches for KNL 2017-09-11 16:33:21 +02:00
cbenthin 2b681c5f27 removed implicit int->uint conversion in sorting code 2017-09-09 08:01:30 -05:00
cbenthin 8a8f7c78aa sync 2017-09-08 16:54:27 +02:00
Sven Woop 159e440014 updates klocwork server 2017-09-08 07:24:07 +02:00
atafra 04d8b88026 added transpose optimization for SKX 2017-09-07 18:03:21 +03:00
atafra 1f8e43141c removed unused node intersection code 2017-09-07 14:05:24 +03:00
Sven Woop 07c35e2ed2 change 2017-09-07 07:46:12 +02:00
Sven Woop a44f900b20 replaced unsigned -> unsigned int for ISPC 2017-09-07 07:12:28 +02:00
atafra 141aa737c6 minor cleanup 2017-09-07 01:41:55 +03:00
atafra f154b5f160 improved very slow fallback path in filterSOA so it's not slow anymore 2017-09-07 01:39:43 +03:00
atafra 7f82ff96ce fixes and cleanups in RayPacketSOA, RayStreamAOS, and RayStreamAOP 2017-09-07 01:26:26 +03:00
atafra 1112474494 filter cleanups 2017-09-06 13:23:57 +03:00
atafra b486e32e7c implemented coherent code path for filterAOS and filterAOP 2017-09-06 12:42:32 +03:00
cbenthin 8375fa6ddc invalidates occlusion rays inside packet/stream if geomID has already been set to 0 2017-09-05 19:13:14 +02:00
cbenthin 1c618498f1 more fixes in acceln 2017-09-05 18:51:38 +02:00
cbenthin 412f96bd78 fixes 2017-09-05 18:31:15 +02:00
cbenthin d29f6463fc rewrote early out for occlusion calls in acceln 2017-09-05 18:12:12 +02:00
cbenthin 83cf25ff11 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-05 18:06:32 +02:00
cbenthin 7502c34550 rewrote early out for occlusion calls in acceln 2017-09-05 18:06:28 +02:00
atafra e70e719de9 fixed the coherent path of filterSOP for streams having a size that is not a multiple of VSIZEX 2017-09-05 18:50:30 +03:00
atafra da88c40c5a Merge remote-tracking branch 'origin/devel' into devel 2017-09-05 18:39:07 +03:00
atafra 97d9c48aea filterSOA cleanups 2017-09-05 18:38:45 +03:00
cbenthin ff0adca3d2 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-05 16:38:19 +02:00
cbenthin 386aca9c02 cleanups 2017-09-05 16:38:13 +02:00
atafra 9f19cc077b removed AOS support from the stream kernels because filters always convert to SOA 2017-09-05 17:37:20 +03:00
atafra 9631f41e77 Merge remote-tracking branch 'origin/devel' into devel 2017-09-05 17:16:04 +03:00
atafra 9f034802bb filterSOP cleanup 2017-09-05 17:14:58 +03:00
cbenthin 437e87a931 bugfix in occluded coherent stream kernel when we have inactive rays, verify failed in this case 2017-09-05 15:07:29 +02:00
cbenthin 081a301f20 removed Ray** stuff no longer necessary 2017-09-05 13:18:15 +02:00
cbenthin 71495578a4 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-05 13:06:32 +02:00
cbenthin d2960b7b5c removed check for common octant and all rays active in filterSOACoherent as the stream kernel does this too and eventually falls back to packets 2017-09-05 13:06:13 +02:00
atafra 78a9ad27c3 added global "undefined" constant (UndefinedTy), replaced the static undefined() functions of the vector classes with constructors 2017-09-05 12:49:29 +03:00
atafra ecda1d8a44 Merge remote-tracking branch 'origin/devel' into devel 2017-09-05 12:39:19 +03:00
atafra 9da3d17093 removed unnecessary static constant functions (e.g. vfloat16::zero()) from some vector classes 2017-09-05 12:37:37 +03:00
cbenthin 8d0a5962a9 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-05 11:04:59 +02:00
cbenthin e9a41e05e1 replaced RTCRay** in intersectN/occludedN by void**, removed unused childID tracking in stream kernels, few minor fixes 2017-09-05 11:04:56 +02:00
Sven Woop 24e7f7e369 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-05 11:03:35 +02:00
Sven Woop 28737d9ee9 added more assertions to verify 2017-09-05 11:01:23 +02:00
atafra 6dafd1d4d3 cleanups 2017-09-05 11:51:28 +03:00
Sven Woop 6353759cce exception handling in case of task and closure stack overflow in internal task scheduler 2017-09-05 10:10:22 +02:00
Sven Woop fb0def1684 added assertions to StackArray in array.h 2017-09-05 10:02:36 +02:00
Sven Woop caea79c997 Bugfix in getExecutableFileName. We did not null terminate the returned string when the filename was too large. 2017-09-05 09:55:35 +02:00
Sven Woop c775d0de2e fixed potential out of bounds read/write in extract/insert functions in vuint4_sse2.h 2017-09-05 09:33:54 +02:00
Sven Woop 843d6dd4c8 better array size in foreach2 2017-09-05 09:32:30 +02:00
Sven Woop c935e0da39 fixed potential out of bounds read in vint4_sse2.h 2017-09-05 09:21:28 +02:00
Sven Woop d87d7df513 fixed potential out of bounds access in insert function in vfloat4_sse2.h 2017-09-05 09:17:03 +02:00
Sven Woop 77dc26ef4f fixed wrong assertion 2017-09-05 09:13:26 +02:00
cbenthin 8963303344 fixed avx512 icc compile bug 2017-09-05 09:12:19 +02:00
Sven Woop 746cadf4e4 fixed potential out of bounds read in stringstream.h 2017-09-05 09:11:13 +02:00
Sven Woop 417eb0d7b8 updates 2017-09-05 09:07:30 +02:00
Sven Woop 5d19c5bb68 fixed potential out of bounds read in tokenstream.h 2017-09-05 09:02:30 +02:00
Sven Woop b479fb5d9f bugfix in parallel_filter.h 2017-09-05 08:44:15 +02:00
Sven Woop 6901238ba7 updates 2017-09-05 07:26:55 +02:00
Sven Woop 0e296bba08 updates 2017-09-05 07:00:14 +02:00
atafra 01adb67d9f Merge remote-tracking branch 'origin/devel' into devel 2017-09-04 22:49:52 +03:00
atafra 305a169b01 gathers return zero where the mask is zero, to be consistent with the masked loads (but the compiler zeroed the result before gathering anyway) 2017-09-04 22:49:04 +03:00
cbenthin 6c598c3c35 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-04 18:42:22 +02:00
cbenthin 24b98e170e cleanups in defining/declaring stream intersectors 2017-09-04 18:42:14 +02:00
atafra b2bd8f62b2 Merge remote-tracking branch 'origin/devel' into devel 2017-09-04 18:23:03 +03:00
atafra 1d143a08dd added RayK::octant() helper function 2017-09-04 18:22:31 +03:00
cbenthin 23908e9c71 cleanups 2017-09-04 17:11:59 +02:00
cbenthin 9fc5e527e9 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-04 15:22:31 +02:00
cbenthin 5f13249d40 minor updates to make valgrind happy 2017-09-04 15:22:18 +02:00
Sven Woop 1a745a5d1d updates 2017-09-04 13:40:31 +02:00
Sven Woop 6cbc00fb19 updates 2017-09-04 13:37:32 +02:00
cbenthin ee3387e59d removed unused stream AOS traversal code 2017-09-02 20:37:21 +02:00
cbenthin fb7f022fc3 Merge remote-tracking branch 'origin/master' into devel 2017-09-02 20:29:57 +02:00
cbenthin fbeaa1002f bugfix in coherent stream traversal code: full stream-box culling before entering BVH leaves avoids ray order-dependent behaviour 2017-09-02 20:28:51 +02:00
atafra 9328d403ee cleanup 2017-09-02 15:05:46 +03:00
atafra 3e927e6874 stream filter cleanups 2017-09-02 15:04:47 +03:00
atafra 15a5d109c7 cleanup 2017-09-02 14:32:40 +03:00
atafra 96f8c8f414 added transpose optimization to RayStreamAOP 2017-09-02 13:37:08 +03:00
atafra 6e888ebdbf added RayStreamAOP, fixed name of RayPacketSOA 2017-09-02 12:31:56 +03:00
atafra ba945af43a RayStream class renamed to RayStreamFilter 2017-09-01 19:59:15 +03:00
atafra c62e54d720 ray helper cleanups 2017-09-01 19:50:31 +03:00
atafra d9763d57bf ray helper updates 2017-09-01 18:57:17 +03:00
atafra 299b53370d Merge remote-tracking branch 'origin/devel' into devel 2017-09-01 16:38:50 +03:00
atafra 61a0b1f35f fixed RayStream::filterAOP 2017-09-01 16:37:52 +03:00
cbenthin a8604e6a68 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-09-01 15:26:18 +02:00
cbenthin 5f1bc27167 removed most intersector1M functionality 2017-09-01 15:26:14 +02:00
atafra 620d45feb4 Merge remote-tracking branch 'origin/devel' into devel 2017-09-01 14:42:09 +03:00
atafra cb81b83199 minor optimization in RayStreamAOS 2017-09-01 14:40:11 +03:00
cbenthin 14813caba9 back conversion from packet to single etc now only updates geomID and others when geomID is not invalid, made this consistent in ray.h helpers 2017-09-01 13:34:40 +02:00
cbenthin 7bbd847b33 need to check for data alignment in filterSOA otherwise we can't directly use the input data as ray packets 2017-09-01 11:32:11 +02:00
cbenthin 32aa21e991 need to check for data alignment in filterSOA otherwise we can't directly use the input data as ray packets 2017-09-01 11:31:46 +02:00
cbenthin dea80f4954 replaced aligned loads by unaligned load in transpose code 2017-09-01 11:14:23 +02:00
cbenthin e1415c4474 added fallback for filterSOA when input packet size does not match VSIZEX 2017-09-01 11:13:29 +02:00
atafra fbbb077fb7 update 2017-09-01 03:09:32 +03:00
atafra 7d604fc519 moved ray AOS to SOA conversion into RayStreamAOS helper class 2017-09-01 03:02:59 +03:00
atafra e23b856425 Merge remote-tracking branch 'origin/devel' into devel 2017-09-01 01:18:35 +03:00
atafra 16872d6323 added packet fallback to RayStream::filterSOA, cleanups 2017-09-01 01:12:44 +03:00
cbenthin 1b82440464 minor fix 2017-08-31 21:13:16 +02:00
cbenthin 5ac4f24a6c removed now unused stream code 2017-08-31 20:49:10 +02:00
cbenthin 2d87a836dd replaced incoherent stream kernels with fallback to packets 2017-08-31 20:35:54 +02:00
atafra eea2e26f27 started cleaning up the stream helper classes 2017-08-31 19:04:02 +03:00
atafra 34a5076448 cleanup 2017-08-31 16:46:44 +03:00
atafra 8dcb052322 cleanup 2017-08-31 16:45:44 +03:00
atafra d3b5b12a5a cleanups 2017-08-31 13:14:55 +03:00
cbenthin c44b69807d Merge remote-tracking branch 'origin/master' into devel 2017-08-31 11:25:01 +02:00
cbenthin 5248d162d7 bugfix in coherent stream traversal code, making the traversal order independent with respect to the ordering of rays within the stream 2017-08-31 11:23:01 +02:00
atafra d3db45d710 cleanups 2017-08-31 02:57:57 +03:00
atafra 70a24218cf cleanups 2017-08-31 02:50:13 +03:00
atafra b2bc8807b5 SIMD wrapper cleanups 2017-08-31 02:46:41 +03:00
atafra db90caa563 SIMD wrapper cleanups 2017-08-31 01:58:58 +03:00
cbenthin 4837531a00 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-08-30 19:07:27 +02:00
cbenthin 4586f0bbb4 minor fixes 2017-08-30 19:07:15 +02:00
atafra 6db9a37056 cleanup 2017-08-30 16:18:39 +03:00
atafra 360ece9e98 Merge remote-tracking branch 'origin/devel' into devel 2017-08-30 16:06:48 +03:00
atafra a6dea3e220 added packet fallback to RayStream::filterAOP 2017-08-30 16:05:07 +03:00
atafra 10e494b220 fixed filtering of invalid rays in RayStream::filterAOS 2017-08-30 13:46:18 +03:00
CDash b57c862896 Merge branch 'devel' of https://github.com/embree/embree into devel 2017-08-30 05:44:06 -05:00
CDash 2fb5038a4e more fixes for clang 2017-08-30 05:43:59 -05:00
CDash 7cc0ed4dcb more fixes for old clang/macos combo 2017-08-30 05:33:04 -05:00
atafra 12e0435035 cleanup 2017-08-30 13:27:13 +03:00
atafra e5ccab49c2 cleanup 2017-08-30 13:24:43 +03:00
atafra c954c616a8 Merge remote-tracking branch 'origin/devel' into devel
Conflicts:
	common/simd/vfloat4_sse2.h
	common/simd/vint4_sse2.h
	common/simd/vuint4_sse2.h
2017-08-30 13:22:54 +03:00
atafra fd9674c6c0 fixed some SIMD gather functions 2017-08-30 13:18:20 +03:00
Carsten Benthin 71a828ebfd replaced undefined implementation for vint4/vuint4 to make older clang compilers happy 2017-08-30 10:44:51 +02:00
cbenthin 8ac982ad08 fixed compile errors with clang 4.0.0 2017-08-30 09:33:12 +02:00
atafra bf5af56f19 SIMD wrapper fixes 2017-08-30 01:50:52 +03:00
atafra 9a4aedeecb SIMD wrapper fixes, cleanups 2017-08-30 01:34:20 +03:00
atafra 26df12ba62 cleanups 2017-08-29 23:42:43 +03:00
atafra 20221e0fcd cleanups 2017-08-29 23:40:03 +03:00
atafra 17f16c7f13 fixed Vec3ba assignment operators 2017-08-29 23:39:36 +03:00
atafra c5c2493a80 cleanups 2017-08-29 23:33:31 +03:00
atafra 3e2a13182b fixed vbool assignment operators 2017-08-29 23:28:50 +03:00
atafra 34568ddfec SIMD wrapper cleanups 2017-08-29 23:24:00 +03:00
atafra 60838a7555 added comment 2017-08-29 21:45:00 +03:00
atafra d07c1c4e57 Merge remote-tracking branch 'origin/atafra3' into devel 2017-08-29 21:41:41 +03:00
atafra 601da2a282 cleanups 2017-08-29 21:41:16 +03:00
atafra 188388ce2f fix 2017-08-29 21:30:35 +03:00
atafra 6615050cf2 switched to gather/scatter in RayStream::filterAOS 2017-08-29 21:25:37 +03:00
atafra ef5aeb5065 added KNL code path for RayStream::filterAOS 2017-08-29 17:39:13 +03:00
atafra 9fcfb997e5 added 4x4 and 8x8 transpose funcs for vfloat16 2017-08-29 17:38:45 +03:00
atafra 06f7784f31 SIMD improvements and cleanups 2017-08-29 17:12:32 +03:00
atafra 7b4979c100 fixed incorrect and inconsistent shuffles in vdouble and vllong 2017-08-29 17:05:20 +03:00
atafra 90b83aea4b stream filter update 2017-08-29 12:38:26 +03:00
atafra 821c0d4d7c cleanup 2017-08-24 01:42:04 +03:00
atafra 2929c4d4a9 cleanup 2017-08-24 01:32:55 +03:00
atafra 199cbdba2f started implementing faster AOS<->SOA conversion in RayStream::filterAOS 2017-08-24 01:29:25 +03:00
atafra da71a4116a added transpose function 2017-08-24 01:26:13 +03:00
atafra 2a0ae0225a removed some experimental stream kernel code 2017-08-23 17:14:17 +03:00
atafra dc191dabcf added maskless gathers/scatters 2017-08-23 16:53:42 +03:00
atafra ccc00a7cc0 stream experiments 2017-08-23 13:58:20 +03:00
atafra 2908742a66 gatter/scatter cleanups 2017-08-22 18:20:16 +03:00
atafra d228ba1027 added stream to packet fallback (with and without octant sorting) 2017-08-21 17:38:20 +03:00
atafra 8ec7a998c9 Merge remote-tracking branch 'origin/devel' into atafra3 2017-08-16 13:32:23 +03:00
atafra 51c709a7da Merge remote-tracking branch 'origin/devel' into atafra3 2017-08-11 15:38:40 +03:00
atafra 12f3fe074e Merge remote-tracking branch 'origin/atafra3' into atafra3 2017-06-03 17:15:26 +03:00
atafra d0ae78e8c2 added stream sorting into octants for the packet fallback 2017-06-03 16:05:38 +03:00
atafra c624afc9af Merge remote-tracking branch 'origin/devel' into atafra3 2017-05-21 16:46:17 +03:00
atafra a62a51eb8a Merge remote-tracking branch 'origin/devel' into atafra3 2017-05-18 17:32:22 +03:00
atafra 72e0ebb1ca stream intersector experiments 2017-05-18 17:31:42 +03:00
920 changed files with 108499 additions and 54639 deletions

No files matched your search

+7
View File
@@ -5,3 +5,10 @@ x64
*.ncb
.*sw?
.DS_Store
kernels/config.h
kernels/hash.h
build
models
tbb
doc/intelstyle
+538
View File
@@ -0,0 +1,538 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
## You may obtain a copy of the License at ##
## ##
## http://www.apache.org/licenses/LICENSE-2.0 ##
## ##
## Unless required by applicable law or agreed to in writing, software ##
## distributed under the License is distributed on an "AS IS" BASIS, ##
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
## See the License for the specific language governing permissions and ##
## limitations under the License. ##
## ======================================================================== ##
#####################################################################
# Continuous Test
####################################################################
continuous-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
tags: [win7, v120]
only: [pushes]
#continuous-windows-Win32-RelWithDebInfo-V140-ISPC1.9.2-AVX2-TBB2017:
# script: "python scripts\\test.py platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:2"
# tags: [win7, v140]
# only: [pushes]
continuous-windows-x64-RelWithDebInfo-V141-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V141 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
tags: [win7, v141]
only: [pushes]
continuous-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
tags: [mac, clang]
only: [pushes]
continuous-linux-skx-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512SKX-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
tags: [docker, skx]
only: [pushes]
continuous-linux-skx-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512SKX-TBB2017:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
tags: [docker, skx]
only: [pushes]
#continuous-linux-knl-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512KNL-TBB2017:
# image: embreedocker/fedora:26
# script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
# tags: [docker-knl]
# only: [pushes]
continuous-linux-x64-RelWithDebInfo-CLANG5-ISPC1.9.2-AVX2-INT-ADDRSANITIZER:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG5 ispc:ispc1.9.2 isa:AVX2 tasking:INT intensity:1 addrsanitizer:ON"
tags: [docker]
only: [pushes]
continuous-ubuntu17.10-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/ubuntu:17.10
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [pushes]
continuous-centos7.4-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/centos:7.4
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [pushes]
continuous-fedora27-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
image: embreedocker/fedora:27
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX512SKX tasking:TBB intensity:3"
tags: [docker, skx]
only: [pushes]
continuous-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB-KLOCKWORK:
image: embree-kw-centos7
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB klocwork:ON intensity:0"
tags: [kw-scan-docker]
only: [pushes]
#####################################################################
# Intensive Nightly Tests
####################################################################
nightly-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-SSE2-INT:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:SSE2 tasking:INT intensity:4"
tags: [win7, v120]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-V120-ISPC1.9.2-AVX-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V120 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
tags: [win7, v120] # avx
only: [schedules]
nightly-windows-Win32-RelWithDebInfo-V140-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:Win32 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:2"
tags: [win7, v140]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-V140-ISPC1.9.2-AVX2-PPL:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:PPL intensity:4"
tags: [win7, v140] # avx2
only: [schedules]
nightly-windows-x64-RelWithDebInfo-V141-ISPC1.9.2-AVX2-TBB2017-STATIC:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:V140 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
tags: [win7, v141]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [win7, clang]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [win7, icc16]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [win7, icc17]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX2-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:3"
tags: [win7, icc18]
only: [schedules]
nightly-windows-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX512SKX-TBB2017:
script: "python scripts\\test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:1 sde:skx"
tags: [win7, icc18]
only: [schedules]
# CLANG compilation and testing of different ISAs
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-SSE2-TBB2017:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
tags: [mac, clang]
only: [schedules]
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX-INT:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX tasking:INT intensity:4"
tags: [mac, clang] # avx
only: [schedules]
nightly-macosx-x64-RelWithDebInfo-CLANG-ISPC1.9.2-AVX2-TBB2017-STATIC:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
tags: [mac, clang] # avx2
only: [schedules]
# ICC compilation and testing of different ISAs
nightly-macosx-x64-RelWithDebInfo-ICC15-ISPC1.9.2-AVX-INT:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC15 ispc:ispc1.9.2 isa:AVX tasking:INT intensity:4"
tags: [mac, icc15]
only: [schedules]
nightly-macosx-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX2-TBB2017:
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [mac, icc16]
only: [schedules]
# CLANG compilation and testing of different ISAs
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-SSE2-TBB:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX-TBB2017-VALGRIND:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4 memcheck:ON"
tags: [docker] # avx
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG5-ISPC1.9.2-AVX2-INT-ADDRSANITIZER:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG5 ispc:ispc1.9.2 isa:AVX2 tasking:INT intensity:2 addrsanitizer:ON"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-STATIC:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4 STATIC_LIB:ON"
tags: [docker] # avx2
only: [schedules]
nightly-linux-knl-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512KNL-TBB2017:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
tags: [docker-knl]
only: [schedules]
nightly-linux-skx-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX512SKX-TBB2017:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:3"
tags: [docker, skx]
only: [schedules]
# GCC compilation and testing of different ISAs
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-SSE2-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
tags: [docker] # avx
only: [schedules]
nightly-linux-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [docker] # avx2
only: [schedules]
# ICC compilation and testing of different ISAs
nightly-linux-x64-RelWithDebInfo-ICC15-ISPC1.9.2-SSE2-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC15 ispc:ispc1.9.2 isa:SSE2 tasking:TBB2017 intensity:4"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-ICC16-ISPC1.9.2-AVX-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC16 ispc:ispc1.9.2 isa:AVX tasking:TBB2017 intensity:4"
tags: [docker] # avx
only: [schedules]
nightly-linux-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX2-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [docker] # avx2
only: [schedules]
nightly-linux-knl-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512KNL-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512KNL tasking:TBB2017 intensity:3"
tags: [docker-knl]
only: [schedules]
nightly-linux-skx-x64-RelWithDebInfo-ICC17-ISPC1.9.2-AVX512SKX-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:4"
tags: [docker, skx]
only: [schedules]
nightly-linux-skx-x64-RelWithDebInfo-ICC18-ISPC1.9.2-AVX512SKX-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC18 ispc:ispc1.9.2 isa:AVX512SKX tasking:TBB2017 intensity:4"
tags: [docker, skx]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-ICC19-ISPC1.9.2-AVX2-TBB2017:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC19 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 intensity:4"
tags: [docker] # avx2
only: [schedules]
# Testing on different Linux distributions
nightly-ubuntu17.10-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/ubuntu:17.10
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-ubuntu16.04-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/ubuntu:16.04
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-centos7.4-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/centos:7.4
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-centos7.0-x64-RelWithDebInfo-GCC-ISPC1.9.2-AVX2-TBB:
image: embreedocker/centos:7.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-centos6.0-x64-RelWithDebInfo-GCC4.8.2-ISPC1.9.2-AVX2-TBB:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc1.9.2 isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-fedora28-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
image: embreedocker/fedora:28
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB intensity:3" # AVX512KNL triggers internal compiler bug in GCC 8.0.1
tags: [docker, skx]
only: [schedules]
nightly-fedora27-x64-RelWithDebInfo-GCC-ISPC-AVX512SKX-TBB:
image: embreedocker/fedora:27
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX512SKX tasking:TBB intensity:3"
tags: [docker, skx]
only: [schedules]
nightly-fedora26-x64-RelWithDebInfo-GCC-ISPC-AVX2-TBB:
image: embreedocker/fedora:26
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
nightly-fedora25-x64-RelWithDebInfo-GCC-ISPC-AVX2-TBB:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC ispc:ispc isa:AVX2 tasking:TBB intensity:3"
tags: [docker]
only: [schedules]
# Compilation test of disabled features
nightly-linux-x64-RelWithDebInfo-CLANG4-AVX2-TBB2017-NO-ISPC:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 ISPC_SUPPORT:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-TUTORIALS:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TUTORIALS:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-BACKFACECULLING:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 BACKFACE_CULLING:ON intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-IGNORE-INVALID-RAYS:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 IGNORE_INVALID_RAYS:ON intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-FILTER-FUNCTION:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 FILTER_FUNCTION:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-RAYMASKS:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 RAY_MASK:ON intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-NO-PACKETS:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 RAY_PACKETS:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-STATCOUNTER:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 STAT_COUNTER:ON intensity:0"
tags: [docker]
only: [schedules]
# Compilation test of individual ISAs
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-SSE2-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:SSE2 tasking:TBB2017 intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-SSE42-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:SSE42 tasking:TBB2017 intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX tasking:TBB2017 intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX2-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX2 tasking:TBB2017 intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-ISAS-AVX512SKX-TBB2017:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isas:AVX512SKX tasking:TBB2017 intensity:0"
tags: [docker]
only: [schedules]
# Compilation test of individual primitive types enabled
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-TRI:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-QUAD:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:OFF QUAD:ON GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-GRID:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:OFF QUAD:OFF GRID:ON CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-CURVE:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:ON SUBDIV:OFF USERGEOM:OFF INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-SUBDIV:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:ON USERGEOM:OFF INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-USERGEOM:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:ON INSTANCE:OFF intensity:0"
tags: [docker]
only: [schedules]
nightly-linux-x64-RelWithDebInfo-CLANG4-ISPC1.9.2-AVX2-TBB2017-INSTANCE:
image: embreedocker/fedora:25
script: "scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 ispc:ispc1.9.2 isa:AVX2 tasking:TBB2017 TRI:ON QUAD:OFF GRID:OFF CURVE:OFF SUBDIV:OFF USERGEOM:OFF INSTANCE:ON intensity:0"
tags: [docker]
only: [schedules]
#####################################################################
# Release Builds
####################################################################
release-windows-x64-Release-ICC17-VC12-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17-VC12 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
tags: [win7, icc17]
only: [web]
artifacts:
name: "$env:CI_JOB_NAME"
paths: [build/*.zip]
when: always
expire_in: 2 mos
release-windows-x64-Release-ICC17-VC14-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17-VC14 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
tags: [win7, icc17]
only: [web]
artifacts:
name: "$env:CI_JOB_NAME"
paths: [build/*.zip]
when: always
expire_in: 2 mos
release-windows-x64-Release-ICC17-ISPC1.9.2-TBB2017-PACKAGE-MSI:
script: "python scripts\\test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512SKX tasking:TBB2017 intensity:4 package:MSI"
tags: [win7, icc17]
only: [web]
artifacts:
name: "$env:CI_JOB_NAME"
paths: [build/*.msi]
when: always
expire_in: 2 mos
release-macosx-x64-Release-ICC16-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
script: "scripts/test.py platform:x64 build:Release compiler:ICC16 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2 tasking:TBB2017 intensity:4 package:ZIP"
tags: [mac, icc16]
only: [web]
artifacts:
name: "$CI_JOB_NAME"
paths: [build/*.tar.gz]
when: always
expire_in: 2 mos
release-macosx-x64-Release-ICC16-ISPC1.9.2-TBB-PACKAGE-PKG:
script: "scripts/test.py platform:x64 build:Release compiler:ICC16 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2 tasking:TBB intensity:4 package:PKG"
tags: [mac, icc16]
only: [web]
artifacts:
name: "$CI_JOB_NAME"
paths: [build/*.pkg]
when: always
expire_in: 2 mos
release-linux-x64-Release-ICC17-ISPC1.9.2-TBB2017-PACKAGE-ZIP:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512KNL-AVX512SKX tasking:TBB2017 intensity:4 package:ZIP"
tags: [docker]
only: [web]
artifacts:
name: "$CI_JOB_NAME"
paths: [build/*.tar.gz]
when: always
expire_in: 2 mos
release-linux-x64-Release-ICC17-ISPC1.9.2-TBB-PACKAGE-RPM:
image: embreedocker/centos:6.0
script: "scripts/test.py platform:x64 build:Release compiler:ICC17 ispc:ispc1.9.2 isas:SSE2-SSE42-AVX-AVX2-AVX512KNL-AVX512SKX tasking:TBB intensity:4 package:RPM"
tags: [docker]
only: [web]
artifacts:
name: "$CI_JOB_NAME"
paths: [build/*.tar.gz]
when: always
expire_in: 2 mos
+173 -2
View File
@@ -1,6 +1,176 @@
Version History
---------------
### New Features in Embree 3.3.0
- Added support for motion blur time range per geometry. This way geometries
can appear and disappear during the camera shutter and time steps do not have
to start and end at camera shutter interval boundaries.
- Fixed crash with pathtracer when using --triangle-sphere command line.
- Fixed crash with pathtracer when using --shader ao command line.
- Fixed tutorials showing a black window on macOS 10.14 until moved.
### New Features in Embree 3.2.4
- Fixed compile issues with ICC 2019.
- Released ZIP files for Windows are now provided in a
version linked against Visual Studio 2013 and Visual Studio 2015.
### New Features in Embree 3.2.3
- Fixed crash when using curves with RTC_SCENE_FLAG_DYNAMIC
combined with RTC_BUILD_QUALITY_MEDIUM.
### New Features in Embree 3.2.2
- Fixed intersection distance for unnormalized rays with line segments.
- Removed libmmd.dll dependency in release builds for Windows.
- Fixed detection of AppleClang compiler under MacOSX.
### New Features in Embree 3.2.1
- Bugfix in flat mode for hermite curves.
- Added EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR cmake option to
control self intersection avoidance for flat curves.
- Performance fix when instantiating motion blurred scenes. The application
should best use two (or more) time steps for an instance that instantiates
a motion blurred scene.
- Fixed AVX512 compile issue with GCC 6.1.1.
- Fixed performance issue with rtcGetGeometryUserData when used
during rendering.
- Bugfix in length of derivatives for grid geometry.
- Added BVH8 support for motion blurred curves and lines. For some workloads
this increases performance by up to 7%.
- Fixed rtcGetGeometryTransform to return the local to world transform.
- Fixed bug in multi segment motion blur that caused missing of perfectly
axis aligned geometry.
- Reduced memory consumption of small scenes by 4x.
- Reduced temporal storage of grid builder.
### New Features in Embree 3.2.0
- Improved watertightness of robust mode.
- Line segments, and other curves are now all contained in a single
BVH which improves performance when these are both used in a scene.
- Performance improvement of up to 20% for line segments.
- Bugfix to Embree2 to Embree3 conversion script.
- Added support for Hermite curve basis.
- Semantics of normal buffer for normal oriented curves has
changed to simplify usage. Please see documentation for details.
- Using GLFW and imgui in tutorials.
- Fixed floating point exception in static variable initialization.
- Fixed invalid memory access in rtcGetGeometryTransform for non-motion
blur instances.
- Improved self intersection avoidance for flat curves. Transparency rays
with tnear set to previous hit distance do not need curve radius
based self intersection avoidance as same hit is calculated again. For this
reason self intersection avoidance is now only applied to ray origin.
### New Features in Embree 3.1.0
- Added new normal-oriented curve primitive for ray tracing of grass-like
structures.
- Added new grid primitive for ray tracing tessellated and displaced surfaces
in very memory efficient manner.
- Fixed bug of ribbon curve intersector when derivative was zero.
- Installing all static libraries when EMBREE_STATIC_LIB is enabled.
- Added API functions to access topology of subdivision mesh.
- Reduced memory consumption of instances.
- Improved performance of instances by 8%.
- Reduced memory consumption of curves by up to 2x.
- Up to 5% higher performance on AVX-512 architectures.
- Added native support for multiple curve basis functions. Internal
basis conversions are no longer performed, which saves additional
memory when multiple bases are used.
- Fixed issue with non thread safe local static variable initialization
in VS2013.
- Bugfix in rtcSetNewGeometry. Vertex buffers did not get properly
overallocated.
- Replaced ImageMagick with OpenImageIO in the tutorials.
### New Features in Embree 3.0.0
- Switched to a new version of the API which provides improved
flexibility but is not backward compatible. Please see "Upgrading
from Embree 2 to Embree 3" section of the documentation for upgrade
instructions. In particular, we provide a Python script that performs
most of the transition work.
- User geometries inside an instanced scene and a top-level scene no
longer need to handle the instID field of the ray differently. They
both just need to copy the context.instID into the ray.instID field.
- Support for context filter functions that can be assigned to a ray
query.
- User geometries can now invoke filter functions using the
rtcFilterIntersection and rtcFilterOcclusion calls.
- Higher flexibility through specifying build quality per scene and
geometry.
- Geometry normal uses commonly used right-hand rule from now on.
- Added self-intersection avoidance to ribbon curves and lines.
Applications do not have to implement self-intersection workarounds
for these primitive types anymore.
- Added support for 4 billion primitives in a single scene.
- Removed the RTC_MAX_USER_VERTEX_BUFFERS and RTC_MAX_INDEX_BUFFERS
limitations.
- Reduced memory consumption by 192 bytes per instance.
- Fixed some performance issues on AVX-512 architectures.
- Individual Contributor License Agreement (ICLA) and Corporate
Contributor License Agreement (CCLA) no longer required to
contribute to the project.
### New Features in Embree 2.17.5
- Improved watertightness of robust mode.
- Fixed floating point exception in static variable initialization.
- Fixed AVX512 compile issue with GCC 6.1.1.
### New Features in Embree 2.17.4
- Fixed AVX512 compile issue with GCC 7.
- Fixed issue with not thread safe local static variable
initialization in VS2013.
- Fixed bug in the 4 and 8-wide packet intersection of instances with
multi-segment motion blur on AVX-512 architectures.
- Fixed bug in rtcOccluded4/8/16 when only AVX-512 ISA was enabled.
### New Features in Embree 2.17.3
- Fixed GCC compile warning in debug mode.
- Fixed bug of ribbon curve intersector when derivative was zero.
- Installing all static libraries when EMBREE_STATIC_LIB is enabled.
### New Features in Embree 2.17.2
- Made BVH build of curve geometry deterministic.
### New Features in Embree 2.17.1
- Improved performance of occlusion ray packets by up to 50%.
- Fixed detection of Clang for CMake 3 under MacOSX
- Fixed AVX code compilation issue with GCC 7 compiler caused by
explicit use of vzeroupper intrinsics.
- Fixed an issue where Clang address sanitizer reported an error in
the internal tasking system.
- Added fix to compile on 32 bit Linux distribution.
- Fixed some wrong relative include paths in Embree.
- Improved performance of robust single ray mode by 5%.
- Added EMBREE_INSTALL_DEPENDENCIES option (default OFF) to enable
installing of Embree dependencies.
- Fixed performance regression for occlusion ray streams.
- Reduced temporary memory requirements of BVH builder for curves and
line segments.
- Fixed performance regression for user geometries and packet ray tracing.
- Fixed bug where wrong closest hit was reported for very curvy hair segment.
### New Features in Embree 2.17.0
- Improved packet ray tracing performance for coherent rays by 10-60%
(requires RTC_INTERSECT_COHERENT flag).
- Improved ray tracing performance for incoherent rays on
AVX-512 architectures by 5%.
- Improved ray tracing performance for streams of incoherent rays
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
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
change. If you want stack-protectors disabled please turn off
EMBREE_STACK_PROTECTOR in cmake and build the binaries yourself.
- When enabling ISAs individually, the 8-wide BVH was previously only
available when the AVX ISA was also selected. This issue is now
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.
- Providing MSI installer for Windows.
### New Features in Embree 2.16.5
- Bugfix in the robust triangle intersector that rarely caused NaNs.
- Fixed bug in hybrid traversal kernel when BVH leaf was entered with no
@@ -84,7 +254,7 @@ Version History
- Removed support for Visual Studio 2012.
- Precompiled binaries now require a CPU supporting at least the
SSE4.2 ISA.
- We no longer provide precompiled binaries for 32 bit on Windows.
- We no longer provide precompiled binaries for 32-bit on Windows.
- Under Windows one now has to use the platform toolset option in
CMake to switch to Clang or the Intel® Compiler.
- Fixed a bug for subdivision meshes when using the incoherent scene
@@ -394,7 +564,7 @@ Version History
- Improved mixed AABB/OBB-BVH for hair geometry (Xeon Phi)
- Reduced amount of pre-allocated memory for BVH builders (Xeon Phi)
- New 64 bit Morton code-based BVH builder (Xeon Phi)
- New 64-bit Morton code-based BVH builder (Xeon Phi)
- (Enhanced) Morton code-based BVH builders use now tree rotations to
improve BVH quality (Xeon Phi)
- Bug fixes (Xeon and Xeon Phi)
@@ -458,3 +628,4 @@ Version History
- Integration with the Intel® SPMD Program Compiler (ISPC)
- Instantiation and fast BVH reconstruction
- Example photo-realistic rendering engine for both C++ and ISPC
+130 -92
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,10 +14,11 @@
## limitations under the License. ##
## ======================================================================== ##
SET(EMBREE_VERSION_MAJOR 2)
SET(EMBREE_VERSION_MINOR 17)
SET(EMBREE_VERSION_MAJOR 3)
SET(EMBREE_VERSION_MINOR 3)
SET(EMBREE_VERSION_PATCH 0)
SET(EMBREE_VERSION_NOTE "-alpha.0")
SET(EMBREE_VERSION_NOTE "")
SET(EMBREE_VERSION ${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}.${EMBREE_VERSION_PATCH})
MATH(EXPR EMBREE_VERSION_NUMBER "10000*${EMBREE_VERSION_MAJOR} + 100*${EMBREE_VERSION_MINOR} + ${EMBREE_VERSION_PATCH}")
SET(CPACK_RPM_PACKAGE_RELEASE 1)
@@ -26,6 +27,25 @@ PROJECT(embree${EMBREE_VERSION_MAJOR})
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
MACRO (SIGN_TARGET target)
IF (EMBREE_SIGN_FILE)
IF (WIN32)
# on Windows we only strip as debug symbols not included in binary
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${EMBREE_SIGN_FILE} -vv -c embree $<TARGET_FILE:${target}>)
ELSEIF (APPLE)
# on MacOSX we strip and sign
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_STRIP} -x $<TARGET_FILE:${target}>
COMMAND ${EMBREE_SIGN_FILE} -vv -c embree $<TARGET_FILE:${target}>)
ELSE()
# on Linux just strip as signing not supported
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_STRIP} -x $<TARGET_FILE:${target}>)
ENDIF()
ENDIF()
ENDMACRO()
# find git version
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
FIND_PACKAGE(Git)
@@ -43,20 +63,19 @@ ENDIF()
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/rtcore_version.h.in"
"${PROJECT_SOURCE_DIR}/include/embree2/rtcore_version.h"
"${PROJECT_SOURCE_DIR}/include/embree3/rtcore_version.h"
)
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/hash.h.in"
"${PROJECT_BINARY_DIR}/hash.h"
"${PROJECT_SOURCE_DIR}/kernels/hash.h"
)
FILE(WRITE "${PROJECT_BINARY_DIR}/hash" "${EMBREE_HASH}")
IF(COMMAND cmake_policy)
if (POLICY CMP0003)
cmake_policy(SET CMP0003 NEW)
endif()
if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
cmake_policy(SET CMP0042 NEW)
endif()
ENDIF(COMMAND cmake_policy)
@@ -68,7 +87,6 @@ MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES)
MARK_AS_ADVANCED(CMAKE_OSX_DEPLOYMENT_TARGET)
MARK_AS_ADVANCED(CMAKE_OSX_SYSROOT)
MARK_AS_ADVANCED(CLEAR CMAKE_CXX_COMPILER)
MARK_AS_ADVANCED(GLUT_cocoa_LIBRARY)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/common/cmake ${CMAKE_MODULE_PATH})
@@ -99,30 +117,27 @@ OPTION(EMBREE_TUTORIALS "Enable to build Embree tutorials" ON)
##############################################################################
# Configurations (add configurations also to common/cmake/embree-config-default.cmake)
OPTION(EMBREE_INSTALL_DEPENDENCIES "Install Embree dependencies in binary packages and install" OFF)
MARK_AS_ADVANCED(EMBREE_INSTALL_DEPENDENCIES)
OPTION(EMBREE_STAT_COUNTERS "Enables statistic counters.")
OPTION(EMBREE_STACK_PROTECTOR "When enabled Embree compiles with stack protection against return address overrides." OFF)
OPTION(EMBREE_RAY_MASK "Enables ray mask support.")
OPTION(EMBREE_BACKFACE_CULLING "Enables backface culling.")
OPTION(EMBREE_INTERSECTION_FILTER "Enables intersection filter callback." ON)
OPTION(EMBREE_INTERSECTION_FILTER_RESTORE "Restores previous hit when hit is filtered out." ON)
OPTION(EMBREE_FILTER_FUNCTION "Enables filter functions." ON)
OPTION(EMBREE_IGNORE_INVALID_RAYS "Ignores invalid rays." OFF) # FIXME: enable by default?
OPTION(EMBREE_GEOMETRY_TRIANGLES "Enables support for triangle geometries." ON)
OPTION(EMBREE_GEOMETRY_QUADS "Enables support for quad geometries." ON)
OPTION(EMBREE_GEOMETRY_LINES "Enables support for line geometries." ON)
OPTION(EMBREE_GEOMETRY_HAIR "Enables support for hair geometries." ON)
OPTION(EMBREE_GEOMETRY_SUBDIV "Enables support for subdiv geometries." ON)
OPTION(EMBREE_GEOMETRY_TRIANGLE "Enables support for triangle geometries." ON)
OPTION(EMBREE_GEOMETRY_QUAD "Enables support for quad geometries." ON)
OPTION(EMBREE_GEOMETRY_CURVE "Enables support for curve geometries." ON)
OPTION(EMBREE_GEOMETRY_SUBDIVISION "Enables support for subdiv geometries." ON)
OPTION(EMBREE_GEOMETRY_USER "Enables support for user geometries." ON)
OPTION(EMBREE_GEOMETRY_INSTANCE "Enables support for instances." ON)
OPTION(EMBREE_GEOMETRY_GRID "Enables support for grid geometries." ON)
OPTION(EMBREE_RAY_PACKETS "Enabled support for ray packets." ON)
SET(EMBREE_NATIVE_SPLINE_BASIS BEZIER CACHE STRING "Sets the basis for curves which Embree uses internally. Other types are converted and need more memory.")
SET_PROPERTY(CACHE EMBREE_NATIVE_SPLINE_BASIS PROPERTY STRINGS BSPLINE BEZIER)
IF (EMBREE_NATIVE_SPLINE_BASIS STREQUAL "BSPLINE")
SET(EMBREE_NATIVE_CURVE_BSPLINE ON)
ELSE()
SET(EMBREE_NATIVE_CURVE_BSPLINE OFF)
ENDIF()
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.")
SET(EMBREE_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system")
IF (WIN32)
@@ -153,35 +168,103 @@ ENDIF()
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
"${PROJECT_SOURCE_DIR}/kernels/config.h"
)
##############################################################
# Compiler
##############################################################
SET(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
IF (WIN32)
IF (NOT DEFAULT_CMAKE_CONFIGURATION_TYPES_SET)
SET(CMAKE_CONFIGURATION_TYPES "${CONFIGURATION_TYPES}" CACHE STRING "List of generated configurations." FORCE)
SET(DEFAULT_CMAKE_CONFIGURATION_TYPES_SET ON CACHE INTERNAL "Default CMake configuration types set.")
ENDIF()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
IF (${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM" )
MESSAGE("CLANG detected")
INCLUDE(clang)
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^Intel")
MESSAGE("Intel Compiler detected")
INCLUDE (intel)
ELSE()
IF (EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX)
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
ENDIF()
INCLUDE (msvc)
ENDIF()
ELSE (WIN32)
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
INCLUDE (crayprgenv)
ELSE()
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _LOWER_CXX_COMPILER_ID)
STRING(REPLACE "appleclang" "clang" _LOWER_CXX_COMPILER_ID ${_LOWER_CXX_COMPILER_ID})
INCLUDE(${_LOWER_CXX_COMPILER_ID} OPTIONAL RESULT_VARIABLE COMPILER_FOUND)
IF (NOT COMPILER_FOUND)
MESSAGE(FATAL_ERROR "Unsupported compiler: " ${CMAKE_CXX_COMPILER_ID})
ENDIF ()
ENDIF ()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Specifies the build type." FORCE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CONFIGURATION_TYPES})
ENDIF(NOT CMAKE_BUILD_TYPE)
OPTION(CMAKE_VERBOSE_MAKEFILE "Enables verbose mode.")
MARK_AS_ADVANCED(CLEAR CMAKE_VERBOSE_MAKEFILE)
ENDIF (WIN32)
##############################################################
# ISA configuration
##############################################################
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
SET(EMBREE_MAX_ISA "NONE" CACHE STRING "Selects highest ISA to support.")
SET(EMBREE_MAX_ISA "DEFAULT" CACHE STRING "Selects highest ISA to support.")
ELSE()
SET(EMBREE_MAX_ISA "AVX2" CACHE STRING "Selects highest ISA to support.")
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)
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX DEFAULT)
IF (EMBREE_MAX_ISA STREQUAL "NONE")
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA.")
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA.")
OPTION(EMBREE_ISA_AVX "Enables AVX ISA.")
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA.")
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing.")
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake.")
IF(NOT (EMBREE_ISA_SSE2 OR EMBREE_ISA_SSE42 OR EMBREE_ISA_AVX OR
EMBREE_ISA_AVX2 OR EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX))
MESSAGE(STATUS "Detecting default ISA:")
INCLUDE(check_isa_default)
CHECK_ISA_DEFAULT(EMBREE_ISA_DEFAULT)
MESSAGE(STATUS "Detecting default ISA: ${EMBREE_ISA_DEFAULT}")
SET(EMBREE_ISA_${EMBREE_ISA_DEFAULT} ON)
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)
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})
ENDIF()
ELSEIF (EMBREE_MAX_ISA STREQUAL "DEFAULT")
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)
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)
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_SSE2 CACHE)
UNSET(EMBREE_ISA_SSE42 CACHE)
@@ -233,54 +316,9 @@ ELSE()
ENDIF ()
ENDIF()
##############################################################
# Compiler
##############################################################
SET(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
IF (WIN32)
IF (NOT DEFAULT_CMAKE_CONFIGURATION_TYPES_SET)
SET(CMAKE_CONFIGURATION_TYPES "${CONFIGURATION_TYPES}" CACHE STRING "List of generated configurations." FORCE)
SET(DEFAULT_CMAKE_CONFIGURATION_TYPES_SET ON CACHE INTERNAL "Default CMake configuration types set.")
ENDIF()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
IF (${CMAKE_GENERATOR_TOOLSET} MATCHES "^LLVM" )
MESSAGE("CLANG detected")
INCLUDE(clang)
ELSEIF(${CMAKE_GENERATOR_TOOLSET} MATCHES "^Intel")
MESSAGE("Intel Compiler detected")
INCLUDE (icc)
ELSE()
IF (EMBREE_ISA_AVX512KNL OR EMBREE_ISA_AVX512SKX)
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
ENDIF()
INCLUDE (msvc)
ENDIF()
ELSE (WIN32)
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
INCLUDE(crayprgenv)
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
INCLUDE (gcc)
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
INCLUDE (clang)
ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
INCLUDE (icc)
ELSE ()
MESSAGE(FATAL_ERROR "Unsupported compiler: " ${CMAKE_CXX_COMPILER_ID})
ENDIF ()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Specifies the build type." FORCE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CONFIGURATION_TYPES})
ENDIF(NOT CMAKE_BUILD_TYPE)
OPTION(CMAKE_VERBOSE_MAKEFILE "Enables verbose mode.")
MARK_AS_ADVANCED(CLEAR CMAKE_VERBOSE_MAKEFILE)
ENDIF (WIN32)
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
SET(EMBREE_ISA_SSE42 OFF)
ENDIF()
##############################################################
# ISA configuration continued
@@ -294,6 +332,7 @@ SET(AVX512KNL 4)
SET(AVX512SKX 5)
UNSET(FLAGS_LOWEST)
SET(ISA_LOWEST_AVX 2)
IF (EMBREE_ISA_SSE2)
ADD_DEFINITIONS(-DEMBREE_TARGET_SSE2)
@@ -318,6 +357,7 @@ IF (EMBREE_ISA_AVX)
LIST(APPEND ISPC_TARGETS "avx")
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX})
SET(ISA_LOWEST_AVX ${AVX})
SET(FLAGS_LOWEST ${FLAGS_AVX})
ENDIF()
ENDIF ()
@@ -327,6 +367,7 @@ IF (EMBREE_ISA_AVX2)
LIST(APPEND ISPC_TARGETS "avx2")
IF(NOT FLAGS_LOWEST)
SET(ISA_LOWEST ${AVX2})
SET(ISA_LOWEST_AVX ${AVX2})
SET(FLAGS_LOWEST ${FLAGS_AVX2})
ENDIF()
ENDIF ()
@@ -345,6 +386,7 @@ IF (EMBREE_ISA_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 ()
@@ -359,9 +401,6 @@ include(package)
##############################################################
# Search paths
##############################################################
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
INCLUDE_DIRECTORIES_ISPC("${PROJECT_BINARY_DIR}")
IF (TASKING_TBB)
FIND_PACKAGE(TBB REQUIRED)
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS})
@@ -380,7 +419,6 @@ SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(kernels)
IF (EMBREE_TUTORIALS)
ADD_SUBDIRECTORY(tutorials)
ENDIF()
+2 -2
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -16,7 +16,7 @@
set(CTEST_PROJECT_NAME "Embree")
set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
set(TEST_MODELS_HASH 01ada7ec1ace15ddba73aaab3f53ac6aac6a0309)
set(TEST_MODELS_HASH ba1bd24186ccdf939d2e749a514f81718f3a2b20)
IF (NOT CTEST_DROP_SITE)
set(CTEST_DROP_METHOD "http")
+1390 -2556
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+2 -3
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -28,5 +28,4 @@ ADD_LIBRARY(algorithms OBJECT
)
SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common)
SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
+9 -7
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,29 +33,31 @@ namespace embree
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=0; i<N; i++)
for (size_t i=N0; i<N; i++)
if (pred(src[i]))
m[src[i]] = 0;
for (size_t i=0; i<N; i++)
for (size_t i=N0; i<N; i++)
if (pred(src[i]))
m[src[i]]++;
/* filter array */
//size_t_t M = sequential_filter(src.data(),size_t(0),N,pred);
size_t M = parallel_filter(src.data(),size_t(0),N,size_t(1024),pred);
//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=0; i<M; i++) {
for (size_t i=N0; i<M; i++) {
passed &= pred(src[i]);
m[src[i]]--;
}
for (size_t i=0; i<M; i++)
for (size_t i=N0; i<M; i++)
passed &= (m[src[i]] == 0);
}
+8 -5
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -39,7 +39,7 @@ namespace embree
return sequential_filter(data,begin,end,predicate);
/* calculate number of tasks to use */
enum { MAX_TASKS = 512 };
enum { MAX_TASKS = 64 };
const Index numThreads = TaskScheduler::threadCount();
const Index numBlocks = (end-begin+minStepSize-1)/minStepSize;
const Index taskCount = min(numThreads,numBlocks,(Index)MAX_TASKS);
@@ -76,8 +76,8 @@ namespace embree
parallel_for(taskCount, [&](const Index taskIndex)
{
/* destination to write elements to */
Index dst = (taskIndex+0)*(end-begin)/taskCount+nused[taskIndex];
Index dst_end = min(dst+nfree[taskIndex],sused);
Index dst = begin+(taskIndex+0)*(end-begin)/taskCount+nused[taskIndex];
Index dst_end = min(dst+nfree[taskIndex],begin+sused);
if (dst_end <= dst) return;
/* range of misplaced elements to copy to destination */
@@ -92,7 +92,10 @@ namespace embree
Index k1 = k0+nused[i];
Index src = begin+(i+0)*(end-begin)/taskCount+nused[i];
for (Index i=max(r0,k0); i<min(r1,k1); i++) {
data[dst++] = data[src-i+k0-1];
Index isrc = src-i+k0-1;
assert(dst >= begin && dst < end);
assert(isrc >= begin && isrc < end);
data[dst++] = data[isrc];
}
k0 = k1;
}
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -16,10 +16,10 @@
#pragma once
#include "../common/tasking/taskscheduler.h"
#include "../tasking/taskscheduler.h"
#include "../sys/array.h"
#include "../math/math.h"
#include "../common/math/range.h"
#include "../math/range.h"
namespace embree
{
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -35,7 +35,7 @@ namespace embree
{
public:
enum { MAX_TASKS = 512 };
enum { MAX_TASKS = 64 };
__forceinline ParallelForForState ()
: taskCount(0) {}
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -17,7 +17,7 @@
#pragma once
#include "parallel_for.h"
#include "../common/math/range.h"
#include "../math/range.h"
namespace embree
{
@@ -64,10 +64,10 @@ namespace embree
template<typename T, typename V, typename Vi, typename IsLeft, typename Reduction_T, typename Reduction_V>
class __aligned(64) parallel_partition_task
{
ALIGNED_CLASS;
ALIGNED_CLASS_(64);
private:
static const size_t MAX_TASKS = 512;
static const size_t MAX_TASKS = 64;
T* array;
size_t N;
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -23,7 +23,7 @@ namespace embree
template<typename Value>
struct ParallelPrefixSumState
{
enum { MAX_TASKS = 512 };
enum { MAX_TASKS = 64 };
Value counts[MAX_TASKS];
Value sums [MAX_TASKS];
};
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+20 -9
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -266,7 +266,7 @@ namespace embree
template<typename Ty, typename Key>
class ParallelRadixSort
{
static const size_t MAX_TASKS = 512;
static const size_t MAX_TASKS = 64;
static const size_t BITS = 8;
static const size_t BUCKETS = (1 << BITS);
typedef unsigned int TyRadixCount[BUCKETS];
@@ -275,10 +275,17 @@ namespace embree
static bool compare(const T& v0, const T& v1) {
return (Key)v0 < (Key)v1;
}
private:
ParallelRadixSort (const ParallelRadixSort& other) DELETED; // do not implement
ParallelRadixSort& operator= (const ParallelRadixSort& other) DELETED; // do not implement
public:
ParallelRadixSort (Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize)
: radixCount(nullptr), src(src), tmp(tmp), N(N)
ParallelRadixSort (Ty* const src, Ty* const tmp, const size_t N)
: radixCount(nullptr), src(src), tmp(tmp), N(N) {}
void sort(const size_t blockSize)
{
assert(blockSize > 0);
@@ -296,6 +303,12 @@ namespace embree
tbbRadixSort(numThreads);
}
}
~ParallelRadixSort()
{
alignedFree(radixCount);
radixCount = nullptr;
}
private:
@@ -402,7 +415,7 @@ namespace embree
void tbbRadixSort(const size_t numTasks)
{
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount));
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount),64);
if (sizeof(Key) == sizeof(uint32_t)) {
tbbRadixIteration(0*BITS,0,src,tmp,numTasks);
@@ -421,8 +434,6 @@ namespace embree
tbbRadixIteration(6*BITS,0,src,tmp,numTasks);
tbbRadixIteration(7*BITS,1,tmp,src,numTasks);
}
alignedFree(radixCount);
radixCount = nullptr;
}
private:
@@ -435,13 +446,13 @@ namespace embree
template<typename Ty>
void radix_sort(Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize = 8192)
{
ParallelRadixSort<Ty,Ty>(src,tmp,N,blockSize);
ParallelRadixSort<Ty,Ty>(src,tmp,N).sort(blockSize);
}
template<typename Ty, typename Key>
void radix_sort(Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize = 8192)
{
ParallelRadixSort<Ty,Key>(src,tmp,N,blockSize);
ParallelRadixSort<Ty,Key>(src,tmp,N).sort(blockSize);
}
template<typename Ty>
+88
View File
@@ -0,0 +1,88 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
## You may obtain a copy of the License at ##
## ##
## http://www.apache.org/licenses/LICENSE-2.0 ##
## ##
## Unless required by applicable law or agreed to in writing, software ##
## distributed under the License is distributed on an "AS IS" BASIS, ##
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
## See the License for the specific language governing permissions and ##
## limitations under the License. ##
## ======================================================================== ##
IF (NOT OPENIMAGEIO_ROOT)
SET(OPENIMAGEIO_ROOT $ENV{OPENIMAGEIO_ROOT})
ENDIF()
IF (NOT OPENIMAGEIO_ROOT)
SET(OPENIMAGEIO_ROOT $ENV{OPENIMAGEIOROOT})
ENDIF()
# detect changed OPENIMAGEIO_ROOT
IF (NOT OPENIMAGEIO_ROOT STREQUAL OPENIMAGEIO_ROOT_LAST)
UNSET(OPENIMAGEIO_INCLUDE_DIR CACHE)
UNSET(OPENIMAGEIO_LIBRARY CACHE)
ENDIF()
set(OPENIMAGEIO_LIB_SUFFIX "")
IF (WIN32)
IF (MSVC14)
SET(OPENIMAGEIO_LIB_SUFFIX "vc2015")
ELSEIF (MSVC12)
SET(OPENIMAGEIO_LIB_SUFFIX "vc2013")
ELSEIF (MSVC11)
SET(OPENIMAGEIO_LIB_SUFFIX "vc2012")
ELSEIF (MINGW)
IF (X64)
SET(OPENIMAGEIO_LIB_SUFFIX "mingw-w64")
# Who's ever going to build for 32bit??
ELSE ()
SET(OPENIMAGEIO_LIB_SUFFIX "mingw-w64")
ENDIF()
ENDIF()
ENDIF ()
FIND_PATH(OPENIMAGEIO_ROOT include/OpenImageIO/imageio.h
DOC "Root of OpenImageIO installation"
HINTS ${OPENIMAGEIO_ROOT}
PATHS
${PROJECT_SOURCE_DIR}/oiio
/usr/local
/usr
/
)
FIND_PATH(OPENIMAGEIO_INCLUDE_DIR OpenImageIO/imageio.h PATHS ${OPENIMAGEIO_ROOT}/include NO_DEFAULT_PATH)
SET(OPENIMAGEIO_HINTS
HINTS
${OPENIMAGEIO_ROOT}
PATH_SUFFIXES
/lib
/lib64
/lib-${OPENIMAGEIO_LIB_SUFFIX}
)
SET(OPENIMAGEIO_PATHS PATHS /usr/lib /usr/lib64 /lib /lib64)
FIND_LIBRARY(OPENIMAGEIO_LIBRARY OpenImageIO ${OPENIMAGEIO_HINTS} ${OPENIMAGEIO_PATHS})
SET(OPENIMAGEIO_ROOT_LAST ${OPENIMAGEIO_ROOT} CACHE INTERNAL "Last value of OPENIMAGEIO_ROOT to detect changes")
SET(OPENIMAGEIO_ERROR_MESSAGE "OpenImageIO not found in your environment. You can 1) install
via your OS package manager, or 2) install it
somewhere on your machine and point OPENIMAGEIO_ROOT to it.")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO
${OPENIMAGEIO_ERROR_MESSAGE}
OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_LIBRARY
)
IF (OPENIMAGEIO_FOUND)
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
ENDIF()
MARK_AS_ADVANCED(OPENIMAGEIO_INCLUDE_DIR)
MARK_AS_ADVANCED(OPENIMAGEIO_LIBRARY)
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+52 -21
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,13 +14,36 @@
## limitations under the License. ##
## ======================================================================== ##
IF (NOT TBB_ROOT)
SET(TBB_ROOT $ENV{TBB_ROOT})
ENDIF()
IF (NOT TBB_ROOT)
SET(TBB_ROOT $ENV{TBBROOT})
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(EMBREE_TBB_ROOT include/tbb/tbb.h
DOC "Root of TBB installation"
PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
PATHS ${PROJECT_SOURCE_DIR}/tbb
NO_DEFAULT_PATH
)
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
HINTS ${TBB_ROOT}
PATHS
${PROJECT_SOURCE_DIR}/../tbb
"${PROGRAMFILES32}/IntelSWTools/compilers_and_libraries/windows/tbb"
"${PROGRAMFILES32}/Intel/Composer XE/tbb"
"${PROGRAMFILES32}/Intel/compilers_and_libraries/windows/tbb"
)
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(TBB_ARCH intel64)
@@ -28,12 +51,11 @@ IF (WIN32)
SET(TBB_ARCH ia32)
ENDIF()
IF (MSVC10)
SET(TBB_VCVER vc10)
ELSEIF (MSVC11)
SET(TBB_VCVER vc11)
ELSE()
# precompiled TBB packages currently only support VC12 and VC14
IF (MSVC12)
SET(TBB_VCVER vc12)
ELSEIF(MSVC14)
SET(TBB_VCVER vc14)
ENDIF()
SET(TBB_LIBDIR ${EMBREE_TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
@@ -48,25 +70,33 @@ IF (WIN32)
SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
ENDIF()
ELSE ()
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
DOC "Root of TBB installation"
PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/tbb
PATHS ${PROJECT_SOURCE_DIR}/tbb
NO_DEFAULT_PATH
)
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)
FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
DOC "Root of TBB installation"
HINTS ${TBB_ROOT}
PATHS
${PROJECT_SOURCE_DIR}/tbb
/opt/intel/composerxe/tbb
/opt/intel/compilers_and_libraries/tbb
/opt/intel/tbb
)
IF (EMBREE_TBB_ROOT STREQUAL "")
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
FIND_LIBRARY(TBB_LIBRARY tbb)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/src)
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake AND EXISTS ${EMBREE_TBB_ROOT}/src/tbb/tbb_version.h)
OPTION(EMBREE_TBB_STATIC_LIB "Build TBB as a static library (building TBB as a static library is NOT recommended)")
if (EMBREE_TBB_STATIC_LIB)
include(${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
@@ -92,8 +122,9 @@ ELSE ()
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
ELSE()
FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 /usr/libx86_64-linux-gnu/ NO_DEFAULT_PATH)
SET(TBB_HINTS HINTS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
FIND_LIBRARY(TBB_LIBRARY tbb ${TBB_HINTS})
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
ENDIF()
ENDIF()
@@ -115,14 +146,14 @@ MARK_AS_ADVANCED(TBB_LIBRARY_MALLOC)
# Install TBB
##############################################################
IF (WIN32)
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
INSTALL(PROGRAMS ${TBB_LIBDIR}/tbb.lib ${TBB_LIBDIR}/tbbmalloc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSEIF (EMBREE_ZIP_MODE)
IF (APPLE)
IF (EMBREE_INSTALL_DEPENDENCIES)
IF (WIN32)
INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
INSTALL(PROGRAMS ${TBB_LIBDIR}/tbb.lib ${TBB_LIBDIR}/tbbmalloc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSEIF (APPLE)
INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/libtbb.dylib ${EMBREE_TBB_ROOT}/lib/libtbbmalloc.dylib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ELSE()
INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbb.so.2 ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbbmalloc.so.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
ENDIF()
ENDIF()
+5 -3
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -23,8 +23,10 @@ string(REPLACE "\n" ";" output ${output})
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 "\\(\\)::") # this matches a static inside a function which is fine
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 "__\\$U") # ICC generated locks for static variable inside a function
message(WARNING "\nProblematic global variable in non-SSE code:\n" ${line})
endif()
endif()
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+45 -18
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,15 +14,18 @@
## limitations under the License. ##
## ======================================================================== ##
SET(FLAGS_SSE2 "-msse2")
SET(FLAGS_SSE3 "-msse3")
SET(FLAGS_SSSE3 "-mssse3")
SET(FLAGS_SSE41 "-msse4.1")
SET(FLAGS_SSE42 "-msse4.2")
SET(FLAGS_AVX "-mavx")
SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
SET(FLAGS_AVX512KNL "-march=knl")
SET(FLAGS_AVX512SKX "-march=skx")
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_AVX512KNL "-march=knl")
_SET_IF_EMPTY(FLAGS_AVX512SKX "-march=skx")
IF (WIN32)
@@ -36,8 +39,16 @@ IF (WIN32)
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} /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
@@ -48,6 +59,7 @@ IF (WIN32)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-vectorize") # disable auto vectorization
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
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_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual functions
@@ -69,52 +81,67 @@ IF (WIN32)
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
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} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
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_CXX_FLAGS_DEBUG "")
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} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
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_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enable assertions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configure TBB in debug mode
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
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)
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 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()
+5 -3
View File
@@ -13,10 +13,12 @@
## See the License for the specific language governing permissions and ##
## limitations under the License. ##
## ======================================================================== ##
SET(FLAGS_SSE2 "-target-cpu=xeon")
SET(FLAGS_SSE42 "-target-cpu=interlagos")
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")
STRING(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _lower_compiler_id)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/${_lower_compiler_id}.cmake" OPTIONAL)
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
+6 -8
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -45,15 +45,13 @@ SET(EMBREE_TUTORIALS @EMBREE_TUTORIALS@)
SET(EMBREE_RAY_MASK @EMBREE_RAY_MASK@)
SET(EMBREE_STAT_COUNTERS @EMBREE_STAT_COUNTERS@)
SET(EMBREE_BACKFACE_CULLING @EMBREE_BACKFACE_CULLING@)
SET(EMBREE_INTERSECTION_FILTER @EMBREE_INTERSECTION_FILTER@)
SET(EMBREE_INTERSECTION_FILTER_RESTORE @EMBREE_INTERSECTION_FILTER_RESTORE@)
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_GEOMETRY_TRIANGLES @EMBREE_GEOMETRY_TRIANGLES@)
SET(EMBREE_GEOMETRY_QUADS @EMBREE_GEOMETRY_QUADS@)
SET(EMBREE_GEOMETRY_LINES @EMBREE_GEOMETRY_LINES@)
SET(EMBREE_GEOMETRY_HAIR @EMBREE_GEOMETRY_HAIR@)
SET(EMBREE_GEOMETRY_SUBDIV @EMBREE_GEOMETRY_SUBDIV@)
SET(EMBREE_GEOMETRY_TRIANGLE @EMBREE_GEOMETRY_TRIANGLE@)
SET(EMBREE_GEOMETRY_QUAD @EMBREE_GEOMETRY_QUAD@)
SET(EMBREE_GEOMETRY_CURVE @EMBREE_GEOMETRY_CURVE@)
SET(EMBREE_GEOMETRY_SUBDIVISION @EMBREE_GEOMETRY_SUBDIVISION@)
SET(EMBREE_GEOMETRY_USER @EMBREE_GEOMETRY_USER@)
SET(EMBREE_RAY_PACKETS @EMBREE_RAY_PACKETS@)
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,49 +14,63 @@
## limitations under the License. ##
## ======================================================================== ##
SET(FLAGS_SSE2 "-msse2")
SET(FLAGS_SSE42 "-msse4.2")
SET(FLAGS_AVX "-mavx")
SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
SET(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
SET(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
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_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")
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} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
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} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize") # disable auto vectorizer
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()
SET(CMAKE_CXX_FLAGS_DEBUG "")
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} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
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_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enable assertions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configure TBB in debug mode
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
IF (APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") # makes sure code runs on older MacOSX versions
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,30 +14,45 @@
## limitations under the License. ##
## ======================================================================== ##
MACRO(_SET_IF_EMPTY VAR VALUE)
IF(NOT ${VAR})
SET(${VAR} "${VALUE}")
ENDIF()
ENDMACRO()
IF (WIN32)
SET(FLAGS_SSE2 "/QxSSE2")
SET(FLAGS_SSE42 "/QxSSE4.2")
SET(FLAGS_AVX "/arch:AVX")
SET(FLAGS_AVX2 "/QxCORE-AVX2")
SET(FLAGS_AVX512KNL "/QxMIC-AVX512")
SET(FLAGS_AVX512SKX "/QxCORE-AVX512")
_SET_IF_EMPTY(FLAGS_SSE2 "/QxSSE2")
_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(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} /Qvec-") # disable auto vectorizer
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qfast-transcendentals-") # disable fast transcendentals, prevents sin(x),cos(x) -> sincos(x) optimization
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(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11074 ") # remark #11074: Inlining inhibited by limit max-size
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11075 ") # remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
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} /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
@@ -46,14 +61,15 @@ IF (WIN32)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi") # inline intrinsic functions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gy") # package individual functions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-max-total-size-") # no size limit when performing inlining
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-factor=200") # increase default inline factors by 2x
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Qinline-factor=150") # increase default inline factors by 2x
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
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_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual functions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-max-total-size-") # no size limit when performing inlining
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-factor=200") # increase default inline factors by 2x
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Qinline-factor=150") # increase default inline factors by 2x
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
@@ -71,40 +87,58 @@ IF (WIN32)
INCLUDE(msvc_post)
# remove libmmd dependency
IF (NOT EMBREE_STATIC_RUNTIME)
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")
ENDIF()
ELSE()
IF (APPLE)
SET(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
_SET_IF_EMPTY(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
ELSE()
SET(FLAGS_SSE2 "-xsse2")
_SET_IF_EMPTY(FLAGS_SSE2 "-xsse2")
ENDIF()
SET(FLAGS_SSE42 "-xsse4.2")
SET(FLAGS_AVX "-xAVX")
SET(FLAGS_AVX2 "-xCORE-AVX2")
SET(FLAGS_AVX512KNL "-xMIC-AVX512")
SET(FLAGS_AVX512SKX "-xCORE-AVX512")
_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")
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} -Wall") # enables most warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wformat-security") # enables string format vulnerability warnings
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
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} -no-ansi-alias") # disables strict aliasing rules
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-vec") # disable auto vectorizer
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fasm-blocks") # enable assembly blocks
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(NOT CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel") # links intel runtime statically
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-intel-extensions") # disables some intel extensions which cause symbols to be exported
@@ -114,7 +148,7 @@ ELSE()
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} -g") # generate debug information
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable all optimizations
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2") # allow inlining of intrinsics
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
@@ -122,8 +156,9 @@ ELSE()
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -restrict") # enable restrict keyword
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-total-size") # no size limit when performing inlining
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -no-inline-max-per-compile") # no maximal number of inlinings per compilation unit
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=200") # increase default inline factors limits by 2x
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -inline-factor=150") # increase default inline factors limits by 2x
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG") # enables assertions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DTBB_USE_DEBUG") # configures TBB in debug mode
@@ -132,8 +167,9 @@ ELSE()
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -restrict") # enable restrict keyword
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -no-inline-max-total-size") # no size limit when performing inlining
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -no-inline-max-per-compile") # no maximal number of inlinings per compilation unit
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -inline-factor=200") # increase default inline factors by 2x
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -inline-factor=150") # increase default inline factors by 2x
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -D_FORTIFY_SOURCE=2") # perform extra security checks for some standard library calls
#SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -debug inline-debug-info")
#SET(CMAKE_EXE_LINKER_FLAGS "-g")
+4 -4
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -59,11 +59,11 @@ ENDIF()
# check ISPC version
EXECUTE_PROCESS(COMMAND ${EMBREE_ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
STRING(REGEX MATCH "([0-9]+[.][0-9]+[.][0-9]+)" DUMMY "${ISPC_OUTPUT}")
SET(ISPC_VERSION ${CMAKE_MATCH_1})
IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
MESSAGE(FATAL_ERROR "ISPC ${ISPC_VERSION} is too old. You need at least ISPC ${ISPC_VERSION_REQUIRED}.")
ENDIF()
GET_FILENAME_COMPONENT(ISPC_DIR ${EMBREE_ISPC_EXECUTABLE} PATH)
@@ -93,7 +93,7 @@ MACRO (ISPC_COMPILE)
IF (WIN32 OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
SET(ISPC_OPT_FLAGS -O3)
ELSE()
SET(ISPC_OPT_FLAGS -O2 -g)
SET(ISPC_OPT_FLAGS -O2)
ENDIF()
IF (WIN32)
+11 -3
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -28,9 +28,16 @@ IF (EMBREE_STACK_PROTECTOR)
ELSE()
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-") # do not protect against return address overrides
ENDIF()
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${FLAGS_SSE2}")
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} /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
@@ -40,12 +47,13 @@ SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Gy") # package individual functions
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /DTBB_USE_DEBUG") # configures TBB in debug mode
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_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Gy") # package individual 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
+2 -2
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -15,7 +15,7 @@
## ======================================================================== ##
# optionally use static runtime library
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." ON)
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." OFF)
IF (EMBREE_STATIC_RUNTIME)
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+45 -51
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -39,7 +39,10 @@ ENDIF()
##############################################################
# Install Headers
##############################################################
INSTALL(DIRECTORY include/embree2 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)
ENDIF()
##############################################################
# Install Models
@@ -55,11 +58,6 @@ INSTALL(FILES ${PROJECT_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOC
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)
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/LICENSE.txt" "LICENSE")
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/CHANGELOG.txt" "CHANGELOG")
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/README.md" "README.md")
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_DOCDIR}/readme.pdf" "readme.pdf")
##############################################################
# Install scripts to set embree paths
##############################################################
@@ -96,11 +94,11 @@ ENDIF()
# why does this have to be so complicated...
IF (WIN32)
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${CMAKE_IMPORT_LIBRARY_SUFFIX})
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX})
ELSEIF (APPLE)
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
ELSE()
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
ENDIF()
IF (WIN32 OR EMBREE_ZIP_MODE)
@@ -111,7 +109,7 @@ IF (WIN32 OR EMBREE_ZIP_MODE)
SET(EMBREE_RELATIV_ROOT_DIR ".")
ELSE()
SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
SET(EMBREE_RELATIV_ROOT_DIR "../../..")
FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
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)
@@ -125,11 +123,11 @@ INSTALL(FILES "${PROJECT_BINARY_DIR}/embree-config-version.cmake" DESTINATION ${
# CPack specific stuff
##############################################################
SET(CPACK_PACKAGE_NAME "Embree")
SET(CPACK_PACKAGE_NAME "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_RELOCATABLE TRUE)
SET(CPACK_STRIP_FILES TRUE)
SET(CPACK_STRIP_FILES FALSE) # we strip already as a post_build step
SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})
@@ -148,9 +146,9 @@ SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Tutorials demonstrating how to use Embree.")
# dependencies between components
SET(CPACK_COMPONENT_DEVEL_DEPENDS lib)
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS lib)
SET(CPACK_COMPONENT_LIB_REQUIRED ON) # always install the libs
#SET(CPACK_COMPONENT_DEVEL_DEPENDS lib)
#SET(CPACK_COMPONENT_EXAMPLES_DEPENDS lib)
#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)
@@ -161,42 +159,34 @@ IF(WIN32)
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ARCH x64)
SET(PROGRAMFILES "\$PROGRAMFILES64")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
ELSE()
SET(ARCH win32)
SET(PROGRAMFILES "\$PROGRAMFILES")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} Win32")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} Win32")
ENDIF()
IF (MSVC12)
SET(VCVER vc12)
ELSEIF(MSVC14) # also for VC15, which is toolset v141
SET(VCVER vc14)
ENDIF()
# NSIS specific settings
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_GENERATOR NSIS)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}")
SET(CPACK_COMPONENTS_ALL lib devel examples)
SET(CPACK_NSIS_INSTALL_ROOT "${PROGRAMFILES}\\\\Intel")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Embree v${EMBREE_VERSION} ${ARCH}")
SET(CPACK_NSIS_DISPLAY_NAME "Embree v${EMBREE_VERSION} ${ARCH}")
SET(CPACK_NSIS_PACKAGE_NAME "Embree v${EMBREE_VERSION} ${ARCH}")
SET(CPACK_NSIS_URL_INFO_ABOUT http://embree.github.io/)
#SET(CPACK_NSIS_HELP_LINK http://embree.github.io/downloads.html#windows)
SET(CPACK_NSIS_MUI_ICON ${PROJECT_SOURCE_DIR}/scripts/install_windows/icon32.ico)
SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\"")
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\documentation\\\"")
#SET(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS} "\n CreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\tutorials\\\" \n")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\documentation\\\"")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\tutorials\\\"")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS ${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} "\n ${UNINSTALL_LIST}\n RMDir \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\"\n")
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 ${CPACK_PACKAGE_FILE_NAME}.exe ${CMAKE_BUILD_TYPE})
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}.windows")
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 ${CPACK_PACKAGE_FILE_NAME}.zip ${CMAKE_BUILD_TYPE})
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()
ENDIF()
@@ -208,32 +198,32 @@ ELSEIF(APPLE)
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
SET(CPACK_GENERATOR PackageMaker)
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_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.embree2.xxx in pkgutil
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}.dmg)
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 TGZ)
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}.tgz)
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}.tgz ${EMBREE_SIGN_FILE})
ENDIF()
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)
@@ -241,7 +231,11 @@ ELSE()
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
STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
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/)
@@ -251,7 +245,7 @@ ELSE()
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_VERSION})
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION} ${EMBREE_VERSION_MAJOR} ${EMBREE_SIGN_FILE})
ENDIF()
ELSE()
@@ -259,7 +253,7 @@ ELSE()
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_VERSION})
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION} ${EMBREE_SIGN_FILE})
ENDIF()
ENDIF()
+115 -73
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -14,86 +14,132 @@
## limitations under the License. ##
## ======================================================================== ##
IF(NOT BUILD_TESTING)
SET(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
ENDIF()
INCLUDE(CTest)
IF (BUILD_TESTING)
CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)
SET(EMBREE_TESTING_MODEL_DIR "${PROJECT_SOURCE_DIR}/models" CACHE PATH "Path to the folder containing the Embree models for regression testing.")
SET(EMBREE_TESTING_INTENSIVE OFF CACHE BOOL "Turns intensive testing on.")
SET(EMBREE_TESTING_MEMCHECK OFF CACHE BOOL "Turns on memory checking for some tests.")
SET(EMBREE_TESTING_BENCHMARK OFF CACHE BOOL "Turns benchmarking on.")
SET(EMBREE_TESTING_BENCHMARK_DATABASE "${PROJECT_BINARY_DIR}" CACHE PATH "Path to database for benchmarking.")
SET(EMBREE_TESTING_PACKAGE OFF CACHE BOOL "Packages release as test.")
SET(EMBREE_TESTING_KLOCWORK OFF CACHE BOOL "Runs Kocwork as test.")
SET(EMBREE_TESTING_SDE OFF CACHE STRING "Uses SDE to run tests for specified CPU.")
SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb hsw bdw knl skl skx cnl)
IF( NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt")
MESSAGE(FATAL_ERROR "Invalid Embree testing model repository. Either disable BUILD_TESTING or properly set EMBREE_TESTING_MODEL_DIR.")
ENDIF()
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-subdiv.txt" models_subdiv)
STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-win32.txt" models_small_win32)
STRING(REGEX REPLACE "\n" ";" models_small_win32 "${models_small_win32}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-small-x64.txt" models_small_x64)
STRING(REGEX REPLACE "\n" ";" models_small_x64 "${models_small_x64}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/embree-models-large.txt" models_large)
STRING(REGEX REPLACE "\n" ";" models_large "${models_large}")
IF (EMBREE_TESTING_INTENSIVE)
SET(models ${models_small_x64})
IF (${memory} GREATER 10000)
SET(models ${models} ${models_large})
ENDIF()
ELSE()
SET(models ${models_small_win32})
ENDIF()
IF (WIN32)
IF (WIN32)
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
ELSE()
ELSE()
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
ENDIF()
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
ENDIF()
FIND_PATH(EMBREE_TESTING_MODEL_DIR
NAMES test-models-intensity2.txt
PATHS "${PROJECT_SOURCE_DIR}/models"
DOC "Path to the folder containing the Embree models for regression testing."
NO_DEFAULT_PATHS)
SET(EMBREE_TESTING_INTENSITY 1 CACHE INT "Intensity of testing (0 = no testing, 1 = verify and tutorials, 2 = light testing, 3 = intensive testing.")
SET(EMBREE_TESTING_MEMCHECK OFF CACHE BOOL "Turns on memory checking for some tests.")
SET(EMBREE_TESTING_BENCHMARK OFF CACHE BOOL "Turns benchmarking on.")
SET(EMBREE_TESTING_BENCHMARK_DATABASE "${PROJECT_BINARY_DIR}" CACHE PATH "Path to database for benchmarking.")
SET(EMBREE_TESTING_PACKAGE OFF CACHE BOOL "Packages release as test.")
SET(EMBREE_TESTING_KLOCWORK OFF CACHE BOOL "Runs Kocwork as test.")
SET(EMBREE_TESTING_SDE OFF CACHE STRING "Uses SDE to run tests for specified CPU.")
SET_PROPERTY(CACHE EMBREE_TESTING_SDE PROPERTY STRINGS OFF pnr nhm wsm snb ivb hsw bdw knl skl skx cnl)
SET(EMBREE_MODEL_DIR "none")
IF (EMBREE_TESTING_MODEL_DIR)
SET(EMBREE_MODEL_DIR ${EMBREE_TESTING_MODEL_DIR})
ENDIF()
MACRO (ADD_EMBREE_NORMAL_TEST name reference executable args)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
--name ${name}
--modeldir ${EMBREE_TESTING_MODEL_DIR}
--reference ${reference}
--model ${model}
--modeldir ${EMBREE_MODEL_DIR}
--model default
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
ENDIF()
IF (EMBREE_ISPC_SUPPORT AND NOT DISABLE_ISPC_TEST)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}_ispc
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
--name ${name}_ispc
--modeldir ${EMBREE_TESTING_MODEL_DIR}
--reference ${reference}
--modeldir ${EMBREE_MODEL_DIR}
--model default
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
ENDIF()
ENDIF()
ENDMACRO()
MACRO (ADD_EMBREE_TEST name)
ADD_EMBREE_NORMAL_TEST(${name} ${name} ${name} "")
ENDMACRO()
MACRO (ADD_EMBREE_TEST2 name exe args)
ADD_EMBREE_MODEL_TEST(${name} ${exe} ${exe} "${args}" "default")
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 python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
--name ${name}
--reference ${reference}
--modeldir ${EMBREE_MODEL_DIR}
--model ${model}
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})
ENDIF()
IF (EMBREE_ISPC_SUPPORT AND NOT DISABLE_ISPC_TEST)
IF (BUILD_TESTING)
ADD_TEST(NAME ${name}_ispc
WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
COMMAND python ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
--name ${name}_ispc
--reference ${reference}
--modeldir ${EMBREE_MODEL_DIR}
--model ${model}
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
ENDIF()
ENDMACRO()
ENDIF()
ENDMACRO()
IF (EMBREE_TESTING_MODEL_DIR AND EMBREE_TESTING_INTENSITY GREATER 0)
IF( NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-subdiv.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity2.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity3.txt"
OR NOT EXISTS "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity4.txt")
MESSAGE(FATAL_ERROR "Invalid Embree testing model repository.")
ENDIF()
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-subdiv.txt" models_subdiv)
STRING(REGEX REPLACE "\n" ";" models_subdiv "${models_subdiv}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity2.txt" models_intensity2)
STRING(REGEX REPLACE "\n" ";" models_intensity2 "${models_intensity2}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity3.txt" models_intensity3)
STRING(REGEX REPLACE "\n" ";" models_intensity3 "${models_intensity3}")
FILE(READ "${EMBREE_TESTING_MODEL_DIR}/test-models-intensity4.txt" models_intensity4)
STRING(REGEX REPLACE "\n" ";" models_intensity4 "${models_intensity4}")
IF (EMBREE_TESTING_INTENSITY GREATER 1)
LIST(APPEND models ${models_intensity2})
ENDIF()
IF (EMBREE_TESTING_INTENSITY GREATER 2)
LIST(APPEND models ${models_intensity3})
ENDIF()
CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)
IF (EMBREE_TESTING_INTENSITY GREATER 3 AND ${memory} GREATER 10000)
LIST(APPEND models ${models_intensity4})
ENDIF()
MACRO (ADD_EMBREE_MODELS_TEST name reference executable)
FOREACH (model ${models})
STRING(REGEX REPLACE "/" "_" modelname "${model}")
@@ -110,11 +156,6 @@ IF (BUILD_TESTING)
ENDFOREACH()
ENDMACRO()
IF (EMBREE_TESTING_KLOCWORK)
ADD_TEST(NAME Klocwork WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork.sh)
SET_TESTS_PROPERTIES(Klocwork PROPERTIES TIMEOUT 2400)
ENDIF()
ELSE()
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
@@ -128,18 +169,19 @@ ELSE()
ENDIF()
MACRO (ADD_EMBREE_TEST name)
ADD_EMBREE_MODEL_TEST(${name} ${name} ${name} "" "default")
ENDMACRO()
MACRO (ADD_EMBREE_TEST2 name exe args)
ADD_EMBREE_MODEL_TEST(${name} ${exe} ${exe} "${args}" "default")
ENDMACRO()
# add klocwork test
IF (EMBREE_TESTING_KLOCWORK)
ADD_TEST(NAME Klocwork WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork.sh)
SET_TESTS_PROPERTIES(Klocwork PROPERTIES TIMEOUT 2400)
ENDIF()
# add valgrind test
IF (EMBREE_TESTING_MEMCHECK)
find_program( EMBREE_MEMORYCHECK_COMMAND valgrind )
set( EMBREE_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-leak-kinds=definite --errors-for-leak-kinds=definite --error-exitcode=1" )
IF (NOT EMBREE_MEMORYCHECK_COMMAND)
MESSAGE(FATAL_ERROR "valgrind not found")
ENDIF()
FUNCTION(ADD_MEMCHECK_TEST name binary)
set(memcheck_command "${EMBREE_MEMORYCHECK_COMMAND} ${EMBREE_MEMORYCHECK_COMMAND_OPTIONS}")
separate_arguments(memcheck_command)
+10 -10
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -18,21 +18,21 @@
# if ADDITIONAL_LIBRARIES is set these will be included during linking
MACRO (ADD_TUTORIAL TUTORIAL_NAME)
ADD_EXECUTABLE(${TUTORIAL_NAME} ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.cpp ${ARGN})
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree tutorial image tutorial_device noise ${ADDITIONAL_LIBRARIES})
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)
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}" "${TUTORIAL_NAME}")
SIGN_TARGET(${TUTORIAL_NAME})
ENDMACRO ()
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
MACRO (ADD_TUTORIAL_ISPC TUTORIAL_NAME)
IF (EMBREE_ISPC_SUPPORT)
ADD_EMBREE_ISPC_EXECUTABLE(${TUTORIAL_NAME}_ispc ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.ispc)
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree tutorial image tutorial_device_ispc noise noise_ispc)
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)
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}_ispc" "${TUTORIAL_NAME}_ispc")
SIGN_TARGET(${TUTORIAL_NAME}_ispc)
ENDIF()
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE)
ENDMACRO ()
+7 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -20,3 +20,9 @@ ADD_LIBRARY(lexers STATIC
)
TARGET_LINK_LIBRARIES(lexers sys math)
SET_PROPERTY(TARGET lexers PROPERTY FOLDER common)
SET_PROPERTY(TARGET lexers APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS lexers ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
SIGN_TARGET(lexers)
ENDIF()
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+5 -6
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -32,9 +32,9 @@ namespace embree
class ParseLocation
{
public:
ParseLocation () : lineNumber(-1), colNumber(-1), charNumber(-1) {}
ParseLocation (std::shared_ptr<std::string> fileName, ssize_t lineNumber, ssize_t colNumber, ssize_t charNumber)
: fileName(fileName), lineNumber(lineNumber), colNumber(colNumber), charNumber(charNumber) {}
ParseLocation () : lineNumber(-1), colNumber(-1) {}
ParseLocation (std::shared_ptr<std::string> fileName, ssize_t lineNumber, ssize_t colNumber, ssize_t /*charNumber*/)
: fileName(fileName), lineNumber(lineNumber), colNumber(colNumber) {}
std::string str() const
{
@@ -49,7 +49,6 @@ namespace embree
std::shared_ptr<std::string> fileName; /// name of the file (or stream) the token is from
ssize_t lineNumber; /// the line number the token is from
ssize_t colNumber; /// the character number in the current line
ssize_t charNumber; /// the character in the file
};
/*! a stream class templated over the stream elements */
@@ -67,7 +66,7 @@ namespace embree
}
__forceinline void push_back(const std::pair<T,ParseLocation>& v) {
if (past+future == BUF_SIZE) pop_front();
int end = (start+past+future++)%BUF_SIZE;
size_t end = (start+past+future++)%BUF_SIZE;
buffer[end] = v;
}
__forceinline void pop_front() {
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -30,7 +30,7 @@ namespace embree
ParseLocation location() { return cin->loc(); }
std::string next();
private:
__forceinline bool isSeparator(int c) const { return isSepMap[c]; }
__forceinline bool isSeparator(int c) const { return c<256 && isSepMap[c]; }
private:
Ref<Stream<int> > cin; /*! source character stream */
bool isSepMap[256]; /*! map for fast classification of separators */
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -160,13 +160,13 @@ namespace embree
std::vector<std::string> symbols;
/*! checks if a character is a separator */
__forceinline bool isSeparator(int c) const { return isSepMap[c]; }
__forceinline bool isSeparator(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';}
/*! checks if a character is legal for an identifier */
__forceinline bool isAlpha(int c) const { return isAlphaMap[c]; }
__forceinline bool isAlpha(int c) const { return c<256 && isAlphaMap[c]; }
__forceinline bool isAlphaNum(int c) const { return isAlpha(c) || isDigit(c); }
};
}
+8 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -16,3 +16,10 @@
ADD_LIBRARY(math STATIC constants.cpp)
SET_PROPERTY(TARGET math PROPERTY FOLDER common)
SET_PROPERTY(TARGET math APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS math ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
SIGN_TARGET(math)
ENDIF()
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -107,9 +107,9 @@ namespace embree
template<typename L> __forceinline AffineSpaceT<L>& operator /=( AffineSpaceT<L>& a, const AffineSpaceT<L>& b ) { return a = a / b; }
template<typename L> __forceinline AffineSpaceT<L>& operator /=( AffineSpaceT<L>& a, const ScalarT & b ) { return a = a / b; }
template<typename L> __forceinline const VectorT xfmPoint (const AffineSpaceT<L>& m, const VectorT& p) { return madd(VectorT(p.x),m.l.vx,madd(VectorT(p.y),m.l.vy,madd(VectorT(p.z),m.l.vz,m.p))); }
template<typename L> __forceinline const VectorT xfmVector(const AffineSpaceT<L>& m, const VectorT& v) { return xfmVector(m.l,v); }
template<typename L> __forceinline const VectorT xfmNormal(const AffineSpaceT<L>& m, const VectorT& n) { return xfmNormal(m.l,n); }
template<typename L> __forceinline VectorT xfmPoint (const AffineSpaceT<L>& m, const VectorT& p) { return madd(VectorT(p.x),m.l.vx,madd(VectorT(p.y),m.l.vy,madd(VectorT(p.z),m.l.vz,m.p))); }
template<typename L> __forceinline VectorT xfmVector(const AffineSpaceT<L>& m, const VectorT& v) { return xfmVector(m.l,v); }
template<typename L> __forceinline VectorT xfmNormal(const AffineSpaceT<L>& m, const VectorT& n) { return xfmNormal(m.l,n); }
__forceinline const BBox<Vec3fa> xfmBounds(const AffineSpaceT<LinearSpace3<Vec3fa> >& m, const BBox<Vec3fa>& b)
{
+11 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -60,6 +60,11 @@ namespace embree
__forceinline static const BBox merge (const BBox& a, const BBox& b) {
return BBox(min(a.lower, b.lower), max(a.upper, b.upper));
}
/*! enlarge box by some scaling factor */
__forceinline BBox enlarge_by(const float a) {
return BBox(lower - T(a)*abs(lower), upper + T(a)*abs(upper));
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
@@ -184,6 +189,10 @@ namespace embree
return true;
}
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));
}
/*! blending */
template<typename T>
__forceinline BBox<T> lerp(const BBox<T>& b0, const BBox<T>& b1, const float t) {
@@ -198,6 +207,7 @@ namespace embree
/*! default template instantiations */
typedef BBox<float> BBox1f;
typedef BBox<Vec2f> BBox2f;
typedef BBox<Vec2fa> BBox2fa;
typedef BBox<Vec3f> BBox3f;
typedef BBox<Vec3fa> BBox3fa;
}
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+5 -5
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -53,8 +53,8 @@ namespace embree
__forceinline Color4 ( const Color4& other ) : m128(other.m128) {}
__forceinline Color4& operator=( const Color4& other ) { m128 = other.m128; return *this; }
__forceinline operator const __m128&( void ) const { return m128; }
__forceinline operator __m128&( void ) { return m128; }
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Set
@@ -115,8 +115,8 @@ namespace embree
__forceinline Color ( const Color4& other ) : m128(other.m128) {}
__forceinline Color& operator=( const Color4& other ) { m128 = other.m128; return *this; }
__forceinline operator const __m128&( void ) const { return m128; }
__forceinline operator __m128&( void ) { return m128; }
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Set
+2 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -36,4 +36,5 @@ namespace embree
StepTy step;
ReverseStepTy reverse_step;
EmptyTy empty;
UndefinedTy undefined;
}
+9 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -26,11 +26,11 @@
namespace embree
{
static const float one_over_255 = 1.0f/255.0f;
static const float min_rcp_input = 1E-18f; // for abs(x) >= min_rcp_input the newton raphson rcp calculation does not fail
static MAYBE_UNUSED const float one_over_255 = 1.0f/255.0f;
static MAYBE_UNUSED const float min_rcp_input = 1E-18f; // for abs(x) >= min_rcp_input the newton raphson rcp calculation does not fail
/* we consider floating point numbers in that range as valid input numbers */
static float FLT_LARGE = 1.844E18f;
static MAYBE_UNUSED float FLT_LARGE = 1.844E18f;
struct TrueTy {
__forceinline operator bool( ) const { return true; }
@@ -201,4 +201,9 @@ namespace embree
};
extern MAYBE_UNUSED FullTy full;
struct UndefinedTy {
};
extern MAYBE_UNUSED UndefinedTy undefined;
}
+143
View File
@@ -0,0 +1,143 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#pragma once
#include "vec2.h"
#include "vec3.h"
#include "bbox.h"
namespace embree
{
template<typename V>
struct Interval
{
V lower, upper;
__forceinline Interval() {}
__forceinline Interval ( const Interval& other ) { lower = other.lower; upper = other.upper; }
__forceinline Interval& operator=( const Interval& other ) { lower = other.lower; upper = other.upper; return *this; }
__forceinline Interval(const V& a) : lower(a), upper(a) {}
__forceinline Interval(const V& lower, const V& upper) : lower(lower), upper(upper) {}
__forceinline Interval(const BBox<V>& a) : lower(a.lower), upper(a.upper) {}
/*! tests if box is empty */
//__forceinline bool empty() const { return lower > upper; }
/*! computes the size of the interval */
__forceinline V size() const { return upper - lower; }
__forceinline V center() const { return 0.5f*(lower+upper); }
__forceinline const Interval& extend(const Interval& other) { lower = min(lower,other.lower); upper = max(upper,other.upper); return *this; }
__forceinline const Interval& extend(const V & other) { lower = min(lower,other ); upper = max(upper,other ); return *this; }
__forceinline friend Interval operator +( const Interval& a, const Interval& b ) {
return Interval(a.lower+b.lower,a.upper+b.upper);
}
__forceinline friend Interval operator -( const Interval& a, const Interval& b ) {
return Interval(a.lower-b.upper,a.upper-b.lower);
}
__forceinline friend Interval operator -( const Interval& a, const V& b ) {
return Interval(a.lower-b,a.upper-b);
}
__forceinline friend Interval operator *( const Interval& a, const Interval& b )
{
const V ll = a.lower*b.lower;
const V lu = a.lower*b.upper;
const V ul = a.upper*b.lower;
const V uu = a.upper*b.upper;
return Interval(min(ll,lu,ul,uu),max(ll,lu,ul,uu));
}
__forceinline friend Interval merge( const Interval& a, const Interval& b) {
return Interval(min(a.lower,b.lower),max(a.upper,b.upper));
}
__forceinline friend Interval merge( const Interval& a, const Interval& b, const Interval& c) {
return merge(merge(a,b),c);
}
__forceinline friend Interval merge( const Interval& a, const Interval& b, const Interval& c, const Interval& d) {
return merge(merge(a,b),merge(c,d));
}
/*! intersect bounding boxes */
__forceinline friend const Interval intersect( const Interval& a, const Interval& b ) { return Interval(max(a.lower, b.lower), min(a.upper, b.upper)); }
__forceinline friend const Interval intersect( const Interval& a, const Interval& b, const Interval& c ) { return intersect(a,intersect(b,c)); }
__forceinline friend const Interval intersect( const Interval& a, const Interval& b, const Interval& c, const Interval& d ) { return intersect(intersect(a,b),intersect(c,d)); }
friend std::ostream& operator<<(std::ostream& cout, const Interval& a) {
return cout << "[" << a.lower << ", " << a.upper << "]";
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline Interval( EmptyTy ) : lower(pos_inf), upper(neg_inf) {}
__forceinline Interval( FullTy ) : lower(neg_inf), upper(pos_inf) {}
};
__forceinline bool isEmpty(const Interval<float>& v) {
return v.lower > v.upper;
}
__forceinline vboolx isEmpty(const Interval<vfloatx>& v) {
return v.lower > v.upper;
}
/*! subset relation */
template<typename T> __forceinline bool subset( const Interval<T>& a, const Interval<T>& b ) {
return (a.lower > b.lower) && (a.upper < b.upper);
}
template<typename T> __forceinline bool subset( const Vec2<Interval<T>>& a, const Vec2<Interval<T>>& b ) {
return subset(a.x,b.x) && subset(a.y,b.y);
}
template<typename T> __forceinline const Vec2<Interval<T>> intersect( const Vec2<Interval<T>>& a, const Vec2<Interval<T>>& b ) {
return Vec2<Interval<T>>(intersect(a.x,b.x),intersect(a.y,b.y));
}
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline Interval<T> select ( bool s, const Interval<T>& t, const Interval<T>& f ) {
return Interval<T>(select(s,t.lower,f.lower),select(s,t.upper,f.upper));
}
template<typename T> __forceinline Interval<T> select ( const typename T::Bool& s, const Interval<T>& t, const Interval<T>& f ) {
return Interval<T>(select(s,t.lower,f.lower),select(s,t.upper,f.upper));
}
__forceinline int numRoots(const Interval<float>& p0, const Interval<float>& p1)
{
float eps = 1E-4f;
bool neg0 = p0.lower < eps; bool pos0 = p0.upper > -eps;
bool neg1 = p1.lower < eps; bool pos1 = p1.upper > -eps;
return (neg0 && pos1) || (pos0 && neg1) || (neg0 && pos0) || (neg1 && pos1);
}
typedef Interval<float> Interval1f;
typedef Vec2<Interval<float>> Interval2f;
typedef Vec3<Interval<float>> Interval3f;
}
+64 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -109,6 +109,56 @@ namespace embree
bounds1 = b1;
}
/*! calculates the linear bounds of a primitive for the specified time range */
template<typename BoundsFunc>
__forceinline LBBox(const BoundsFunc& bounds, const BBox1f& time_range_in, const BBox1f& geom_time_range, float geom_time_segments)
{
/* normalize global time_range_in to local geom_time_range */
const BBox1f time_range((time_range_in.lower-geom_time_range.lower)/geom_time_range.size(),
(time_range_in.upper-geom_time_range.lower)/geom_time_range.size());
const float lower = time_range.lower*geom_time_segments;
const float upper = time_range.upper*geom_time_segments;
const float ilowerf = floor(lower);
const float iupperf = ceil(upper);
const float ilowerfc = max(0.0f,ilowerf);
const float iupperfc = min(iupperf,geom_time_segments);
const int ilowerc = (int)ilowerfc;
const int iupperc = (int)iupperfc;
assert(iupperc-ilowerc > 0);
/* this larger iteration range guarantees that we process borders of geom_time_range is (partially) inside time_range_in */
const int ilower_iter = max(-1,(int)ilowerf);
const int iupper_iter = min((int)iupperf,(int)geom_time_segments+1);
const BBox<T> blower0 = bounds(ilowerc);
const BBox<T> bupper1 = bounds(iupperc);
if (iupper_iter-ilower_iter == 1) {
bounds0 = lerp(blower0, bupper1, max(0.0f,lower-ilowerfc));
bounds1 = lerp(bupper1, blower0, max(0.0f,iupperfc-upper));
return;
}
const BBox<T> blower1 = bounds(ilowerc+1);
const BBox<T> bupper0 = bounds(iupperc-1);
BBox<T> b0 = lerp(blower0, blower1, max(0.0f,lower-ilowerfc));
BBox<T> b1 = lerp(bupper1, bupper0, max(0.0f,iupperfc-upper));
for (int i = ilower_iter+1; i < iupper_iter; i++)
{
const float f = (float(i)/geom_time_segments - time_range.lower) / time_range.size();
const BBox<T> bt = lerp(b0, b1, f);
const BBox<T> bi = bounds(i);
const T dlower = min(bi.lower-bt.lower, T(zero));
const T dupper = max(bi.upper-bt.upper, T(zero));
b0.lower += dlower; b1.lower += dlower;
b0.upper += dupper; b1.upper += dupper;
}
bounds0 = b0;
bounds1 = b1;
}
/*! calculates the linear bounds of a primitive for the specified time range */
template<typename BoundsFunc>
__forceinline LBBox(const BoundsFunc& bounds, const range<int>& time_range, int numTimeSegments)
@@ -119,7 +169,8 @@ namespace embree
BBox<T> b0 = bounds(ilower);
BBox<T> b1 = bounds(iupper);
if (iupper-ilower == 1) {
if (iupper-ilower == 1)
{
bounds0 = b0;
bounds1 = b1;
return;
@@ -195,6 +246,12 @@ namespace embree
BBox<T> bounds0, bounds1;
};
/*! tests if box is finite */
template<typename T>
__forceinline bool isvalid( const LBBox<T>& v ) {
return isvalid(v.bounds0) && isvalid(v.bounds1);
}
template<typename T>
__forceinline T expectedArea(const T& a0, const T& a1, const T& b0, const T& b1)
{
@@ -223,6 +280,11 @@ namespace embree
return LBBox<T>(merge(a.bounds0, b.bounds0), merge(a.bounds1, b.bounds1));
}
/*! subset relation */
template<typename T> __inline bool subset( const LBBox<T>& a, const LBBox<T>& b ) {
return subset(a.bounds0,b.bounds0) && subset(a.bounds1,b.bounds1);
}
/*! default template instantiations */
typedef LBBox<float> LBBox1f;
typedef LBBox<Vec2f> LBBox2f;
+4 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -58,10 +58,10 @@ namespace embree
__forceinline const LinearSpace2 transposed() const { return LinearSpace2(vx.x,vx.y,vy.x,vy.y); }
/*! returns first row of matrix */
__forceinline const Vector row0() const { return Vector(vx.x,vy.x); }
__forceinline Vector row0() const { return Vector(vx.x,vy.x); }
/*! returns second row of matrix */
__forceinline const Vector row1() const { return Vector(vx.y,vy.y); }
__forceinline Vector row1() const { return Vector(vx.y,vy.y); }
////////////////////////////////////////////////////////////////////////////////
/// Constants
@@ -157,4 +157,5 @@ namespace embree
/*! Shortcuts for common linear spaces. */
typedef LinearSpace2<Vec2f> LinearSpace2f;
typedef LinearSpace2<Vec2fa> LinearSpace2fa;
}
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -66,13 +66,13 @@ namespace embree
__forceinline const LinearSpace3 transposed() const { return LinearSpace3(vx.x,vx.y,vx.z,vy.x,vy.y,vy.z,vz.x,vz.y,vz.z); }
/*! returns first row of matrix */
__forceinline const Vector row0() const { return Vector(vx.x,vy.x,vz.x); }
__forceinline Vector row0() const { return Vector(vx.x,vy.x,vz.x); }
/*! returns second row of matrix */
__forceinline const Vector row1() const { return Vector(vx.y,vy.y,vz.y); }
__forceinline Vector row1() const { return Vector(vx.y,vy.y,vz.y); }
/*! returns third row of matrix */
__forceinline const Vector row2() const { return Vector(vx.z,vy.z,vz.z); }
__forceinline Vector row2() const { return Vector(vx.z,vy.z,vz.z); }
////////////////////////////////////////////////////////////////////////////////
/// Constants
+3 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -270,9 +270,8 @@ namespace embree
__forceinline float select(bool s, float t, float f) { return s ? t : f; }
template<typename V>
__forceinline V lerp(const V& v0, const V& v1, const float t) {
return madd(V(1.0f-t),v0,t*v1);
__forceinline float lerp(const float v0, const float v1, const float t) {
return madd(1.0f-t,v0,t*v1);
}
template<typename T>
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,7 +33,7 @@ namespace embree
/// Construction
////////////////////////////////////////////////////////////////////////////////
__forceinline QuaternionT ( void ) { }
__forceinline QuaternionT () { }
__forceinline QuaternionT ( const QuaternionT& other ) { r = other.r; i = other.i; j = other.j; k = other.k; }
__forceinline QuaternionT& operator=( const QuaternionT& other ) { r = other.r; i = other.i; j = other.j; k = other.k; return *this; }
@@ -58,7 +58,7 @@ namespace embree
}
/*! returns the rotation axis of the quaternion as a vector */
__forceinline const Vec3<T> v( ) const { return Vec3<T>(i, j, k); }
__forceinline Vec3<T> v( ) const { return Vec3<T>(i, j, k); }
public:
T r, i, j, k;
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
+58 -10
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -20,6 +20,8 @@
namespace embree
{
struct Vec2fa;
////////////////////////////////////////////////////////////////////////////////
/// Generic 2D vector Class
////////////////////////////////////////////////////////////////////////////////
@@ -40,6 +42,8 @@ namespace embree
__forceinline Vec2( const T& x, const T& y ) : x(x), y(y) {}
__forceinline Vec2( const Vec2& other ) { x = other.x; y = other.y; }
__forceinline Vec2( const Vec2fa& other );
template<typename T1> __forceinline Vec2( const Vec2<T1>& a ) : x(T(a.x)), y(T(a.y)) {}
template<typename T1> __forceinline Vec2& operator =( const Vec2<T1>& other ) { x = other.x; y = other.y; return *this; }
@@ -92,15 +96,15 @@ namespace embree
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline const Vec2<T> madd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> msub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> nmadd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> nmsub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> madd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> msub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> nmadd ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> nmsub ( const Vec2<T>& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> madd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a,b.x,c.x), madd(a,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> msub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a,b.x,c.x), msub(a,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> nmadd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y) ); }
template<typename T> __forceinline const Vec2<T> nmsub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> madd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( madd(a,b.x,c.x), madd(a,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> msub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>( msub(a,b.x,c.x), msub(a,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> nmadd ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y) ); }
template<typename T> __forceinline Vec2<T> nmsub ( const T& a, const Vec2<T>& b, const Vec2<T>& c) { return Vec2<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y) ); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
@@ -132,12 +136,20 @@ namespace embree
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// Shift Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline Vec2<T> shift_right_1( const Vec2<T>& a ) {
return Vec2<T>(shift_right_1(a.x),shift_right_1(a.y));
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidian 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); }
template<typename T> __forceinline Vec2<T> cross ( const Vec2<T>& a ) { return Vec2<T>(-a.y,a.x); }
template<typename T> __forceinline T length ( const Vec2<T>& a ) { return sqrt(dot(a,a)); }
template<typename T> __forceinline Vec2<T> normalize( const Vec2<T>& a ) { return a*rsqrt(dot(a,a)); }
template<typename T> __forceinline T distance ( const Vec2<T>& a, const Vec2<T>& b ) { return length(a-b); }
@@ -163,6 +175,11 @@ namespace embree
return Vec2<T>(select(s,t.x,f.x),select(s,t.y,f.y));
}
template<typename T>
__forceinline Vec2<T> lerp(const Vec2<T>& v0, const Vec2<T>& v1, const T& t) {
return madd(Vec2<T>(T(1.0f)-t),v0,t*v1);
}
template<typename T> __forceinline int maxDim ( const Vec2<T>& a )
{
const Vec2<T> b = abs(a);
@@ -186,3 +203,34 @@ namespace embree
typedef Vec2<int > Vec2i;
typedef Vec2<float> Vec2f;
}
#include "vec2fa.h"
#if defined __SSE__
#include "../simd/sse.h"
#endif
#if defined __AVX__
#include "../simd/avx.h"
#endif
#if defined(__AVX512F__)
#include "../simd/avx512.h"
#endif
namespace embree
{
template<> __forceinline Vec2<float>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#if defined(__SSE__)
template<> __forceinline Vec2<vfloat4>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#endif
#if defined(__AVX__)
template<> __forceinline Vec2<vfloat8>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#endif
#if defined(__AVX512F__)
template<> __forceinline Vec2<vfloat16>::Vec2(const Vec2fa& a) : x(a.x), y(a.y) {}
#endif
}
+310
View File
@@ -0,0 +1,310 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#pragma once
#include "../sys/alloc.h"
#include "math.h"
#include "../simd/sse.h"
namespace embree
{
////////////////////////////////////////////////////////////////////////////////
/// SSE Vec2fa Type
////////////////////////////////////////////////////////////////////////////////
struct __aligned(16) Vec2fa
{
ALIGNED_STRUCT_(16);
typedef float Scalar;
enum { N = 2 };
union {
__m128 m128;
struct { float x,y,az,aw; };
};
////////////////////////////////////////////////////////////////////////////////
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa( ) {}
__forceinline Vec2fa( const __m128 a ) : m128(a) {}
__forceinline Vec2fa ( const Vec2<float>& other ) { x = other.x; y = other.y; }
__forceinline Vec2fa& operator =( const Vec2<float>& other ) { x = other.x; y = other.y; return *this; }
__forceinline Vec2fa ( const Vec2fa& other ) { m128 = other.m128; }
__forceinline Vec2fa& operator =( const Vec2fa& other ) { m128 = other.m128; return *this; }
__forceinline explicit Vec2fa( const float a ) : m128(_mm_set1_ps(a)) {}
__forceinline Vec2fa( const float x, const float y) : m128(_mm_set_ps(y, y, y, x)) {}
__forceinline explicit Vec2fa( const __m128i a ) : m128(_mm_cvtepi32_ps(a)) {}
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline Vec2fa load( const void* const a ) {
return Vec2fa(_mm_and_ps(_mm_load_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, 0, -1, -1))));
}
static __forceinline Vec2fa loadu( const void* const a ) {
return Vec2fa(_mm_and_ps(_mm_loadu_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, 0, -1, -1))));
}
static __forceinline void storeu ( void* ptr, const Vec2fa& v ) {
_mm_storeu_ps((float*)ptr,v);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa( ZeroTy ) : m128(_mm_setzero_ps()) {}
__forceinline Vec2fa( OneTy ) : m128(_mm_set1_ps(1.0f)) {}
__forceinline Vec2fa( PosInfTy ) : m128(_mm_set1_ps(pos_inf)) {}
__forceinline Vec2fa( NegInfTy ) : m128(_mm_set1_ps(neg_inf)) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline const float& operator []( const size_t index ) const { assert(index < 2); return (&x)[index]; }
__forceinline float& operator []( const size_t index ) { assert(index < 2); return (&x)[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa operator +( const Vec2fa& a ) { return a; }
__forceinline Vec2fa operator -( const Vec2fa& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
return _mm_xor_ps(a.m128, mask);
}
__forceinline Vec2fa abs ( const Vec2fa& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
return _mm_and_ps(a.m128, mask);
}
__forceinline Vec2fa sign ( const Vec2fa& a ) {
return blendv_ps(Vec2fa(one), -Vec2fa(one), _mm_cmplt_ps (a,Vec2fa(zero)));
}
__forceinline Vec2fa rcp ( const Vec2fa& a )
{
#if defined(__AVX512VL__)
const Vec2fa r = _mm_rcp14_ps(a.m128);
#else
const Vec2fa r = _mm_rcp_ps(a.m128);
#endif
#if defined(__AVX2__)
const Vec2fa res = _mm_mul_ps(r,_mm_fnmadd_ps(r, a, vfloat4(2.0f)));
#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));
#endif
return res;
}
__forceinline Vec2fa sqrt ( const Vec2fa& a ) { return _mm_sqrt_ps(a.m128); }
__forceinline Vec2fa sqr ( const Vec2fa& a ) { return _mm_mul_ps(a,a); }
__forceinline Vec2fa rsqrt( const Vec2fa& 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, _mm_set1_ps(-0.5f)), r), _mm_mul_ps(r, r)));
}
__forceinline Vec2fa zero_fix(const Vec2fa& a) {
return blendv_ps(a, _mm_set1_ps(min_rcp_input), _mm_cmplt_ps (abs(a).m128, _mm_set1_ps(min_rcp_input)));
}
__forceinline Vec2fa rcp_safe(const Vec2fa& a) {
return rcp(zero_fix(a));
}
__forceinline Vec2fa log ( const Vec2fa& a ) {
return Vec2fa(logf(a.x),logf(a.y));
}
__forceinline Vec2fa exp ( const Vec2fa& a ) {
return Vec2fa(expf(a.x),expf(a.y));
}
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa operator +( const Vec2fa& a, const Vec2fa& b ) { return _mm_add_ps(a.m128, b.m128); }
__forceinline Vec2fa operator -( const Vec2fa& a, const Vec2fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
__forceinline Vec2fa operator *( const Vec2fa& a, const Vec2fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
__forceinline Vec2fa operator *( const Vec2fa& a, const float b ) { return a * Vec2fa(b); }
__forceinline Vec2fa operator *( const float a, const Vec2fa& b ) { return Vec2fa(a) * b; }
__forceinline Vec2fa operator /( const Vec2fa& a, const Vec2fa& b ) { return _mm_div_ps(a.m128,b.m128); }
__forceinline Vec2fa operator /( const Vec2fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
__forceinline Vec2fa operator /( const float a, const Vec2fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
__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__)
__forceinline Vec2fa mini(const Vec2fa& a, const Vec2fa& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
const vint4 ci = _mm_min_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
#endif
#if 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);
const vint4 ci = _mm_max_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
#endif
__forceinline Vec2fa pow ( const Vec2fa& a, const float& b ) {
return Vec2fa(powf(a.x,b),powf(a.y,b));
}
////////////////////////////////////////////////////////////////////////////////
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX2__)
__forceinline Vec2fa madd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fmadd_ps(a,b,c); }
__forceinline Vec2fa msub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fmsub_ps(a,b,c); }
__forceinline Vec2fa nmadd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fnmadd_ps(a,b,c); }
__forceinline Vec2fa nmsub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return _mm_fnmsub_ps(a,b,c); }
#else
__forceinline Vec2fa madd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return a*b+c; }
__forceinline Vec2fa msub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return a*b-c; }
__forceinline Vec2fa nmadd ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return -a*b+c;}
__forceinline Vec2fa nmsub ( const Vec2fa& a, const Vec2fa& b, const Vec2fa& c) { return -a*b-c; }
#endif
__forceinline Vec2fa madd ( const float a, const Vec2fa& b, const Vec2fa& c) { return madd(Vec2fa(a),b,c); }
__forceinline Vec2fa msub ( const float a, const Vec2fa& b, const Vec2fa& c) { return msub(Vec2fa(a),b,c); }
__forceinline Vec2fa nmadd ( const float a, const Vec2fa& b, const Vec2fa& c) { return nmadd(Vec2fa(a),b,c); }
__forceinline Vec2fa nmsub ( const float a, const Vec2fa& b, const Vec2fa& c) { return nmsub(Vec2fa(a),b,c); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa& operator +=( Vec2fa& a, const Vec2fa& b ) { return a = a + b; }
__forceinline Vec2fa& operator -=( Vec2fa& a, const Vec2fa& b ) { return a = a - b; }
__forceinline Vec2fa& operator *=( Vec2fa& a, const Vec2fa& b ) { return a = a * b; }
__forceinline Vec2fa& operator *=( Vec2fa& a, const float b ) { return a = a * b; }
__forceinline Vec2fa& operator /=( Vec2fa& a, const Vec2fa& b ) { return a = a / b; }
__forceinline Vec2fa& operator /=( Vec2fa& a, const float b ) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline float reduce_add(const Vec2fa& v) { return v.x+v.y; }
__forceinline float reduce_mul(const Vec2fa& v) { return v.x*v.y; }
__forceinline float reduce_min(const Vec2fa& v) { return min(v.x,v.y); }
__forceinline float reduce_max(const Vec2fa& v) { return max(v.x,v.y); }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator ==( const Vec2fa& a, const Vec2fa& b ) { return (_mm_movemask_ps(_mm_cmpeq_ps (a.m128, b.m128)) & 3) == 3; }
__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
////////////////////////////////////////////////////////////////////////////////
#if defined(__SSE4_1__)
__forceinline float dot ( const Vec2fa& a, const Vec2fa& b ) {
return _mm_cvtss_f32(_mm_dp_ps(a,b,0x3F));
}
#else
__forceinline float dot ( const Vec2fa& a, const Vec2fa& b ) {
return reduce_add(a*b);
}
#endif
__forceinline Vec2fa cross ( const Vec2fa& a ) {
return Vec2fa(-a.y,a.x);
}
__forceinline float sqr_length ( const Vec2fa& a ) { return dot(a,a); }
__forceinline float rcp_length ( const Vec2fa& a ) { return rsqrt(dot(a,a)); }
__forceinline float rcp_length2( const Vec2fa& a ) { return rcp(dot(a,a)); }
__forceinline float length ( const Vec2fa& a ) { return sqrt(dot(a,a)); }
__forceinline Vec2fa normalize( const Vec2fa& a ) { return a*rsqrt(dot(a,a)); }
__forceinline float distance ( const Vec2fa& a, const Vec2fa& b ) { return length(a-b); }
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline Vec2fa select( bool s, const Vec2fa& t, const Vec2fa& 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);
}
__forceinline Vec2fa lerp(const Vec2fa& v0, const Vec2fa& v1, const float t) {
return madd(1.0f-t,v0,t*v1);
}
__forceinline int maxDim ( const Vec2fa& a )
{
const Vec2fa b = abs(a);
if (b.x > b.y) return 0;
else return 1;
}
////////////////////////////////////////////////////////////////////////////////
/// Rounding Functions
////////////////////////////////////////////////////////////////////////////////
#if 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 ); }
#else
//__forceinline Vec2fa trunc( const Vec2fa& a ) { return Vec2fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
__forceinline Vec2fa floor( const Vec2fa& a ) { return Vec2fa(floorf(a.x),floorf(a.y)); }
__forceinline Vec2fa ceil ( const Vec2fa& a ) { return Vec2fa(ceilf (a.x),ceilf (a.y)); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const Vec2fa& a) {
return cout << "(" << a.x << ", " << a.y << ")";
}
typedef Vec2fa Vec2fa_t;
}
+45 -33
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -77,7 +77,7 @@ namespace embree
select(abs(a.y)<min_rcp_input,T(min_rcp_input),a.y),
select(abs(a.z)<min_rcp_input,T(min_rcp_input),a.z));
}
template<typename T> __forceinline const Vec3<T> rcp_safe(const Vec3<T>& a) { return rcp(zero_fix(a)); }
template<typename T> __forceinline Vec3<T> rcp_safe(const Vec3<T>& a) { return rcp(zero_fix(a)); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
@@ -102,25 +102,25 @@ namespace embree
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline const Vec3<T> madd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z)); }
template<typename T> __forceinline const Vec3<T> msub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z)); }
template<typename T> __forceinline const Vec3<T> nmadd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z));}
template<typename T> __forceinline const Vec3<T> nmsub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> madd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> msub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> nmadd ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z));}
template<typename T> __forceinline Vec3<T> nmsub ( const Vec3<T>& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z)); }
template<typename T> __forceinline const Vec3<T> madd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z)); }
template<typename T> __forceinline const Vec3<T> msub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z)); }
template<typename T> __forceinline const Vec3<T> nmadd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z));}
template<typename T> __forceinline const Vec3<T> nmsub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> madd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> msub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z)); }
template<typename T> __forceinline Vec3<T> nmadd ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z));}
template<typename T> __forceinline Vec3<T> nmsub ( const T& a, const Vec3<T>& b, const Vec3<T>& c) { return Vec3<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z)); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline const Vec3<T>& operator +=( Vec3<T>& a, const T b ) { a.x += b; a.y += b; a.z += b; return a; }
template<typename T> __forceinline const Vec3<T>& operator +=( Vec3<T>& a, const Vec3<T>& b ) { a.x += b.x; a.y += b.y; a.z += b.z; return a; }
template<typename T> __forceinline const Vec3<T>& operator -=( Vec3<T>& a, const Vec3<T>& b ) { a.x -= b.x; a.y -= b.y; a.z -= b.z; return a; }
template<typename T> __forceinline const Vec3<T>& operator *=( Vec3<T>& a, const T& b ) { a.x *= b ; a.y *= b ; a.z *= b ; return a; }
template<typename T> __forceinline const Vec3<T>& operator /=( Vec3<T>& a, const T& b ) { a.x /= b ; a.y /= b ; a.z /= b ; return a; }
template<typename T> __forceinline Vec3<T>& operator +=( Vec3<T>& a, const T b ) { a.x += b; a.y += b; a.z += b; return a; }
template<typename T> __forceinline Vec3<T>& operator +=( Vec3<T>& a, const Vec3<T>& b ) { a.x += b.x; a.y += b.y; a.z += b.z; return a; }
template<typename T> __forceinline Vec3<T>& operator -=( Vec3<T>& a, const Vec3<T>& b ) { a.x -= b.x; a.y -= b.y; a.z -= b.z; return a; }
template<typename T> __forceinline Vec3<T>& operator *=( Vec3<T>& a, const T& b ) { a.x *= b ; a.y *= b ; a.z *= b ; return a; }
template<typename T> __forceinline Vec3<T>& operator /=( Vec3<T>& a, const T& b ) { a.x /= b ; a.y /= b ; a.z /= b ; return a; }
////////////////////////////////////////////////////////////////////////////////
/// Reduction Operators
@@ -144,6 +144,14 @@ namespace embree
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// Shift Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline Vec3<T> shift_right_1( const Vec3<T>& a ) {
return Vec3<T>(shift_right_1(a.x),shift_right_1(a.y),shift_right_1(a.z));
}
////////////////////////////////////////////////////////////////////////////////
/// Select
////////////////////////////////////////////////////////////////////////////////
@@ -270,66 +278,70 @@ namespace embree
namespace embree
{
template<typename Out, typename In>
__forceinline Vec3<Out> broadcast(const Vec3<In>& a, const size_t k) {
return Vec3<Out>(Out(a.x[k]),Out(a.y[k]),Out(a.z[k]));
__forceinline Vec3<Out> broadcast(const Vec3<In>& a, const size_t k) {
return Vec3<Out>(Out(a.x[k]), Out(a.y[k]), Out(a.z[k]));
}
template<> __forceinline Vec3<float>::Vec3( const Vec3fa& a ) { x = a.x; y = a.y; z = a.z; }
template<> __forceinline Vec3<float>::Vec3(const Vec3fa& a) { x = a.x; y = a.y; z = a.z; }
#if defined(__AVX__)
template<> __forceinline Vec3<vfloat4>::Vec3( const Vec3fa& a ) {
template<> __forceinline Vec3<vfloat4>::Vec3(const Vec3fa& a) {
x = a.x; y = a.y; z = a.z;
}
#elif defined(__SSE__)
template<> __forceinline Vec3<vfloat4>::Vec3( const Vec3fa& a ) {
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);
}
#endif
#if defined(__SSE__)
__forceinline Vec3<vfloat4> broadcast4f( const Vec3<vfloat4>& a, const size_t k ) {
__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]));
}
template<>
__forceinline Vec3<vfloat4> broadcast<vfloat4,vfloat4>( const Vec3<vfloat4>& a, const size_t k ) {
__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]));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const Vec3<vfloat4> shuffle( const Vec3<vfloat4>& b ) {
return Vec3<vfloat4>(shuffle<i0,i1,i2,i3>(b.x),shuffle<i0,i1,i2,i3>(b.y),shuffle<i0,i1,i2,i3>(b.z));
template<int i0, int i1, int i2, int i3>
__forceinline Vec3<vfloat4> shuffle(const Vec3<vfloat4>& b) {
return Vec3<vfloat4>(shuffle<i0,i1,i2,i3>(b.x), shuffle<i0,i1,i2,i3>(b.y), shuffle<i0,i1,i2,i3>(b.z));
}
#endif
#if defined(__AVX__)
template<> __forceinline Vec3<vfloat8>::Vec3( const Vec3fa& a ) {
template<>
__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 ) {
__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 ) {
__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 ) {
__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 ) {
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat4>(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]));
}
template<>
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat8>( const Vec3<vfloat8>& a, const size_t k ) {
__forceinline Vec3<vfloat8> broadcast<vfloat8,vfloat8>(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<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const Vec3<vfloat8> shuffle( const Vec3<vfloat8>& b ) {
return Vec3<vfloat8>(shuffle<i0,i1,i2,i3>(b.x),shuffle<i0,i1,i2,i3>(b.y),shuffle<i0,i1,i2,i3>(b.z));
template<int i0, int i1, int i2, int i3>
__forceinline Vec3<vfloat8> shuffle(const Vec3<vfloat8>& b) {
return Vec3<vfloat8>(shuffle<i0,i1,i2,i3>(b.x), shuffle<i0,i1,i2,i3>(b.y), shuffle<i0,i1,i2,i3>(b.z));
}
#endif
#if defined(__AVX512F__)
template<> __forceinline Vec3<vfloat16>::Vec3( const Vec3fa& a ) : x(a.x), y(a.y), z(a.z) {}
template<> __forceinline Vec3<vfloat16>::Vec3(const Vec3fa& a) : x(a.x), y(a.y), z(a.z) {}
#endif
}
+13 -13
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3ba
{
ALIGNED_STRUCT;
ALIGNED_STRUCT_(16);
union {
__m128 m128;
@@ -48,12 +48,12 @@ namespace embree
__forceinline Vec3ba& operator =(const Vec3ba& other) { m128 = other.m128; return *this; }
__forceinline explicit Vec3ba( bool a )
: m128(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
: m128(mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
__forceinline Vec3ba( bool a, bool b, bool c)
: m128(_mm_lookupmask_ps[(size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
: m128(mm_lookupmask_ps[(size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
__forceinline operator const __m128&( void ) const { return m128; }
__forceinline operator __m128&( void ) { return m128; }
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Constants
@@ -75,23 +75,23 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ba operator !( const Vec3ba& a ) { return _mm_xor_ps(a.m128, Vec3ba(embree::True)); }
__forceinline Vec3ba operator !( const Vec3ba& a ) { return _mm_xor_ps(a.m128, Vec3ba(embree::True)); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ba operator &( const Vec3ba& a, const Vec3ba& b ) { return _mm_and_ps(a.m128, b.m128); }
__forceinline const Vec3ba operator |( const Vec3ba& a, const Vec3ba& b ) { return _mm_or_ps (a.m128, b.m128); }
__forceinline const Vec3ba operator ^( const Vec3ba& a, const Vec3ba& b ) { return _mm_xor_ps(a.m128, b.m128); }
__forceinline Vec3ba operator &( const Vec3ba& a, const Vec3ba& b ) { return _mm_and_ps(a.m128, b.m128); }
__forceinline Vec3ba operator |( const Vec3ba& a, const Vec3ba& b ) { return _mm_or_ps (a.m128, b.m128); }
__forceinline Vec3ba operator ^( const Vec3ba& a, const Vec3ba& b ) { return _mm_xor_ps(a.m128, b.m128); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ba operator &=( Vec3ba& a, const Vec3ba& b ) { return a = a & b; }
__forceinline const Vec3ba operator |=( Vec3ba& a, const Vec3ba& b ) { return a = a | b; }
__forceinline const Vec3ba operator ^=( Vec3ba& a, const Vec3ba& b ) { return a = a ^ b; }
__forceinline Vec3ba& operator &=( Vec3ba& a, const Vec3ba& b ) { return a = a & b; }
__forceinline Vec3ba& operator |=( Vec3ba& a, const Vec3ba& b ) { return a = a | b; }
__forceinline Vec3ba& operator ^=( Vec3ba& a, const Vec3ba& b ) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
+54 -37
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3fa
{
ALIGNED_STRUCT;
ALIGNED_STRUCT_(16);
typedef float Scalar;
enum { N = 3 };
@@ -56,20 +56,27 @@ namespace embree
__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) { m128 = other.m128; w = w1; }
__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&( void ) const { return m128; }
__forceinline operator __m128&( void ) { return m128; }
__forceinline operator const __m128&() const { return m128; }
__forceinline operator __m128&() { return m128; }
#if defined (__SSE4_1__)
friend __forceinline const Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { return _mm_insert_ps(a, b, (3 << 4) | (3 << 6)); }
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { return _mm_insert_ps(a, b, (3 << 4) | (3 << 6)); }
#else
friend __forceinline const Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { Vec3fa c = a; c.a = b.a; return c; }
friend __forceinline Vec3fa copy_a( const Vec3fa& a, const Vec3fa& b ) { Vec3fa c = a; c.a = b.a; return c; }
#endif
////////////////////////////////////////////////////////////////////////////////
@@ -81,7 +88,7 @@ namespace embree
}
static __forceinline Vec3fa loadu( const void* const a ) {
return Vec3fa(_mm_and_ps(_mm_loadu_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1))));
return Vec3fa(_mm_loadu_ps((float*)a));
}
static __forceinline void storeu ( void* ptr, const Vec3fa& v ) {
@@ -109,20 +116,20 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3fa operator +( const Vec3fa& a ) { return a; }
__forceinline const Vec3fa operator -( const Vec3fa& a ) {
__forceinline Vec3fa operator +( const Vec3fa& a ) { return a; }
__forceinline Vec3fa operator -( const Vec3fa& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
return _mm_xor_ps(a.m128, mask);
}
__forceinline const Vec3fa abs ( const Vec3fa& a ) {
__forceinline Vec3fa abs ( const Vec3fa& a ) {
const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
return _mm_and_ps(a.m128, mask);
}
__forceinline const Vec3fa sign ( const Vec3fa& a ) {
__forceinline Vec3fa sign ( const Vec3fa& a ) {
return blendv_ps(Vec3fa(one), -Vec3fa(one), _mm_cmplt_ps (a,Vec3fa(zero)));
}
__forceinline const Vec3fa rcp ( const Vec3fa& a )
__forceinline Vec3fa rcp ( const Vec3fa& a )
{
#if defined(__AVX512VL__)
const Vec3fa r = _mm_rcp14_ps(a.m128);
@@ -140,10 +147,10 @@ namespace embree
return res;
}
__forceinline const Vec3fa sqrt ( const Vec3fa& a ) { return _mm_sqrt_ps(a.m128); }
__forceinline const Vec3fa sqr ( const Vec3fa& a ) { return _mm_mul_ps(a,a); }
__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 const Vec3fa rsqrt( const Vec3fa& a )
__forceinline Vec3fa rsqrt( const Vec3fa& a )
{
#if defined(__AVX512VL__)
__m128 r = _mm_rsqrt14_ps(a.m128);
@@ -153,10 +160,10 @@ namespace embree
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)));
}
__forceinline const Vec3fa zero_fix(const Vec3fa& a) {
__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)));
}
__forceinline const Vec3fa rcp_safe(const Vec3fa& a) {
__forceinline Vec3fa rcp_safe(const Vec3fa& a) {
return rcp(zero_fix(a));
}
__forceinline Vec3fa log ( const Vec3fa& a ) {
@@ -171,17 +178,17 @@ namespace embree
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3fa operator +( const Vec3fa& a, const Vec3fa& b ) { return _mm_add_ps(a.m128, b.m128); }
__forceinline const Vec3fa operator -( const Vec3fa& a, const Vec3fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
__forceinline const Vec3fa operator *( const Vec3fa& a, const Vec3fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
__forceinline const Vec3fa operator *( const Vec3fa& a, const float b ) { return a * Vec3fa(b); }
__forceinline const Vec3fa operator *( const float a, const Vec3fa& b ) { return Vec3fa(a) * b; }
__forceinline const Vec3fa operator /( const Vec3fa& a, const Vec3fa& b ) { return _mm_div_ps(a.m128,b.m128); }
__forceinline const Vec3fa operator /( const Vec3fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
__forceinline const Vec3fa operator /( const float a, const Vec3fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
__forceinline Vec3fa operator +( const Vec3fa& a, const Vec3fa& b ) { return _mm_add_ps(a.m128, b.m128); }
__forceinline Vec3fa operator -( const Vec3fa& a, const Vec3fa& b ) { return _mm_sub_ps(a.m128, b.m128); }
__forceinline Vec3fa operator *( const Vec3fa& a, const Vec3fa& b ) { return _mm_mul_ps(a.m128, b.m128); }
__forceinline Vec3fa operator *( const Vec3fa& a, const float b ) { return a * Vec3fa(b); }
__forceinline Vec3fa operator *( const float a, const Vec3fa& b ) { return Vec3fa(a) * b; }
__forceinline Vec3fa operator /( const Vec3fa& a, const Vec3fa& b ) { return _mm_div_ps(a.m128,b.m128); }
__forceinline Vec3fa operator /( const Vec3fa& a, const float b ) { return _mm_div_ps(a.m128,_mm_set1_ps(b)); }
__forceinline Vec3fa operator /( const float a, const Vec3fa& b ) { return _mm_div_ps(_mm_set1_ps(a),b.m128); }
__forceinline const Vec3fa min( const Vec3fa& a, const Vec3fa& b ) { return _mm_min_ps(a.m128,b.m128); }
__forceinline const Vec3fa max( const Vec3fa& a, const Vec3fa& b ) { return _mm_max_ps(a.m128,b.m128); }
__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__)
__forceinline Vec3fa mini(const Vec3fa& a, const Vec3fa& b) {
@@ -241,7 +248,13 @@ namespace embree
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline float reduce_add(const Vec3fa& v) { return v.x+v.y+v.z; }
__forceinline float reduce_add(const Vec3fa& v) {
const vfloat4 a(v);
const vfloat4 b = shuffle<1>(a);
const vfloat4 c = shuffle<2>(a);
return _mm_cvtss_f32(a+b+c);
}
__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); }
@@ -316,15 +329,19 @@ namespace embree
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3fa select( bool s, const Vec3fa& t, const Vec3fa& f ) {
__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);
}
__forceinline const Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
__forceinline Vec3fa select( const Vec3ba& s, const Vec3fa& t, const Vec3fa& f ) {
return blendv_ps(f, t, s);
}
__forceinline Vec3fa lerp(const Vec3fa& v0, const Vec3fa& v1, const float t) {
return madd(1.0f-t,v0,t*v1);
}
__forceinline int maxDim ( const Vec3fa& a )
{
const Vec3fa b = abs(a);
@@ -340,13 +357,13 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined (__SSE4_1__)
//__forceinline const Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
__forceinline const Vec3fa floor( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline const Vec3fa ceil ( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
__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 ); }
#else
//__forceinline const Vec3fa trunc( const Vec3fa& a ) { return Vec3fa(truncf(a.x),truncf(a.y),truncf(a.z)); }
__forceinline const Vec3fa floor( const Vec3fa& a ) { return Vec3fa(floorf(a.x),floorf(a.y),floorf(a.z)); }
__forceinline const Vec3fa ceil ( const Vec3fa& a ) { return Vec3fa(ceilf (a.x),ceilf (a.y),ceilf (a.z)); }
__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)); }
__forceinline Vec3fa ceil ( const Vec3fa& a ) { return Vec3fa(ceilf (a.x),ceilf (a.y),ceilf (a.z)); }
#endif
////////////////////////////////////////////////////////////////////////////////
+35 -35
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3ia
{
ALIGNED_STRUCT;
ALIGNED_STRUCT_(16);
union {
__m128i m128;
@@ -51,8 +51,8 @@ namespace embree
__forceinline Vec3ia( const int x, const int y, const int z) : m128(_mm_set_epi32(z, z, y, x)) {}
__forceinline explicit Vec3ia( const __m128 a ) : m128(_mm_cvtps_epi32(a)) {}
__forceinline operator const __m128i&( void ) const { return m128; }
__forceinline operator __m128i&( void ) { return m128; }
__forceinline operator const __m128i&() const { return m128; }
__forceinline operator __m128i&() { return m128; }
////////////////////////////////////////////////////////////////////////////////
/// Constants
@@ -76,48 +76,48 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ia operator +( const Vec3ia& a ) { return a; }
__forceinline const Vec3ia operator -( const Vec3ia& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.m128); }
__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__)
__forceinline const Vec3ia abs ( const Vec3ia& a ) { return _mm_abs_epi32(a.m128); }
__forceinline Vec3ia abs ( const Vec3ia& a ) { return _mm_abs_epi32(a.m128); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ia operator +( const Vec3ia& a, const Vec3ia& b ) { return _mm_add_epi32(a.m128, b.m128); }
__forceinline const Vec3ia operator +( const Vec3ia& a, const int b ) { return a+Vec3ia(b); }
__forceinline const Vec3ia operator +( const int a, const Vec3ia& b ) { return Vec3ia(a)+b; }
__forceinline Vec3ia operator +( const Vec3ia& a, const Vec3ia& b ) { return _mm_add_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; }
__forceinline const Vec3ia operator -( const Vec3ia& a, const Vec3ia& b ) { return _mm_sub_epi32(a.m128, b.m128); }
__forceinline const Vec3ia operator -( const Vec3ia& a, const int b ) { return a-Vec3ia(b); }
__forceinline const Vec3ia operator -( const int a, const Vec3ia& b ) { return Vec3ia(a)-b; }
__forceinline Vec3ia operator -( const Vec3ia& a, const Vec3ia& b ) { return _mm_sub_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; }
#if defined(__SSE4_1__)
__forceinline const Vec3ia operator *( const Vec3ia& a, const Vec3ia& b ) { return _mm_mullo_epi32(a.m128, b.m128); }
__forceinline const Vec3ia operator *( const Vec3ia& a, const int b ) { return a * Vec3ia(b); }
__forceinline const Vec3ia operator *( const int a, const Vec3ia& b ) { return Vec3ia(a) * b; }
__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; }
#endif
__forceinline const Vec3ia operator &( const Vec3ia& a, const Vec3ia& b ) { return _mm_and_si128(a.m128, b.m128); }
__forceinline const Vec3ia operator &( const Vec3ia& a, const int b ) { return a & Vec3ia(b); }
__forceinline const Vec3ia operator &( const int a, const Vec3ia& b ) { return Vec3ia(a) & b; }
__forceinline Vec3ia operator &( const Vec3ia& a, const Vec3ia& b ) { return _mm_and_si128(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; }
__forceinline const Vec3ia operator |( const Vec3ia& a, const Vec3ia& b ) { return _mm_or_si128(a.m128, b.m128); }
__forceinline const Vec3ia operator |( const Vec3ia& a, const int b ) { return a | Vec3ia(b); }
__forceinline const Vec3ia operator |( const int a, const Vec3ia& b ) { return Vec3ia(a) | b; }
__forceinline Vec3ia operator |( const Vec3ia& a, const Vec3ia& b ) { return _mm_or_si128(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; }
__forceinline const Vec3ia operator ^( const Vec3ia& a, const Vec3ia& b ) { return _mm_xor_si128(a.m128, b.m128); }
__forceinline const Vec3ia operator ^( const Vec3ia& a, const int b ) { return a ^ Vec3ia(b); }
__forceinline const Vec3ia operator ^( const int a, const Vec3ia& b ) { return Vec3ia(a) ^ b; }
__forceinline Vec3ia operator ^( const Vec3ia& a, const Vec3ia& b ) { return _mm_xor_si128(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; }
__forceinline const Vec3ia operator <<( const Vec3ia& a, const int n ) { return _mm_slli_epi32(a.m128, n); }
__forceinline const Vec3ia operator >>( const Vec3ia& a, const int n ) { return _mm_srai_epi32(a.m128, n); }
__forceinline Vec3ia operator <<( const Vec3ia& a, const int n ) { return _mm_slli_epi32(a.m128, n); }
__forceinline Vec3ia operator >>( const Vec3ia& a, const int n ) { return _mm_srai_epi32(a.m128, n); }
__forceinline const Vec3ia sll ( const Vec3ia& a, const int b ) { return _mm_slli_epi32(a.m128, b); }
__forceinline const Vec3ia sra ( const Vec3ia& a, const int b ) { return _mm_srai_epi32(a.m128, b); }
__forceinline const Vec3ia srl ( const Vec3ia& a, const int b ) { return _mm_srli_epi32(a.m128, b); }
__forceinline Vec3ia sll ( const Vec3ia& a, const int b ) { return _mm_slli_epi32(a.m128, b); }
__forceinline Vec3ia sra ( const Vec3ia& a, const int b ) { return _mm_srai_epi32(a.m128, b); }
__forceinline Vec3ia srl ( const Vec3ia& a, const int b ) { return _mm_srli_epi32(a.m128, b); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
@@ -173,7 +173,7 @@ namespace embree
/// Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const Vec3ia select( const Vec3ba& m, const Vec3ia& t, const Vec3ia& f ) {
__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
@@ -182,11 +182,11 @@ namespace embree
}
#if defined(__SSE4_1__)
__forceinline const Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return _mm_min_epi32(a.m128,b.m128); }
__forceinline const Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return _mm_max_epi32(a.m128,b.m128); }
__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
__forceinline const Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return select(lt_mask(a,b),a,b); }
__forceinline const Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return select(gt_mask(a,b),a,b); }
__forceinline Vec3ia min( const Vec3ia& a, const Vec3ia& b ) { return select(lt_mask(a,b),a,b); }
__forceinline Vec3ia max( const Vec3ia& a, const Vec3ia& b ) { return select(gt_mask(a,b),a,b); }
#endif
////////////////////////////////////////////////////////////////////////////////
+9 -9
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -99,15 +99,15 @@ namespace embree
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __forceinline const Vec4<T> madd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z), madd(a.w,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> msub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z), msub(a.w,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> nmadd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z),nmadd(a.w,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> nmsub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z),nmsub(a.w,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> madd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a.x,b.x,c.x), madd(a.y,b.y,c.y), madd(a.z,b.z,c.z), madd(a.w,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> msub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a.x,b.x,c.x), msub(a.y,b.y,c.y), msub(a.z,b.z,c.z), msub(a.w,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> nmadd ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a.x,b.x,c.x),nmadd(a.y,b.y,c.y),nmadd(a.z,b.z,c.z),nmadd(a.w,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> nmsub ( const Vec4<T>& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a.x,b.x,c.x),nmsub(a.y,b.y,c.y),nmsub(a.z,b.z,c.z),nmsub(a.w,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> madd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z), madd(a,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> msub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z), msub(a,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> nmadd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z),nmadd(a,b.w,c.w)); }
template<typename T> __forceinline const Vec4<T> nmsub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z),nmsub(a,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> madd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( madd(a,b.x,c.x), madd(a,b.y,c.y), madd(a,b.z,c.z), madd(a,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> msub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>( msub(a,b.x,c.x), msub(a,b.y,c.y), msub(a,b.z,c.z), msub(a,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> nmadd ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmadd(a,b.x,c.x),nmadd(a,b.y,c.y),nmadd(a,b.z,c.z),nmadd(a,b.w,c.w)); }
template<typename T> __forceinline Vec4<T> nmsub ( const T& a, const Vec4<T>& b, const Vec4<T>& c) { return Vec4<T>(nmsub(a,b.x,c.x),nmsub(a,b.y,c.y),nmsub(a,b.z,c.z),nmsub(a,b.w,c.w)); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
+6 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2017 Intel Corporation ##
## Copyright 2009-2018 Intel Corporation ##
## ##
## Licensed under the Apache License, Version 2.0 (the "License"); ##
## you may not use this file except in compliance with the License. ##
@@ -16,4 +16,9 @@
ADD_LIBRARY(simd STATIC sse.cpp)
SET_PROPERTY(TARGET simd PROPERTY FOLDER common)
SET_PROPERTY(TARGET simd APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
IF (EMBREE_STATIC_LIB)
INSTALL(TARGETS simd ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel)
SIGN_TARGET(simd)
ENDIF()
+3 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -28,11 +28,13 @@
#if defined(__AVX2__)
#include "vint8_avx2.h"
#include "vuint8_avx2.h"
#if defined(__X86_64__)
#include "vllong4_avx2.h"
#endif
#else
#include "vint8_avx.h"
#include "vuint8_avx.h"
#endif
#include "vfloat8_avx.h"
#if defined(__X86_64__)
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -23,9 +23,9 @@
#include "vboolf16_avx512.h"
#include "vint16_avx512.h"
#include "vuint16_avx512.h"
#include "vfloat16_avx512.h"
#include "vuint16_avx512.h"
#include "vboold8_avx512.h"
#include "vllong8_avx512.h"
#include "vdouble8_avx512.h"
+41 -25
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,49 +33,65 @@
# include "avx512.h"
#endif
#if defined(__AVX512F__)
# define AVX_ZERO_UPPER()
#elif defined (__AVX__)
# define AVX_ZERO_UPPER() _mm256_zeroupper()
#else
# define AVX_ZERO_UPPER()
#endif
namespace embree
{
/* foreach unique */
template<typename vbool, typename vint, typename Closure>
__forceinline void foreach_unique(const vbool& valid0, const vint& vi, const Closure& closure)
__forceinline void foreach_unique(const vbool& valid0, const vint& vi, const Closure& closure)
{
vbool valid1 = valid0;
while (any(valid1)) {
const int j = int(__bsf(movemask(valid1)));
const int j = int(bsf(movemask(valid1)));
const int i = vi[j];
const vbool valid2 = valid1 & (i == vi);
valid1 = valid1 & !valid2;
closure(valid2,i);
valid1 = andn(valid1, valid2);
closure(valid2, i);
}
}
/* foreach unique */
/* returns the next unique value i in vi and the corresponding valid_i mask */
template<typename vbool, typename vint>
__forceinline int next_unique(vbool& valid, const vint& vi, /*out*/ vbool& valid_i)
{
assert(any(valid));
const int j = int(bsf(movemask(valid)));
const int i = vi[j];
valid_i = valid & (i == vi);
valid = andn(valid, valid_i);
return i;
}
/* foreach unique index */
template<typename vbool, typename vint, typename Closure>
__forceinline void foreach_unique_index(const vbool& valid0, const vint& vi, const Closure& closure)
__forceinline void foreach_unique_index(const vbool& valid0, const vint& vi, const Closure& closure)
{
vbool valid1 = valid0;
while (any(valid1)) {
const int j = (int) __bsf(movemask(valid1));
const int j = int(bsf(movemask(valid1)));
const int i = vi[j];
const vbool valid2 = valid1 & (i == vi);
valid1 = valid1 & !valid2;
closure(valid2,i,j);
valid1 = andn(valid1, valid2);
closure(valid2, i, j);
}
}
/* returns the index of the next unique value i in vi and the corresponding valid_i mask */
template<typename vbool, typename vint>
__forceinline int next_unique_index(vbool& valid, const vint& vi, /*out*/ vbool& valid_i)
{
assert(any(valid));
const int j = int(bsf(movemask(valid)));
const int i = vi[j];
valid_i = valid & (i == vi);
valid = andn(valid, valid_i);
return j;
}
template<typename Closure>
__forceinline void foreach2(int x0, int x1, int y0, int y1, const Closure& closure)
__forceinline void foreach2(int x0, int x1, int y0, int y1, const Closure& closure)
{
__aligned(64) int U[128];
__aligned(64) int V[128];
__aligned(64) int U[2*VSIZEX];
__aligned(64) int V[2*VSIZEX];
int index = 0;
for (int y=y0; y<y1; y++) {
const bool lasty = y+1>=y1;
@@ -83,15 +99,15 @@ namespace embree
for (int x=x0; x<x1; ) { //x+=VSIZEX) {
const bool lastx = x+VSIZEX >= x1;
vintx vx = x+vintx(step);
vintx::storeu(&U[index],vx);
vintx::storeu(&V[index],vy);
vintx::storeu(&U[index], vx);
vintx::storeu(&V[index], vy);
const int dx = min(x1-x,VSIZEX);
index += dx;
x += dx;
if (index >= VSIZEX || (lastx && lasty)) {
const vboolx valid = vintx(step) < vintx(index);
closure(valid,vintx::load(U),vintx::load(V));
x-= max(0,index-VSIZEX);
closure(valid, vintx::load(U), vintx::load(V));
x-= max(0, index-VSIZEX);
index = 0;
}
}
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -18,7 +18,7 @@
namespace embree
{
const __m128 _mm_lookupmask_ps[16] = {
const __m128 mm_lookupmask_ps[16] = {
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0, 0)),
_mm_castsi128_ps(_mm_set_epi32( 0, 0, 0,-1)),
_mm_castsi128_ps(_mm_set_epi32( 0, 0,-1, 0)),
@@ -37,7 +37,7 @@ namespace embree
_mm_castsi128_ps(_mm_set_epi32(-1,-1,-1,-1))
};
const __m128d _mm_lookupmask_pd[4] = {
const __m128d mm_lookupmask_pd[4] = {
_mm_castsi128_pd(_mm_set_epi32( 0, 0, 0, 0)),
_mm_castsi128_pd(_mm_set_epi32( 0, 0,-1,-1)),
_mm_castsi128_pd(_mm_set_epi32(-1,-1, 0, 0)),
+5 -5
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -24,17 +24,17 @@
namespace embree
{
#if defined(__SSE4_1__)
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
__forceinline __m128 blendv_ps(__m128 f, __m128 t, __m128 mask) {
return _mm_blendv_ps(f,t,mask);
}
#else
__forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) {
__forceinline __m128 blendv_ps(__m128 f, __m128 t, __m128 mask) {
return _mm_or_ps(_mm_and_ps(mask, t), _mm_andnot_ps(mask, f));
}
#endif
extern const __m128 _mm_lookupmask_ps[16];
extern const __m128d _mm_lookupmask_pd[4];
extern const __m128 mm_lookupmask_ps[16];
extern const __m128d mm_lookupmask_pd[4];
}
#if defined(__AVX512VL__)
+12 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -69,13 +69,19 @@ namespace embree
template<int N> using vreal = vfloat<N>;
template<int N> using vbool = vboolf<N>;
/* Maximum supported varying size */
#if defined(__AVX512F__)
/* Varying size constants */
#if defined(__AVX512VL__) // SKX
const int VSIZEX = 8; // default size
const int VSIZEL = 16; // large size
#elif defined(__AVX512F__) // KNL
const int VSIZEX = 16;
const int VSIZEL = 16;
#elif defined(__AVX__)
const int VSIZEX = 8;
const int VSIZEL = 8;
#else
const int VSIZEX = 4;
const int VSIZEL = 4;
#endif
/* Extends varying size N to optimal or up to max(N, N2) */
@@ -109,6 +115,7 @@ namespace embree
typedef vdouble<8> vdouble8;
typedef vreal<8> vreal8;
typedef vint<8> vint8;
typedef vuint<8> vuint8;
typedef vllong<8> vllong8;
typedef vbool<8> vbool8;
typedef vboolf<8> vboolf8;
@@ -125,11 +132,12 @@ namespace embree
typedef vboolf<16> vboolf16;
typedef vboold<16> vboold16;
/* Maximum shortcuts */
/* Default shortcuts */
typedef vfloat<VSIZEX> vfloatx;
typedef vdouble<VSIZEX> vdoublex;
typedef vreal<VSIZEX> vrealx;
typedef vint<VSIZEX> vintx;
typedef vuint<VSIZEX> vuintx;
typedef vllong<VSIZEX> vllongx;
typedef vbool<VSIZEX> vboolx;
typedef vboolf<VSIZEX> vboolfx;
+49 -45
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -35,18 +35,18 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold () {}
__forceinline vboold ( const vboold4& a ) { v = a.v; }
__forceinline vboold4& operator=( const vboold4& a ) { v = a.v; return *this; }
__forceinline vboold() {}
__forceinline vboold(const vboold4& a) { v = a.v; }
__forceinline vboold4& operator =(const vboold4& a) { v = a.v; return *this; }
__forceinline vboold( const __m256d a ) : v(a) {}
__forceinline vboold( const __m256i a ) : v(_mm256_castsi256_pd(a)) {}
__forceinline vboold(__m256d a) : v(a) {}
__forceinline vboold(__m256i a) : v(_mm256_castsi256_pd(a)) {}
__forceinline operator const __m256( void ) const { return _mm256_castpd_ps(v); }
__forceinline operator const __m256i( void ) const { return _mm256_castpd_si256(v); }
__forceinline operator const __m256d( void ) const { return v; }
__forceinline operator const __m256() const { return _mm256_castpd_ps(v); }
__forceinline operator const __m256i() const { return _mm256_castpd_si256(v); }
__forceinline operator const __m256d() const { return v; }
__forceinline vboold ( const int a )
__forceinline vboold(int a)
{
assert(a >= 0 && a <= 255);
#if defined (__AVX2__)
@@ -55,54 +55,56 @@ namespace embree
const __m256i c = _mm256_and_si256(b,mask);
v = _mm256_castsi256_pd(_mm256_cmpeq_epi64(c,mask));
#else
vl = _mm_lookupmask_pd[a & 0x3];
vh = _mm_lookupmask_pd[a >> 2];
vl = mm_lookupmask_pd[a & 0x3];
vh = mm_lookupmask_pd[a >> 2];
#endif
}
__forceinline vboold ( const __m128d a, const __m128d b) : vl(a), vh(b) {}
__forceinline vboold(__m128d a, __m128d b) : vl(a), vh(b) {}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold( FalseTy ) : v(_mm256_setzero_pd()) {}
__forceinline vboold( TrueTy ) : v(_mm256_cmp_pd(_mm256_setzero_pd(), _mm256_setzero_pd(), _CMP_EQ_OQ)) {}
__forceinline vboold(FalseTy) : v(_mm256_setzero_pd()) {}
__forceinline vboold(TrueTy) : v(_mm256_cmp_pd(_mm256_setzero_pd(), _mm256_setzero_pd(), _CMP_EQ_OQ)) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator []( const size_t index ) const { assert(index < 4); return (_mm256_movemask_pd(v) >> index) & 1; }
__forceinline long long& operator []( const size_t index ) { assert(index < 4); return i[index]; }
__forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm256_movemask_pd(v) >> index) & 1; }
__forceinline long long& operator [](size_t index) { assert(index < 4); return i[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold4 operator !( const vboold4& a ) { return _mm256_xor_pd(a, vboold4(embree::True)); }
__forceinline vboold4 operator !(const vboold4& a) { return _mm256_xor_pd(a, vboold4(embree::True)); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold4 operator &( const vboold4& a, const vboold4& b ) { return _mm256_and_pd(a, b); }
__forceinline const vboold4 operator |( const vboold4& a, const vboold4& b ) { return _mm256_or_pd (a, b); }
__forceinline const vboold4 operator ^( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(a, b); }
__forceinline vboold4 operator &(const vboold4& a, const vboold4& b) { return _mm256_and_pd(a, b); }
__forceinline vboold4 operator |(const vboold4& a, const vboold4& b) { return _mm256_or_pd (a, b); }
__forceinline vboold4 operator ^(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(a, b); }
__forceinline vboold4 operator &=( vboold4& a, const vboold4& b ) { return a = a & b; }
__forceinline vboold4 operator |=( vboold4& a, const vboold4& b ) { return a = a | b; }
__forceinline vboold4 operator ^=( vboold4& a, const vboold4& b ) { return a = a ^ b; }
__forceinline vboold4 andn(const vboold4& a, const vboold4& b) { return _mm256_andnot_pd(b, a); }
__forceinline vboold4& operator &=(vboold4& a, const vboold4& b) { return a = a & b; }
__forceinline vboold4& operator |=(vboold4& a, const vboold4& b) { return a = a | b; }
__forceinline vboold4& operator ^=(vboold4& a, const vboold4& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold4 operator !=( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(a, b); }
__forceinline const vboold4 operator ==( const vboold4& a, const vboold4& b ) { return _mm256_xor_pd(_mm256_xor_pd(a,b),vboold4(embree::True)); }
__forceinline vboold4 operator !=(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(a, b); }
__forceinline vboold4 operator ==(const vboold4& a, const vboold4& b) { return _mm256_xor_pd(_mm256_xor_pd(a,b),vboold4(embree::True)); }
__forceinline const vboold4 select( const vboold4& mask, const vboold4& t, const vboold4& f ) {
__forceinline vboold4 select(const vboold4& mask, const vboold4& t, const vboold4& f) {
return _mm256_blendv_pd(f, t, mask);
}
@@ -110,17 +112,19 @@ namespace embree
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold4 unpacklo( const vboold4& a, const vboold4& b ) { return _mm256_unpacklo_pd(a.v, b.v); }
__forceinline vboold4 unpackhi( const vboold4& a, const vboold4& b ) { return _mm256_unpackhi_pd(a.v, b.v); }
__forceinline vboold4 unpacklo(const vboold4& a, const vboold4& b) { return _mm256_unpacklo_pd(a, b); }
__forceinline vboold4 unpackhi(const vboold4& a, const vboold4& b) { return _mm256_unpackhi_pd(a, b); }
#if defined(__AVX2__)
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboold4 shuffle( const vboold4& a ) {
return _mm256_permute4x64_pd(a, _MM_SHUFFLE(i3, i2, i1, i0));
template<int i0, int i1, int i2, int i3>
__forceinline vboold4 shuffle(const vboold4& v) {
return _mm256_permute4x64_pd(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<size_t i> __forceinline const vboold4 shuffle( const vboold4& a ) {
return _mm256_permute4x64_pd(a, _MM_SHUFFLE(i, i, i, i));
template<int i>
__forceinline vboold4 shuffle(const vboold4& v) {
return _mm256_permute4x64_pd(v, _MM_SHUFFLE(i, i, i, i));
}
#endif
@@ -129,33 +133,33 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline bool reduce_and( const vboold4& a ) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
__forceinline bool reduce_or ( const vboold4& a ) { return !_mm256_testz_pd(a,a); }
__forceinline bool reduce_and(const vboold4& a) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
__forceinline bool reduce_or (const vboold4& a) { return !_mm256_testz_pd(a,a); }
__forceinline bool all ( const vboold4& a ) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
__forceinline bool any ( const vboold4& a ) { return !_mm256_testz_pd(a,a); }
__forceinline bool none ( const vboold4& a ) { return _mm256_testz_pd(a,a) != 0; }
__forceinline bool all (const vboold4& a) { return _mm256_movemask_pd(a) == (unsigned int)0xf; }
__forceinline bool any (const vboold4& a) { return !_mm256_testz_pd(a,a); }
__forceinline bool none(const vboold4& a) { return _mm256_testz_pd(a,a) != 0; }
__forceinline bool all ( const vboold4& valid, const vboold4& b ) { return all((!valid) | b); }
__forceinline bool any ( const vboold4& valid, const vboold4& b ) { return any( valid & b); }
__forceinline bool none ( const vboold4& valid, const vboold4& b ) { return none(valid & b); }
__forceinline bool all (const vboold4& valid, const vboold4& b) { return all((!valid) | b); }
__forceinline bool any (const vboold4& valid, const vboold4& b) { return any(valid & b); }
__forceinline bool none(const vboold4& valid, const vboold4& b) { return none(valid & b); }
__forceinline unsigned int movemask( const vboold4& a ) { return _mm256_movemask_pd(a); }
__forceinline size_t popcnt ( const vboold4& a ) { return __popcnt((size_t)_mm256_movemask_pd(a)); }
__forceinline unsigned int movemask(const vboold4& a) { return _mm256_movemask_pd(a); }
__forceinline size_t popcnt (const vboold4& a) { return popcnt((size_t)_mm256_movemask_pd(a)); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline bool get(const vboold4& a, size_t index) { return a[index]; }
__forceinline void set (vboold4& a, size_t index) { a[index] = -1; }
__forceinline void set (vboold4& a, size_t index) { a[index] = -1; }
__forceinline void clear(vboold4& a, size_t index) { a[index] = 0; }
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboold4& a) {
inline std::ostream& operator <<(std::ostream& cout, const vboold4& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", "
<< a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
}
+34 -26
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,8 +33,8 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold() {}
__forceinline vboold(const vboold4 &t) { v = t.v; }
__forceinline vboold4& operator=(const vboold4 &f) { v = f.v; return *this; }
__forceinline vboold(const vboold4& t) { v = t.v; }
__forceinline vboold4& operator =(const vboold4& f) { v = f.v; return *this; }
__forceinline vboold(const __mmask8 &t) { v = t; }
__forceinline operator __mmask8() const { return v; }
@@ -62,42 +62,50 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold( FalseTy ) : v(0x0) {}
__forceinline vboold( TrueTy ) : v(0xf) {}
__forceinline vboold(FalseTy) : v(0x0) {}
__forceinline vboold(TrueTy) : v(0xf) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator [](size_t index) const {
assert(index < 4); return (mm512_mask2int(v) >> index) & 1;
}
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold4 operator!(const vboold4 &a) { return _mm512_kandn(a, 0xf); }
__forceinline vboold4 operator !(const vboold4& a) { return _mm512_kandn(a, 0xf); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold4 operator&(const vboold4 &a, const vboold4 &b) { return _mm512_kand(a, b); }
__forceinline vboold4 operator|(const vboold4 &a, const vboold4 &b) { return _mm512_kor(a, b); }
__forceinline vboold4 operator^(const vboold4 &a, const vboold4 &b) { return _mm512_kxor(a, b); }
__forceinline vboold4 operator &(const vboold4& a, const vboold4& b) { return _mm512_kand(a, b); }
__forceinline vboold4 operator |(const vboold4& a, const vboold4& b) { return _mm512_kor(a, b); }
__forceinline vboold4 operator ^(const vboold4& a, const vboold4& b) { return _mm512_kxor(a, b); }
__forceinline vboold4 andn(const vboold4 &a, const vboold4 &b) { return _mm512_kandn(b, a); }
__forceinline vboold4 andn(const vboold4& a, const vboold4& b) { return _mm512_kandn(b, a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold4 operator &=( vboold4& a, const vboold4& b ) { return a = a & b; }
__forceinline const vboold4 operator |=( vboold4& a, const vboold4& b ) { return a = a | b; }
__forceinline const vboold4 operator ^=( vboold4& a, const vboold4& b ) { return a = a ^ b; }
__forceinline vboold4& operator &=(vboold4& a, const vboold4& b) { return a = a & b; }
__forceinline vboold4& operator |=(vboold4& a, const vboold4& b) { return a = a | b; }
__forceinline vboold4& operator ^=(vboold4& a, const vboold4& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold4 operator !=( const vboold4& a, const vboold4& b ) { return _mm512_kxor(a, b); }
__forceinline const vboold4 operator ==( const vboold4& a, const vboold4& b ) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
__forceinline vboold4 operator !=(const vboold4& a, const vboold4& b) { return _mm512_kxor(a, b); }
__forceinline vboold4 operator ==(const vboold4& a, const vboold4& b) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
__forceinline vboold4 select (const vboold4 &s, const vboold4 &a, const vboold4 &b) {
__forceinline vboold4 select(const vboold4& s, const vboold4& a, const vboold4& b) {
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
}
@@ -105,22 +113,22 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline int all (const vboold4 &a) { return a.v == 0xf; }
__forceinline int any (const vboold4 &a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboold4 &a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all (const vboold4& a) { return a.v == 0xf; }
__forceinline int any (const vboold4& a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboold4& a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all ( const vboold4& valid, const vboold4& b ) { return all((!valid) | b); }
__forceinline int any ( const vboold4& valid, const vboold4& b ) { return any( valid & b); }
__forceinline int none( const vboold4& valid, const vboold4& b ) { return none(valid & b); }
__forceinline int all (const vboold4& valid, const vboold4& b) { return all((!valid) | b); }
__forceinline int any (const vboold4& valid, const vboold4& b) { return any(valid & b); }
__forceinline int none(const vboold4& valid, const vboold4& b) { return none(valid & b); }
__forceinline size_t movemask( const vboold4& a ) { return _mm512_kmov(a); }
__forceinline size_t popcnt ( const vboold4& a ) { return __popcnt(a.v); }
__forceinline size_t movemask(const vboold4& a) { return _mm512_kmov(a); }
__forceinline size_t popcnt (const vboold4& a) { return popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline unsigned int toInt(const vboold4 &a) { return mm512_mask2int(a); }
__forceinline unsigned int toInt(const vboold4& a) { return mm512_mask2int(a); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -134,7 +142,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboold4& a)
inline std::ostream& operator <<(std::ostream& cout, const vboold4& a)
{
cout << "<";
for (size_t i=0; i<4; i++) {
+35 -27
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,10 +33,10 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold() {}
__forceinline vboold(const vboold8 &t) { v = t.v; }
__forceinline vboold8& operator=(const vboold8 &f) { v = f.v; return *this; }
__forceinline vboold(const vboold8& t) { v = t.v; }
__forceinline vboold8& operator =(const vboold8& f) { v = f.v; return *this; }
__forceinline vboold(const __mmask8 &t) { v = t; }
__forceinline vboold(const __mmask8& t) { v = t; }
__forceinline operator __mmask8() const { return v; }
__forceinline vboold(bool b) { v = b ? 0xff : 0x00; }
@@ -70,42 +70,50 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold( FalseTy ) : v(0x00) {}
__forceinline vboold( TrueTy ) : v(0xff) {}
__forceinline vboold(FalseTy) : v(0x00) {}
__forceinline vboold(TrueTy) : v(0xff) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator [](size_t index) const {
assert(index < 8); return (mm512_mask2int(v) >> index) & 1;
}
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold8 operator!(const vboold8 &a) { return _mm512_knot(a); }
__forceinline vboold8 operator !(const vboold8& a) { return _mm512_knot(a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboold8 operator&(const vboold8 &a, const vboold8 &b) { return _mm512_kand(a, b); }
__forceinline vboold8 operator|(const vboold8 &a, const vboold8 &b) { return _mm512_kor(a, b); }
__forceinline vboold8 operator^(const vboold8 &a, const vboold8 &b) { return _mm512_kxor(a, b); }
__forceinline vboold8 operator &(const vboold8& a, const vboold8& b) { return _mm512_kand(a, b); }
__forceinline vboold8 operator |(const vboold8& a, const vboold8& b) { return _mm512_kor(a, b); }
__forceinline vboold8 operator ^(const vboold8& a, const vboold8& b) { return _mm512_kxor(a, b); }
__forceinline vboold8 andn(const vboold8 &a, const vboold8 &b) { return _mm512_kandn(b, a); }
__forceinline vboold8 andn(const vboold8& a, const vboold8& b) { return _mm512_kandn(b, a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold8 operator &=( vboold8& a, const vboold8& b ) { return a = a & b; }
__forceinline const vboold8 operator |=( vboold8& a, const vboold8& b ) { return a = a | b; }
__forceinline const vboold8 operator ^=( vboold8& a, const vboold8& b ) { return a = a ^ b; }
__forceinline vboold8& operator &=(vboold8& a, const vboold8& b) { return a = a & b; }
__forceinline vboold8& operator |=(vboold8& a, const vboold8& b) { return a = a | b; }
__forceinline vboold8& operator ^=(vboold8& a, const vboold8& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold8 operator !=( const vboold8& a, const vboold8& b ) { return _mm512_kxor(a, b); }
__forceinline const vboold8 operator ==( const vboold8& a, const vboold8& b ) { return _mm512_kxnor(a, b); }
__forceinline vboold8 operator !=(const vboold8& a, const vboold8& b) { return _mm512_kxor(a, b); }
__forceinline vboold8 operator ==(const vboold8& a, const vboold8& b) { return _mm512_kxnor(a, b); }
__forceinline vboold8 select(const vboold8 &s, const vboold8 &a, const vboold8 &b) {
__forceinline vboold8 select(const vboold8& s, const vboold8& a, const vboold8& b) {
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
}
@@ -113,22 +121,22 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline int all (const vboold8 &a) { return a.v == 0xff; }
__forceinline int any (const vboold8 &a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboold8 &a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all (const vboold8& a) { return a.v == 0xff; }
__forceinline int any (const vboold8& a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboold8& a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all ( const vboold8& valid, const vboold8& b ) { return all((!valid) | b); }
__forceinline int any ( const vboold8& valid, const vboold8& b ) { return any( valid & b); }
__forceinline int none( const vboold8& valid, const vboold8& b ) { return none(valid & b); }
__forceinline int all (const vboold8& valid, const vboold8& b) { return all((!valid) | b); }
__forceinline int any (const vboold8& valid, const vboold8& b) { return any(valid & b); }
__forceinline int none(const vboold8& valid, const vboold8& b) { return none(valid & b); }
__forceinline size_t movemask( const vboold8& a ) { return _mm512_kmov(a); }
__forceinline size_t popcnt ( const vboold8& a ) { return __popcnt(a.v); }
__forceinline size_t movemask(const vboold8& a) { return _mm512_kmov(a); }
__forceinline size_t popcnt (const vboold8& a) { return popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline unsigned int toInt(const vboold8 &a) { return mm512_mask2int(a); }
__forceinline unsigned int toInt(const vboold8& a) { return mm512_mask2int(a); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -142,7 +150,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboold8& a)
inline std::ostream& operator <<(std::ostream& cout, const vboold8& a)
{
cout << "<";
for (size_t i=0; i<8; i++) {
+32 -32
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -34,15 +34,15 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf() {}
__forceinline vboolf(const vboolf16 &t) { v = t.v; }
__forceinline vboolf16& operator=(const vboolf16 &f) { v = f.v; return *this; }
__forceinline vboolf(const vboolf16& t) { v = t.v; }
__forceinline vboolf16& operator =(const vboolf16& f) { v = f.v; return *this; }
__forceinline vboolf(const __mmask16 &t) { v = t; }
__forceinline operator __mmask16 () const { return v; }
__forceinline vboolf(const __mmask16& t) { v = t; }
__forceinline operator __mmask16() const { return v; }
__forceinline vboolf(bool b) { v = b ? 0xFFFF : 0x0000; }
__forceinline vboolf(int t ) { v = (__mmask16)t; }
__forceinline vboolf(unsigned int t ) { v = (__mmask16)t; }
__forceinline vboolf(int t) { v = (__mmask16)t; }
__forceinline vboolf(unsigned int t) { v = (__mmask16)t; }
/* return int8 mask */
__forceinline __m128i mask8() const {
@@ -71,14 +71,14 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf( FalseTy ) : v(0x0000) {}
__forceinline vboolf( TrueTy ) : v(0xffff) {}
__forceinline vboolf(FalseTy) : v(0x0000) {}
__forceinline vboolf(TrueTy) : v(0xffff) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator []( const size_t index ) const {
__forceinline bool operator [](size_t index) const {
assert(index < 16); return (mm512_mask2int(v) >> index) & 1;
}
};
@@ -87,34 +87,34 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf16 operator!(const vboolf16 &a) { return _mm512_knot(a); }
__forceinline vboolf16 operator !(const vboolf16& a) { return _mm512_knot(a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf16 operator&(const vboolf16 &a, const vboolf16 &b) { return _mm512_kand(a,b); }
__forceinline vboolf16 operator|(const vboolf16 &a, const vboolf16 &b) { return _mm512_kor(a,b); }
__forceinline vboolf16 operator^(const vboolf16 &a, const vboolf16 &b) { return _mm512_kxor(a,b); }
__forceinline vboolf16 operator &(const vboolf16& a, const vboolf16& b) { return _mm512_kand(a,b); }
__forceinline vboolf16 operator |(const vboolf16& a, const vboolf16& b) { return _mm512_kor(a,b); }
__forceinline vboolf16 operator ^(const vboolf16& a, const vboolf16& b) { return _mm512_kxor(a,b); }
__forceinline vboolf16 andn(const vboolf16 &a, const vboolf16 &b) { return _mm512_kandn(b,a); }
__forceinline vboolf16 andn(const vboolf16& a, const vboolf16& b) { return _mm512_kandn(b,a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf16 operator &=( vboolf16& a, const vboolf16& b ) { return a = a & b; }
__forceinline const vboolf16 operator |=( vboolf16& a, const vboolf16& b ) { return a = a | b; }
__forceinline const vboolf16 operator ^=( vboolf16& a, const vboolf16& b ) { return a = a ^ b; }
__forceinline vboolf16& operator &=(vboolf16& a, const vboolf16& b) { return a = a & b; }
__forceinline vboolf16& operator |=(vboolf16& a, const vboolf16& b) { return a = a | b; }
__forceinline vboolf16& operator ^=(vboolf16& a, const vboolf16& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf16 operator !=( const vboolf16& a, const vboolf16& b ) { return _mm512_kxor(a, b); }
__forceinline const vboolf16 operator ==( const vboolf16& a, const vboolf16& b ) { return _mm512_kxnor(a, b); }
__forceinline vboolf16 operator !=(const vboolf16& a, const vboolf16& b) { return _mm512_kxor(a, b); }
__forceinline vboolf16 operator ==(const vboolf16& a, const vboolf16& b) { return _mm512_kxnor(a, b); }
__forceinline vboolf16 select (const vboolf16 &s, const vboolf16 &a, const vboolf16 &b) {
__forceinline vboolf16 select(const vboolf16& s, const vboolf16& a, const vboolf16& b) {
return _mm512_kor(_mm512_kand(s,a),_mm512_kandn(s,b));
}
@@ -122,23 +122,23 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline int all (const vboolf16 &a) { return _mm512_kortestc(a,a) != 0; }
__forceinline int any (const vboolf16 &a) { return _mm512_kortestz(a,a) == 0; }
__forceinline int none(const vboolf16 &a) { return _mm512_kortestz(a,a) != 0; }
__forceinline int all (const vboolf16& a) { return _mm512_kortestc(a,a) != 0; }
__forceinline int any (const vboolf16& a) { return _mm512_kortestz(a,a) == 0; }
__forceinline int none(const vboolf16& a) { return _mm512_kortestz(a,a) != 0; }
__forceinline int all ( const vboolf16& valid, const vboolf16& b ) { return all((!valid) | b); }
__forceinline int any ( const vboolf16& valid, const vboolf16& b ) { return any( valid & b); }
__forceinline int none( const vboolf16& valid, const vboolf16& b ) { return none(valid & b); }
__forceinline int all (const vboolf16& valid, const vboolf16& b) { return all((!valid) | b); }
__forceinline int any (const vboolf16& valid, const vboolf16& b) { return any(valid & b); }
__forceinline int none(const vboolf16& valid, const vboolf16& b) { return none(valid & b); }
__forceinline size_t movemask( const vboolf16& a ) { return _mm512_kmov(a); }
__forceinline size_t popcnt ( const vboolf16& a ) { return __popcnt(a.v); }
__forceinline size_t movemask(const vboolf16& a) { return _mm512_kmov(a); }
__forceinline size_t popcnt (const vboolf16& a) { return popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Convertion Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline unsigned int toInt (const vboolf16 &a) { return mm512_mask2int(a); }
__forceinline vboolf16 toMask(const int &a) { return mm512_int2mask(a); }
__forceinline unsigned int toInt (const vboolf16& a) { return mm512_mask2int(a); }
__forceinline vboolf16 toMask(const int& a) { return mm512_int2mask(a); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -152,7 +152,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboolf16& a)
inline std::ostream& operator <<(std::ostream& cout, const vboolf16& a)
{
cout << "<";
for (size_t i=0; i<16; i++) {
+37 -26
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,8 +33,8 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf() {}
__forceinline vboolf(const vboolf4 &t) { v = t.v; }
__forceinline vboolf4& operator=(const vboolf4 &f) { v = f.v; return *this; }
__forceinline vboolf(const vboolf4& t) { v = t.v; }
__forceinline vboolf4& operator =(const vboolf4& f) { v = f.v; return *this; }
__forceinline vboolf(const __mmask8 &t) { v = t; }
__forceinline operator __mmask8() const { return v; }
@@ -43,6 +43,9 @@ namespace embree
__forceinline vboolf(int t) { v = (__mmask8)t; }
__forceinline vboolf(unsigned int t) { v = (__mmask8)t; }
__forceinline vboolf(bool a, bool b, bool c, bool d)
: v((__mmask8)((int(d) << 3) | (int(c) << 2) | (int(b) << 1) | int(a))) {}
/* return int8 mask */
__forceinline __m128i mask8() const {
return _mm_movm_epi8(v);
@@ -62,42 +65,50 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf( FalseTy ) : v(0x0) {}
__forceinline vboolf( TrueTy ) : v(0xf) {}
__forceinline vboolf(FalseTy) : v(0x0) {}
__forceinline vboolf(TrueTy) : v(0xf) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator [](size_t index) const {
assert(index < 4); return (mm512_mask2int(v) >> index) & 1;
}
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf4 operator!(const vboolf4 &a) { return _mm512_kandn(a, 0xf); }
__forceinline vboolf4 operator !(const vboolf4& a) { return _mm512_kandn(a, 0xf); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf4 operator&(const vboolf4 &a, const vboolf4 &b) { return _mm512_kand(a, b); }
__forceinline vboolf4 operator|(const vboolf4 &a, const vboolf4 &b) { return _mm512_kor(a, b); }
__forceinline vboolf4 operator^(const vboolf4 &a, const vboolf4 &b) { return _mm512_kxor(a, b); }
__forceinline vboolf4 operator &(const vboolf4& a, const vboolf4& b) { return _mm512_kand(a, b); }
__forceinline vboolf4 operator |(const vboolf4& a, const vboolf4& b) { return _mm512_kor(a, b); }
__forceinline vboolf4 operator ^(const vboolf4& a, const vboolf4& b) { return _mm512_kxor(a, b); }
__forceinline vboolf4 andn(const vboolf4 &a, const vboolf4 &b) { return _mm512_kandn(b, a); }
__forceinline vboolf4 andn(const vboolf4& a, const vboolf4& b) { return _mm512_kandn(b, a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator &=( vboolf4& a, const vboolf4& b ) { return a = a & b; }
__forceinline const vboolf4 operator |=( vboolf4& a, const vboolf4& b ) { return a = a | b; }
__forceinline const vboolf4 operator ^=( vboolf4& a, const vboolf4& b ) { return a = a ^ b; }
__forceinline vboolf4& operator &=(vboolf4& a, const vboolf4& b) { return a = a & b; }
__forceinline vboolf4& operator |=(vboolf4& a, const vboolf4& b) { return a = a | b; }
__forceinline vboolf4& operator ^=(vboolf4& a, const vboolf4& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator !=( const vboolf4& a, const vboolf4& b ) { return _mm512_kxor(a, b); }
__forceinline const vboolf4 operator ==( const vboolf4& a, const vboolf4& b ) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
__forceinline vboolf4 operator !=(const vboolf4& a, const vboolf4& b) { return _mm512_kxor(a, b); }
__forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm512_kand(_mm512_kxnor(a, b), 0xf); }
__forceinline vboolf4 select (const vboolf4 &s, const vboolf4 &a, const vboolf4 &b) {
__forceinline vboolf4 select(const vboolf4& s, const vboolf4& a, const vboolf4& b) {
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
}
@@ -105,22 +116,22 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline int all (const vboolf4 &a) { return a.v == 0xf; }
__forceinline int any (const vboolf4 &a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboolf4 &a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all (const vboolf4& a) { return a.v == 0xf; }
__forceinline int any (const vboolf4& a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboolf4& a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all ( const vboolf4& valid, const vboolf4& b ) { return all((!valid) | b); }
__forceinline int any ( const vboolf4& valid, const vboolf4& b ) { return any( valid & b); }
__forceinline int none( const vboolf4& valid, const vboolf4& b ) { return none(valid & b); }
__forceinline int all (const vboolf4& valid, const vboolf4& b) { return all((!valid) | b); }
__forceinline int any (const vboolf4& valid, const vboolf4& b) { return any(valid & b); }
__forceinline int none(const vboolf4& valid, const vboolf4& b) { return none(valid & b); }
__forceinline size_t movemask( const vboolf4& a ) { return _mm512_kmov(a); }
__forceinline size_t popcnt ( const vboolf4& a ) { return __popcnt(a.v); }
__forceinline size_t movemask(const vboolf4& a) { return _mm512_kmov(a); }
__forceinline size_t popcnt (const vboolf4& a) { return popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline unsigned int toInt(const vboolf4 &a) { return mm512_mask2int(a); }
__forceinline unsigned int toInt(const vboolf4& a) { return mm512_mask2int(a); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -134,7 +145,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboolf4& a)
inline std::ostream& operator <<(std::ostream& cout, const vboolf4& a)
{
cout << "<";
for (size_t i=0; i<4; i++) {
+60 -55
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,23 +33,23 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf ( ) {}
__forceinline vboolf ( const vboolf4& other ) { v = other.v; }
__forceinline vboolf4& operator=( const vboolf4& other ) { v = other.v; return *this; }
__forceinline vboolf() {}
__forceinline vboolf(const vboolf4& other) { v = other.v; }
__forceinline vboolf4& operator =(const vboolf4& other) { v = other.v; return *this; }
__forceinline vboolf( const __m128 input ) : v(input) {}
__forceinline operator const __m128&( void ) const { return v; }
__forceinline operator const __m128i( void ) const { return _mm_castps_si128(v); }
__forceinline operator const __m128d( void ) const { return _mm_castps_pd(v); }
__forceinline vboolf(__m128 input) : v(input) {}
__forceinline operator const __m128&() const { return v; }
__forceinline operator const __m128i() const { return _mm_castps_si128(v); }
__forceinline operator const __m128d() const { return _mm_castps_pd(v); }
__forceinline vboolf( bool a )
: v(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
__forceinline vboolf( bool a, bool b )
: v(_mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {}
__forceinline vboolf( bool a, bool b, bool c, bool d )
: v(_mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
__forceinline vboolf( int mask ) { assert(mask >= 0 && mask < 16); v = _mm_lookupmask_ps[mask]; }
__forceinline vboolf( unsigned mask ) { assert(mask >= 0 && mask < 16); v = _mm_lookupmask_ps[mask]; }
__forceinline vboolf(bool a)
: v(mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) {}
__forceinline vboolf(bool a, bool b)
: v(mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) {}
__forceinline vboolf(bool a, bool b, bool c, bool d)
: v(mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) {}
__forceinline vboolf(int mask) { assert(mask >= 0 && mask < 16); v = mm_lookupmask_ps[mask]; }
__forceinline vboolf(unsigned int mask) { assert(mask < 16); v = mm_lookupmask_ps[mask]; }
/* return int32 mask */
__forceinline __m128i mask32() const {
@@ -60,47 +60,49 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf( FalseTy ) : v(_mm_setzero_ps()) {}
__forceinline vboolf( TrueTy ) : v(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) {}
__forceinline vboolf(FalseTy) : v(_mm_setzero_ps()) {}
__forceinline vboolf(TrueTy) : v(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator []( const size_t index ) const { assert(index < 4); return (_mm_movemask_ps(v) >> index) & 1; }
__forceinline int& operator []( const size_t index ) { assert(index < 4); return i[index]; }
__forceinline bool operator [](size_t index) const { assert(index < 4); return (_mm_movemask_ps(v) >> index) & 1; }
__forceinline int& operator [](size_t index) { assert(index < 4); return i[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator !( const vboolf4& a ) { return _mm_xor_ps(a, vboolf4(embree::True)); }
__forceinline vboolf4 operator !(const vboolf4& a) { return _mm_xor_ps(a, vboolf4(embree::True)); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator &( const vboolf4& a, const vboolf4& b ) { return _mm_and_ps(a, b); }
__forceinline const vboolf4 operator |( const vboolf4& a, const vboolf4& b ) { return _mm_or_ps (a, b); }
__forceinline const vboolf4 operator ^( const vboolf4& a, const vboolf4& b ) { return _mm_xor_ps(a, b); }
__forceinline vboolf4 operator &(const vboolf4& a, const vboolf4& b) { return _mm_and_ps(a, b); }
__forceinline vboolf4 operator |(const vboolf4& a, const vboolf4& b) { return _mm_or_ps (a, b); }
__forceinline vboolf4 operator ^(const vboolf4& a, const vboolf4& b) { return _mm_xor_ps(a, b); }
__forceinline vboolf4 andn(const vboolf4& a, const vboolf4& b) { return _mm_andnot_ps(b, a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator &=( vboolf4& a, const vboolf4& b ) { return a = a & b; }
__forceinline const vboolf4 operator |=( vboolf4& a, const vboolf4& b ) { return a = a | b; }
__forceinline const vboolf4 operator ^=( vboolf4& a, const vboolf4& b ) { return a = a ^ b; }
__forceinline vboolf4& operator &=(vboolf4& a, const vboolf4& b) { return a = a & b; }
__forceinline vboolf4& operator |=(vboolf4& a, const vboolf4& b) { return a = a | b; }
__forceinline vboolf4& operator ^=(vboolf4& a, const vboolf4& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 operator !=( const vboolf4& a, const vboolf4& b ) { return _mm_xor_ps(a, b); }
__forceinline const vboolf4 operator ==( const vboolf4& a, const vboolf4& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
__forceinline vboolf4 operator !=(const vboolf4& a, const vboolf4& b) { return _mm_xor_ps(a, b); }
__forceinline vboolf4 operator ==(const vboolf4& a, const vboolf4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
__forceinline const vboolf4 select( const vboolf4& m, const vboolf4& t, const vboolf4& f ) {
__forceinline vboolf4 select(const vboolf4& m, const vboolf4& t, const vboolf4& f) {
#if defined(__SSE4_1__)
return _mm_blendv_ps(f, t, m);
#else
@@ -112,53 +114,56 @@ namespace embree
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf4 unpacklo( const vboolf4& a, const vboolf4& b ) { return _mm_unpacklo_ps(a, b); }
__forceinline const vboolf4 unpackhi( const vboolf4& a, const vboolf4& b ) { return _mm_unpackhi_ps(a, b); }
__forceinline vboolf4 unpacklo(const vboolf4& a, const vboolf4& b) { return _mm_unpacklo_ps(a, b); }
__forceinline vboolf4 unpackhi(const vboolf4& a, const vboolf4& b) { return _mm_unpackhi_ps(a, b); }
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf4 shuffle( const vboolf4& a ) {
return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
template<int i0, int i1, int i2, int i3>
__forceinline vboolf4 shuffle(const vboolf4& v) {
return _mm_castsi128_ps(_mm_shuffle_epi32(v, _MM_SHUFFLE(i3, i2, i1, i0)));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf4 shuffle( const vboolf4& a, const vboolf4& b ) {
template<int i0, int i1, int i2, int i3>
__forceinline vboolf4 shuffle(const vboolf4& a, const vboolf4& b) {
return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<size_t i0> __forceinline const vboolf4 shuffle( const vboolf4& b ) {
return shuffle<i0,i0,i0,i0>(b);
template<int i0>
__forceinline vboolf4 shuffle(const vboolf4& v) {
return shuffle<i0,i0,i0,i0>(v);
}
#if defined(__SSE3__)
template<> __forceinline const vboolf4 shuffle<0, 0, 2, 2>( const vboolf4& a ) { return _mm_moveldup_ps(a); }
template<> __forceinline const vboolf4 shuffle<1, 1, 3, 3>( const vboolf4& a ) { return _mm_movehdup_ps(a); }
template<> __forceinline const vboolf4 shuffle<0, 1, 0, 1>( const vboolf4& a ) { return _mm_castpd_ps(_mm_movedup_pd (a)); }
template<> __forceinline vboolf4 shuffle<0, 0, 2, 2>(const vboolf4& v) { return _mm_moveldup_ps(v); }
template<> __forceinline vboolf4 shuffle<1, 1, 3, 3>(const vboolf4& v) { return _mm_movehdup_ps(v); }
template<> __forceinline vboolf4 shuffle<0, 1, 0, 1>(const vboolf4& v) { return _mm_castpd_ps(_mm_movedup_pd(v)); }
#endif
#if defined(__SSE4_1__)
template<size_t dst, size_t src, size_t clr> __forceinline const vboolf4 insert( const vboolf4& a, const vboolf4& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
template<size_t dst, size_t src> __forceinline const vboolf4 insert( const vboolf4& a, const vboolf4& b ) { return insert<dst, src, 0>(a, b); }
template<size_t dst> __forceinline const vboolf4 insert( const vboolf4& a, const bool b ) { return insert<dst,0>(a, vboolf4(b)); }
template<int dst, int src, int clr> __forceinline vboolf4 insert(const vboolf4& a, const vboolf4& b) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
template<int dst, int src> __forceinline vboolf4 insert(const vboolf4& a, const vboolf4& b) { return insert<dst, src, 0>(a, b); }
template<int dst> __forceinline vboolf4 insert(const vboolf4& a, const bool b) { return insert<dst, 0>(a, vboolf4(b)); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline bool reduce_and( const vboolf4& a ) { return _mm_movemask_ps(a) == 0xf; }
__forceinline bool reduce_or ( const vboolf4& a ) { return _mm_movemask_ps(a) != 0x0; }
__forceinline bool reduce_and(const vboolf4& a) { return _mm_movemask_ps(a) == 0xf; }
__forceinline bool reduce_or (const vboolf4& a) { return _mm_movemask_ps(a) != 0x0; }
__forceinline bool all ( const vboolf4& b ) { return _mm_movemask_ps(b) == 0xf; }
__forceinline bool any ( const vboolf4& b ) { return _mm_movemask_ps(b) != 0x0; }
__forceinline bool none ( const vboolf4& b ) { return _mm_movemask_ps(b) == 0x0; }
__forceinline bool all (const vboolf4& b) { return _mm_movemask_ps(b) == 0xf; }
__forceinline bool any (const vboolf4& b) { return _mm_movemask_ps(b) != 0x0; }
__forceinline bool none(const vboolf4& b) { return _mm_movemask_ps(b) == 0x0; }
__forceinline bool all ( const vboolf4& valid, const vboolf4& b ) { return all((!valid) | b); }
__forceinline bool any ( const vboolf4& valid, const vboolf4& b ) { return any( valid & b); }
__forceinline bool none ( const vboolf4& valid, const vboolf4& b ) { return none(valid & b); }
__forceinline bool all (const vboolf4& valid, const vboolf4& b) { return all((!valid) | b); }
__forceinline bool any (const vboolf4& valid, const vboolf4& b) { return any(valid & b); }
__forceinline bool none(const vboolf4& valid, const vboolf4& b) { return none(valid & b); }
__forceinline size_t movemask( const vboolf4& a ) { return _mm_movemask_ps(a); }
__forceinline size_t movemask(const vboolf4& a) { return _mm_movemask_ps(a); }
#if defined(__SSE4_2__)
__forceinline size_t popcnt( const vboolf4& a ) { return __popcnt((size_t)_mm_movemask_ps(a)); }
__forceinline size_t popcnt(const vboolf4& a) { return popcnt((size_t)_mm_movemask_ps(a)); }
#else
__forceinline size_t popcnt( const vboolf4& a ) { return bool(a[0])+bool(a[1])+bool(a[2])+bool(a[3]); }
__forceinline size_t popcnt(const vboolf4& a) { return bool(a[0])+bool(a[1])+bool(a[2])+bool(a[3]); }
#endif
////////////////////////////////////////////////////////////////////////////////
@@ -173,7 +178,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboolf4& a) {
inline std::ostream& operator <<(std::ostream& cout, const vboolf4& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
}
}
+66 -59
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -37,16 +37,16 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf () {}
__forceinline vboolf ( const vboolf8& a ) { v = a.v; }
__forceinline vboolf8& operator=( const vboolf8& a ) { v = a.v; return *this; }
__forceinline vboolf() {}
__forceinline vboolf(const vboolf8& a) { v = a.v; }
__forceinline vboolf8& operator =(const vboolf8& a) { v = a.v; return *this; }
__forceinline vboolf( const __m256 a ) : v(a) {}
__forceinline operator const __m256&( void ) const { return v; }
__forceinline operator const __m256i( void ) const { return _mm256_castps_si256(v); }
__forceinline operator const __m256d( void ) const { return _mm256_castps_pd(v); }
__forceinline vboolf(__m256 a) : v(a) {}
__forceinline operator const __m256&() const { return v; }
__forceinline operator const __m256i() const { return _mm256_castps_si256(v); }
__forceinline operator const __m256d() const { return _mm256_castps_pd(v); }
__forceinline vboolf ( const int a )
__forceinline vboolf(int a)
{
assert(a >= 0 && a <= 255);
#if defined (__AVX2__)
@@ -55,19 +55,19 @@ namespace embree
const __m256i c = _mm256_and_si256(b,mask);
v = _mm256_castsi256_ps(_mm256_cmpeq_epi32(c,mask));
#else
vl = _mm_lookupmask_ps[a & 0xF];
vh = _mm_lookupmask_ps[a >> 4];
vl = mm_lookupmask_ps[a & 0xF];
vh = mm_lookupmask_ps[a >> 4];
#endif
}
__forceinline vboolf ( const vboolf4& a ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
__forceinline vboolf ( const vboolf4& a, const vboolf4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
__forceinline vboolf ( const __m128 a, const __m128 b) : vl(a), vh(b) {}
__forceinline vboolf(const vboolf4& a) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
__forceinline vboolf(const vboolf4& a, const vboolf4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
__forceinline vboolf(__m128 a, __m128 b) : vl(a), vh(b) {}
__forceinline vboolf ( bool a ) : v(vboolf8(vboolf4(a), vboolf4(a))) {}
__forceinline vboolf ( bool a, bool b) : v(vboolf8(vboolf4(a), vboolf4(b))) {}
__forceinline vboolf ( bool a, bool b, bool c, bool d) : v(vboolf8(vboolf4(a,b), vboolf4(c,d))) {}
__forceinline vboolf ( bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool vh ) : v(vboolf8(vboolf4(a,b,c,d), vboolf4(e,f,g,vh))) {}
__forceinline vboolf(bool a) : v(vboolf8(vboolf4(a), vboolf4(a))) {}
__forceinline vboolf(bool a, bool b) : v(vboolf8(vboolf4(a), vboolf4(b))) {}
__forceinline vboolf(bool a, bool b, bool c, bool d) : v(vboolf8(vboolf4(a,b), vboolf4(c,d))) {}
__forceinline vboolf(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h) : v(vboolf8(vboolf4(a,b,c,d), vboolf4(e,f,g,h))) {}
/* return int32 mask */
__forceinline __m256i mask32() const {
@@ -78,43 +78,45 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf( FalseTy ) : v(_mm256_setzero_ps()) {}
__forceinline vboolf( TrueTy ) : v(_mm256_cmp_ps(_mm256_setzero_ps(), _mm256_setzero_ps(), _CMP_EQ_OQ)) {}
__forceinline vboolf(FalseTy) : v(_mm256_setzero_ps()) {}
__forceinline vboolf(TrueTy) : v(_mm256_cmp_ps(_mm256_setzero_ps(), _mm256_setzero_ps(), _CMP_EQ_OQ)) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator []( const size_t index ) const { assert(index < 8); return (_mm256_movemask_ps(v) >> index) & 1; }
__forceinline int& operator []( const size_t index ) { assert(index < 8); return i[index]; }
__forceinline bool operator [](size_t index) const { assert(index < 8); return (_mm256_movemask_ps(v) >> index) & 1; }
__forceinline int& operator [](size_t index) { assert(index < 8); return i[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf8 operator !( const vboolf8& a ) { return _mm256_xor_ps(a, vboolf8(embree::True)); }
__forceinline vboolf8 operator !(const vboolf8& a) { return _mm256_xor_ps(a, vboolf8(embree::True)); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf8 operator &( const vboolf8& a, const vboolf8& b ) { return _mm256_and_ps(a, b); }
__forceinline const vboolf8 operator |( const vboolf8& a, const vboolf8& b ) { return _mm256_or_ps (a, b); }
__forceinline const vboolf8 operator ^( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(a, b); }
__forceinline vboolf8 operator &(const vboolf8& a, const vboolf8& b) { return _mm256_and_ps(a, b); }
__forceinline vboolf8 operator |(const vboolf8& a, const vboolf8& b) { return _mm256_or_ps (a, b); }
__forceinline vboolf8 operator ^(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(a, b); }
__forceinline vboolf8 operator &=( vboolf8& a, const vboolf8& b ) { return a = a & b; }
__forceinline vboolf8 operator |=( vboolf8& a, const vboolf8& b ) { return a = a | b; }
__forceinline vboolf8 operator ^=( vboolf8& a, const vboolf8& b ) { return a = a ^ b; }
__forceinline vboolf8 andn(const vboolf8& a, const vboolf8& b) { return _mm256_andnot_ps(b, a); }
__forceinline vboolf8& operator &=(vboolf8& a, const vboolf8& b) { return a = a & b; }
__forceinline vboolf8& operator |=(vboolf8& a, const vboolf8& b) { return a = a | b; }
__forceinline vboolf8& operator ^=(vboolf8& a, const vboolf8& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf8 operator !=( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(a, b); }
__forceinline const vboolf8 operator ==( const vboolf8& a, const vboolf8& b ) { return _mm256_xor_ps(_mm256_xor_ps(a,b),vboolf8(embree::True)); }
__forceinline vboolf8 operator !=(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(a, b); }
__forceinline vboolf8 operator ==(const vboolf8& a, const vboolf8& b) { return _mm256_xor_ps(_mm256_xor_ps(a,b),vboolf8(embree::True)); }
__forceinline const vboolf8 select( const vboolf8& mask, const vboolf8& t, const vboolf8& f ) {
__forceinline vboolf8 select(const vboolf8& mask, const vboolf8& t, const vboolf8& f) {
return _mm256_blendv_ps(f, t, mask);
}
@@ -122,54 +124,59 @@ namespace embree
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf8 unpacklo( const vboolf8& a, const vboolf8& b ) { return _mm256_unpacklo_ps(a.v, b.v); }
__forceinline vboolf8 unpackhi( const vboolf8& a, const vboolf8& b ) { return _mm256_unpackhi_ps(a.v, b.v); }
__forceinline vboolf8 unpacklo(const vboolf8& a, const vboolf8& b) { return _mm256_unpacklo_ps(a, b); }
__forceinline vboolf8 unpackhi(const vboolf8& a, const vboolf8& b) { return _mm256_unpackhi_ps(a, b); }
template<size_t i> __forceinline const vboolf8 shuffle( const vboolf8& a ) {
return _mm256_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
template<int i>
__forceinline vboolf8 shuffle(const vboolf8& v) {
return _mm256_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
}
template<size_t i0, size_t i1> __forceinline const vboolf8 shuffle4( const vboolf8& a ) {
return _mm256_permute2f128_ps(a, a, (i1 << 4) | (i0 << 0));
template<int i0, int i1>
__forceinline vboolf8 shuffle4(const vboolf8& v) {
return _mm256_permute2f128_ps(v, v, (i1 << 4) | (i0 << 0));
}
template<size_t i0, size_t i1> __forceinline const vboolf8 shuffle4( const vboolf8& a, const vboolf8& b) {
template<int i0, int i1>
__forceinline vboolf8 shuffle4(const vboolf8& a, const vboolf8& b) {
return _mm256_permute2f128_ps(a, b, (i1 << 4) | (i0 << 0));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf8 shuffle( const vboolf8& a ) {
return _mm256_permute_ps(a, _MM_SHUFFLE(i3, i2, i1, i0));
template<int i0, int i1, int i2, int i3>
__forceinline vboolf8 shuffle(const vboolf8& v) {
return _mm256_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vboolf8 shuffle( const vboolf8& a, const vboolf8& b ) {
template<int i0, int i1, int i2, int i3>
__forceinline vboolf8 shuffle(const vboolf8& a, const vboolf8& b) {
return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<> __forceinline const vboolf8 shuffle<0, 0, 2, 2>( const vboolf8& b ) { return _mm256_moveldup_ps(b); }
template<> __forceinline const vboolf8 shuffle<1, 1, 3, 3>( const vboolf8& b ) { return _mm256_movehdup_ps(b); }
template<> __forceinline const vboolf8 shuffle<0, 1, 0, 1>( const vboolf8& b ) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(b))); }
template<> __forceinline vboolf8 shuffle<0, 0, 2, 2>(const vboolf8& v) { return _mm256_moveldup_ps(v); }
template<> __forceinline vboolf8 shuffle<1, 1, 3, 3>(const vboolf8& v) { return _mm256_movehdup_ps(v); }
template<> __forceinline vboolf8 shuffle<0, 1, 0, 1>(const vboolf8& v) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(v))); }
template<size_t i> __forceinline const vboolf8 insert4(const vboolf8& a, const vboolf4& b) { return _mm256_insertf128_ps(a, b, i); }
template<size_t i> __forceinline const vboolf4 extract4 (const vboolf8& a) { return _mm256_extractf128_ps(a, i); }
template<> __forceinline const vboolf4 extract4<0>(const vboolf8& a) { return _mm256_castps256_ps128(a); }
template<int i> __forceinline vboolf8 insert4(const vboolf8& a, const vboolf4& b) { return _mm256_insertf128_ps(a, b, i); }
template<int i> __forceinline vboolf4 extract4 (const vboolf8& a) { return _mm256_extractf128_ps(a, i); }
template<> __forceinline vboolf4 extract4<0>(const vboolf8& a) { return _mm256_castps256_ps128(a); }
////////////////////////////////////////////////////////////////////////////////
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline bool reduce_and( const vboolf8& a ) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
__forceinline bool reduce_or ( const vboolf8& a ) { return !_mm256_testz_ps(a,a); }
__forceinline bool reduce_and(const vboolf8& a) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
__forceinline bool reduce_or (const vboolf8& a) { return !_mm256_testz_ps(a,a); }
__forceinline bool all ( const vboolf8& a ) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
__forceinline bool any ( const vboolf8& a ) { return !_mm256_testz_ps(a,a); }
__forceinline bool none ( const vboolf8& a ) { return _mm256_testz_ps(a,a) != 0; }
__forceinline bool all (const vboolf8& a) { return _mm256_movemask_ps(a) == (unsigned int)0xff; }
__forceinline bool any (const vboolf8& a) { return !_mm256_testz_ps(a,a); }
__forceinline bool none(const vboolf8& a) { return _mm256_testz_ps(a,a) != 0; }
__forceinline bool all ( const vboolf8& valid, const vboolf8& b ) { return all((!valid) | b); }
__forceinline bool any ( const vboolf8& valid, const vboolf8& b ) { return any( valid & b); }
__forceinline bool none ( const vboolf8& valid, const vboolf8& b ) { return none(valid & b); }
__forceinline bool all (const vboolf8& valid, const vboolf8& b) { return all((!valid) | b); }
__forceinline bool any (const vboolf8& valid, const vboolf8& b) { return any(valid & b); }
__forceinline bool none(const vboolf8& valid, const vboolf8& b) { return none(valid & b); }
__forceinline unsigned int movemask( const vboolf8& a ) { return _mm256_movemask_ps(a); }
__forceinline size_t popcnt ( const vboolf8& a ) { return __popcnt((size_t)_mm256_movemask_ps(a)); }
__forceinline unsigned int movemask(const vboolf8& a) { return _mm256_movemask_ps(a); }
__forceinline size_t popcnt (const vboolf8& a) { return popcnt((size_t)_mm256_movemask_ps(a)); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -183,7 +190,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboolf8& a) {
inline std::ostream& operator <<(std::ostream& cout, const vboolf8& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", "
<< a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
}
+37 -26
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,8 +33,8 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf() {}
__forceinline vboolf(const vboolf8 &t) { v = t.v; }
__forceinline vboolf8& operator=(const vboolf8 &f) { v = f.v; return *this; }
__forceinline vboolf(const vboolf8& t) { v = t.v; }
__forceinline vboolf8& operator =(const vboolf8& f) { v = f.v; return *this; }
__forceinline vboolf(const __mmask8 &t) { v = t; }
__forceinline operator __mmask8() const { return v; }
@@ -43,6 +43,9 @@ namespace embree
__forceinline vboolf(int t) { v = (__mmask8)t; }
__forceinline vboolf(unsigned int t) { v = (__mmask8)t; }
__forceinline vboolf(bool a, bool b, bool c, bool d, bool e, bool f, bool g, bool h)
: v((__mmask8)((int(h) << 7) | (int(g) << 6) | (int(f) << 5) | (int(e) << 4) | (int(d) << 3) | (int(c) << 2) | (int(b) << 1) | int(a))) {}
/* return int8 mask */
__forceinline __m128i mask8() const {
return _mm_movm_epi8(v);
@@ -62,42 +65,50 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf( FalseTy ) : v(0x00) {}
__forceinline vboolf( TrueTy ) : v(0xff) {}
__forceinline vboolf(FalseTy) : v(0x00) {}
__forceinline vboolf(TrueTy) : v(0xff) {}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline bool operator [](size_t index) const {
assert(index < 8); return (mm512_mask2int(v) >> index) & 1;
}
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf8 operator!(const vboolf8 &a) { return _mm512_knot(a); }
__forceinline vboolf8 operator !(const vboolf8& a) { return _mm512_knot(a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf8 operator&(const vboolf8 &a, const vboolf8 &b) { return _mm512_kand(a, b); }
__forceinline vboolf8 operator|(const vboolf8 &a, const vboolf8 &b) { return _mm512_kor(a, b); }
__forceinline vboolf8 operator^(const vboolf8 &a, const vboolf8 &b) { return _mm512_kxor(a, b); }
__forceinline vboolf8 operator &(const vboolf8& a, const vboolf8& b) { return _mm512_kand(a, b); }
__forceinline vboolf8 operator |(const vboolf8& a, const vboolf8& b) { return _mm512_kor(a, b); }
__forceinline vboolf8 operator ^(const vboolf8& a, const vboolf8& b) { return _mm512_kxor(a, b); }
__forceinline vboolf8 andn(const vboolf8 &a, const vboolf8 &b) { return _mm512_kandn(b, a); }
__forceinline vboolf8 andn(const vboolf8& a, const vboolf8& b) { return _mm512_kandn(b, a); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf8 operator &=( vboolf8& a, const vboolf8& b ) { return a = a & b; }
__forceinline const vboolf8 operator |=( vboolf8& a, const vboolf8& b ) { return a = a | b; }
__forceinline const vboolf8 operator ^=( vboolf8& a, const vboolf8& b ) { return a = a ^ b; }
__forceinline vboolf8& operator &=(vboolf8& a, const vboolf8& b) { return a = a & b; }
__forceinline vboolf8& operator |=(vboolf8& a, const vboolf8& b) { return a = a | b; }
__forceinline vboolf8& operator ^=(vboolf8& a, const vboolf8& b) { return a = a ^ b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf8 operator !=( const vboolf8& a, const vboolf8& b ) { return _mm512_kxor(a, b); }
__forceinline const vboolf8 operator ==( const vboolf8& a, const vboolf8& b ) { return _mm512_kxnor(a, b); }
__forceinline vboolf8 operator !=(const vboolf8& a, const vboolf8& b) { return _mm512_kxor(a, b); }
__forceinline vboolf8 operator ==(const vboolf8& a, const vboolf8& b) { return _mm512_kxnor(a, b); }
__forceinline vboolf8 select(const vboolf8 &s, const vboolf8 &a, const vboolf8 &b) {
__forceinline vboolf8 select(const vboolf8& s, const vboolf8& a, const vboolf8& b) {
return _mm512_kor(_mm512_kand(s, a), _mm512_kandn(s, b));
}
@@ -105,22 +116,22 @@ namespace embree
/// Reduction Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline int all (const vboolf8 &a) { return a.v == 0xff; }
__forceinline int any (const vboolf8 &a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboolf8 &a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all (const vboolf8& a) { return a.v == 0xff; }
__forceinline int any (const vboolf8& a) { return _mm512_kortestz(a, a) == 0; }
__forceinline int none(const vboolf8& a) { return _mm512_kortestz(a, a) != 0; }
__forceinline int all ( const vboolf8& valid, const vboolf8& b ) { return all((!valid) | b); }
__forceinline int any ( const vboolf8& valid, const vboolf8& b ) { return any( valid & b); }
__forceinline int none( const vboolf8& valid, const vboolf8& b ) { return none(valid & b); }
__forceinline int all (const vboolf8& valid, const vboolf8& b) { return all((!valid) | b); }
__forceinline int any (const vboolf8& valid, const vboolf8& b) { return any(valid & b); }
__forceinline int none(const vboolf8& valid, const vboolf8& b) { return none(valid & b); }
__forceinline size_t movemask( const vboolf8& a ) { return _mm512_kmov(a); }
__forceinline size_t popcnt ( const vboolf8& a ) { return __popcnt(a.v); }
__forceinline size_t movemask(const vboolf8& a) { return _mm512_kmov(a); }
__forceinline size_t popcnt (const vboolf8& a) { return popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
////////////////////////////////////////////////////////////////////////////////
__forceinline unsigned int toInt(const vboolf8 &a) { return mm512_mask2int(a); }
__forceinline unsigned int toInt(const vboolf8& a) { return mm512_mask2int(a); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
@@ -134,7 +145,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vboolf8& a)
inline std::ostream& operator <<(std::ostream& cout, const vboolf8& a)
{
cout << "<";
for (size_t i=0; i<8; i++) {
+127 -113
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -18,19 +18,9 @@
namespace embree
{
#ifndef _MM_SHUF_PERM2
#define _MM_SHUF_PERM2(e3, e2, e1, e0) \
((int)(((e3)<<3) | ((e2)<<2) | ((e1)<<1) | (e0)))
#endif
#ifndef _MM_SHUF_PERM3
#define _MM_SHUF_PERM3(e1, e0) \
((int)(((e1)<<4) | (e0)))
#endif
/* 4-wide AVX 64bit double type */
/* 4-wide AVX 64-bit double type */
template<>
struct vdouble<4>
struct vdouble<4>
{
typedef vboold4 Bool;
@@ -46,16 +36,16 @@ namespace embree
__forceinline vdouble() {}
__forceinline vdouble(const vdouble4& t) { v = t.v; }
__forceinline vdouble4& operator=(const vdouble4& f) { v = f.v; return *this; }
__forceinline vdouble4& operator =(const vdouble4& f) { v = f.v; return *this; }
__forceinline vdouble(const __m256d& t) { v = t; }
__forceinline operator __m256d () const { return v; }
__forceinline operator __m256d() const { return v; }
__forceinline vdouble(const double i) {
__forceinline vdouble(double i) {
v = _mm256_set1_pd(i);
}
__forceinline vdouble(const double a, const double b, const double c, const double d) {
__forceinline vdouble(double a, double b, double c, double d) {
v = _mm256_set_pd(d,c,b,a);
}
@@ -64,25 +54,20 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble( ZeroTy ) : v(_mm256_setzero_pd()) {}
__forceinline vdouble( OneTy ) : v(_mm256_set1_pd(1)) {}
__forceinline vdouble( StepTy ) : v(_mm256_set_pd(3.0,2.0,1.0,0.0)) {}
__forceinline vdouble( ReverseStepTy ) : v(_mm256_setr_pd(3.0,2.0,1.0,0.0)) {}
__forceinline static vdouble4 zero() { return _mm256_setzero_pd(); }
__forceinline static vdouble4 one () { return _mm256_set1_pd(1.0); }
__forceinline static vdouble4 neg_one () { return _mm256_set1_pd(-1.0); }
__forceinline vdouble(ZeroTy) : v(_mm256_setzero_pd()) {}
__forceinline vdouble(OneTy) : v(_mm256_set1_pd(1)) {}
__forceinline vdouble(StepTy) : v(_mm256_set_pd(3.0,2.0,1.0,0.0)) {}
__forceinline vdouble(ReverseStepTy) : v(_mm256_setr_pd(3.0,2.0,1.0,0.0)) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline void store_nt(double *__restrict__ ptr, const vdouble4& a) {
_mm256_stream_pd(ptr,a);
_mm256_stream_pd(ptr, a);
}
static __forceinline vdouble4 loadu(const double* addr)
{
static __forceinline vdouble4 loadu(const double* addr) {
return _mm256_loadu_pd(addr);
}
@@ -95,84 +80,105 @@ namespace embree
}
static __forceinline void store(double* ptr, const vdouble4& v) {
_mm256_store_pd(ptr,v);
_mm256_store_pd(ptr, v);
}
static __forceinline void storeu(double* ptr, const vdouble4& v ) {
_mm256_storeu_pd(ptr,v);
static __forceinline void storeu(double* ptr, const vdouble4& v) {
_mm256_storeu_pd(ptr, v);
}
static __forceinline vdouble4 broadcast(const void* a) { return _mm256_set1_pd(*(double*)a); }
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline double& operator[](const size_t index) { assert(index < 8); return i[index]; }
__forceinline const double& operator[](const size_t index) const { assert(index < 8); return i[index]; }
__forceinline double& operator [](size_t index) { assert(index < 4); return i[index]; }
__forceinline const double& operator [](size_t index) const { assert(index < 4); return i[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vdouble4 operator +( const vdouble4& a ) { return a; }
__forceinline const vdouble4 operator -( const vdouble4& a ) { return _mm256_sub_pd(_mm256_setzero_pd(), a); }
#if defined(__AVX2__)
__forceinline vdouble4 asDouble(const vllong4& a) { return _mm256_castsi256_pd(a); }
__forceinline vllong4 asLLong (const vdouble4& a) { return _mm256_castpd_si256(a); }
#endif
__forceinline vdouble4 operator +(const vdouble4& a) { return a; }
__forceinline vdouble4 operator -(const vdouble4& a) { return _mm256_sub_pd(_mm256_setzero_pd(), a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vdouble4 operator +( const vdouble4& a, const vdouble4& b ) { return _mm256_add_pd(a, b); }
__forceinline const vdouble4 operator +( const vdouble4& a, const double b ) { return a + vdouble4(b); }
__forceinline const vdouble4 operator +( const double a, const vdouble4& b ) { return vdouble4(a) + b; }
__forceinline vdouble4 operator +(const vdouble4& a, const vdouble4& b) { return _mm256_add_pd(a, b); }
__forceinline vdouble4 operator +(const vdouble4& a, double b) { return a + vdouble4(b); }
__forceinline vdouble4 operator +(double a, const vdouble4& b) { return vdouble4(a) + b; }
__forceinline const vdouble4 operator -( const vdouble4& a, const vdouble4& b ) { return _mm256_sub_pd(a, b); }
__forceinline const vdouble4 operator -( const vdouble4& a, const double b ) { return a - vdouble4(b); }
__forceinline const vdouble4 operator -( const double a, const vdouble4& b ) { return vdouble4(a) - b; }
__forceinline vdouble4 operator -(const vdouble4& a, const vdouble4& b) { return _mm256_sub_pd(a, b); }
__forceinline vdouble4 operator -(const vdouble4& a, double b) { return a - vdouble4(b); }
__forceinline vdouble4 operator -(double a, const vdouble4& b) { return vdouble4(a) - b; }
__forceinline const vdouble4 operator *( const vdouble4& a, const vdouble4& b ) { return _mm256_mul_pd(a, b); }
__forceinline const vdouble4 operator *( const vdouble4& a, const double b ) { return a * vdouble4(b); }
__forceinline const vdouble4 operator *( const double a, const vdouble4& b ) { return vdouble4(a) * b; }
__forceinline vdouble4 operator *(const vdouble4& a, const vdouble4& b) { return _mm256_mul_pd(a, b); }
__forceinline vdouble4 operator *(const vdouble4& a, double b) { return a * vdouble4(b); }
__forceinline vdouble4 operator *(double a, const vdouble4& b) { return vdouble4(a) * b; }
__forceinline const vdouble4 operator &( const vdouble4& a, const vdouble4& b ) { return _mm256_and_pd(a, b); }
__forceinline const vdouble4 operator &( const vdouble4& a, const double b ) { return a & vdouble4(b); }
__forceinline const vdouble4 operator &( const double a, const vdouble4& b ) { return vdouble4(a) & b; }
__forceinline vdouble4 operator &(const vdouble4& a, const vdouble4& b) { return _mm256_and_pd(a, b); }
__forceinline vdouble4 operator &(const vdouble4& a, double b) { return a & vdouble4(b); }
__forceinline vdouble4 operator &(double a, const vdouble4& b) { return vdouble4(a) & b; }
__forceinline const vdouble4 operator |( const vdouble4& a, const vdouble4& b ) { return _mm256_or_pd(a, b); }
__forceinline const vdouble4 operator |( const vdouble4& a, const double b ) { return a | vdouble4(b); }
__forceinline const vdouble4 operator |( const double a, const vdouble4& b ) { return vdouble4(a) | b; }
__forceinline vdouble4 operator |(const vdouble4& a, const vdouble4& b) { return _mm256_or_pd(a, b); }
__forceinline vdouble4 operator |(const vdouble4& a, double b) { return a | vdouble4(b); }
__forceinline vdouble4 operator |(double a, const vdouble4& b) { return vdouble4(a) | b; }
__forceinline const vdouble4 operator ^( const vdouble4& a, const vdouble4& b ) { return _mm256_xor_pd(a, b); }
__forceinline const vdouble4 operator ^( const vdouble4& a, const double b ) { return a ^ vdouble4(b); }
__forceinline const vdouble4 operator ^( const double a, const vdouble4& b ) { return vdouble4(a) ^ b; }
__forceinline vdouble4 operator ^(const vdouble4& a, const vdouble4& b) { return _mm256_xor_pd(a, b); }
__forceinline vdouble4 operator ^(const vdouble4& a, double b) { return a ^ vdouble4(b); }
__forceinline vdouble4 operator ^(double a, const vdouble4& b) { return vdouble4(a) ^ b; }
__forceinline const vdouble4 min( const vdouble4& a, const vdouble4& b ) { return _mm256_min_pd(a, b); }
__forceinline const vdouble4 min( const vdouble4& a, const double b ) { return min(a,vdouble4(b)); }
__forceinline const vdouble4 min( const double a, const vdouble4& b ) { return min(vdouble4(a),b); }
__forceinline vdouble4 min(const vdouble4& a, const vdouble4& b) { return _mm256_min_pd(a, b); }
__forceinline vdouble4 min(const vdouble4& a, double b) { return min(a,vdouble4(b)); }
__forceinline vdouble4 min(double a, const vdouble4& b) { return min(vdouble4(a),b); }
__forceinline const vdouble4 max( const vdouble4& a, const vdouble4& b ) { return _mm256_max_pd(a, b); }
__forceinline const vdouble4 max( const vdouble4& a, const double b ) { return max(a,vdouble4(b)); }
__forceinline const vdouble4 max( const double a, const vdouble4& b ) { return max(vdouble4(a),b); }
__forceinline vdouble4 max(const vdouble4& a, const vdouble4& b) { return _mm256_max_pd(a, b); }
__forceinline vdouble4 max(const vdouble4& a, double b) { return max(a,vdouble4(b)); }
__forceinline vdouble4 max(double a, const vdouble4& b) { return max(vdouble4(a),b); }
////////////////////////////////////////////////////////////////////////////////
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
#if defined(__FMA__)
__forceinline vdouble4 madd (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fmadd_pd(a,b,c); }
__forceinline vdouble4 msub (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fmsub_pd(a,b,c); }
__forceinline vdouble4 nmadd(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fnmadd_pd(a,b,c); }
__forceinline vdouble4 nmsub(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return _mm256_fnmsub_pd(a,b,c); }
#else
__forceinline vdouble4 madd (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return a*b+c; }
__forceinline vdouble4 msub (const vdouble4& a, const vdouble4& b, const vdouble4& c) { return a*b-c; }
__forceinline vdouble4 nmadd(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return -a*b+c;}
__forceinline vdouble4 nmsub(const vdouble4& a, const vdouble4& b, const vdouble4& c) { return -a*b-c; }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble4& operator +=( vdouble4& a, const vdouble4& b ) { return a = a + b; }
__forceinline vdouble4& operator +=( vdouble4& a, const double b ) { return a = a + b; }
__forceinline vdouble4& operator +=(vdouble4& a, const vdouble4& b) { return a = a + b; }
__forceinline vdouble4& operator +=(vdouble4& a, double b) { return a = a + b; }
__forceinline vdouble4& operator -=( vdouble4& a, const vdouble4& b ) { return a = a - b; }
__forceinline vdouble4& operator -=( vdouble4& a, const double b ) { return a = a - b; }
__forceinline vdouble4& operator -=(vdouble4& a, const vdouble4& b) { return a = a - b; }
__forceinline vdouble4& operator -=(vdouble4& a, double b) { return a = a - b; }
__forceinline vdouble4& operator *=( vdouble4& a, const vdouble4& b ) { return a = a * b; }
__forceinline vdouble4& operator *=( vdouble4& a, const double b ) { return a = a * b; }
__forceinline vdouble4& operator *=(vdouble4& a, const vdouble4& b) { return a = a * b; }
__forceinline vdouble4& operator *=(vdouble4& a, double b) { return a = a * b; }
__forceinline vdouble4& operator &=( vdouble4& a, const vdouble4& b ) { return a = a & b; }
__forceinline vdouble4& operator &=( vdouble4& a, const double b ) { return a = a & b; }
__forceinline vdouble4& operator &=(vdouble4& a, const vdouble4& b) { return a = a & b; }
__forceinline vdouble4& operator &=(vdouble4& a, double b) { return a = a & b; }
__forceinline vdouble4& operator |=( vdouble4& a, const vdouble4& b ) { return a = a | b; }
__forceinline vdouble4& operator |=( vdouble4& a, const double b ) { return a = a | b; }
__forceinline vdouble4& operator |=(vdouble4& a, const vdouble4& b) { return a = a | b; }
__forceinline vdouble4& operator |=(vdouble4& a, double b) { return a = a | b; }
////////////////////////////////////////////////////////////////////////////////
@@ -180,38 +186,38 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX512VL__)
__forceinline const vboold4 operator ==( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
__forceinline const vboold4 operator !=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
__forceinline const vboold4 operator < ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
__forceinline const vboold4 operator >=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
__forceinline const vboold4 operator > ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
__forceinline const vboold4 operator <=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
__forceinline vboold4 operator ==(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_EQ); }
__forceinline vboold4 operator !=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_NE); }
__forceinline vboold4 operator < (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_LT); }
__forceinline vboold4 operator >=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_GE); }
__forceinline vboold4 operator > (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_GT); }
__forceinline vboold4 operator <=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd_mask(a, b, _MM_CMPINT_LE); }
#else
__forceinline const vboold4 operator ==( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_EQ_UQ); }
__forceinline const vboold4 operator !=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_NEQ_UQ); }
__forceinline const vboold4 operator < ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_LT_OQ); }
__forceinline const vboold4 operator >=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_GE_OQ); }
__forceinline const vboold4 operator > ( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_GT_OQ); }
__forceinline const vboold4 operator <=( const vdouble4& a, const vdouble4& b ) { return _mm256_cmp_pd(a,b,_CMP_LE_OQ); }
__forceinline vboold4 operator ==(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_EQ_OQ); }
__forceinline vboold4 operator !=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NEQ_UQ); }
__forceinline vboold4 operator < (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_LT_OS); }
__forceinline vboold4 operator >=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NLT_US); }
__forceinline vboold4 operator > (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_NLE_US); }
__forceinline vboold4 operator <=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a, b, _CMP_LE_OS); }
#endif
__forceinline const vboold4 operator ==( const vdouble4& a, const double b ) { return a == vdouble4(b); }
__forceinline const vboold4 operator ==( const double a, const vdouble4& b ) { return vdouble4(a) == b; }
__forceinline vboold4 operator ==(const vdouble4& a, double b) { return a == vdouble4(b); }
__forceinline vboold4 operator ==(double a, const vdouble4& b) { return vdouble4(a) == b; }
__forceinline const vboold4 operator !=( const vdouble4& a, const double b ) { return a != vdouble4(b); }
__forceinline const vboold4 operator !=( const double a, const vdouble4& b ) { return vdouble4(a) != b; }
__forceinline vboold4 operator !=(const vdouble4& a, double b) { return a != vdouble4(b); }
__forceinline vboold4 operator !=(double a, const vdouble4& b) { return vdouble4(a) != b; }
__forceinline const vboold4 operator < ( const vdouble4& a, const double b ) { return a < vdouble4(b); }
__forceinline const vboold4 operator < ( const double a, const vdouble4& b ) { return vdouble4(a) < b; }
__forceinline vboold4 operator < (const vdouble4& a, double b) { return a < vdouble4(b); }
__forceinline vboold4 operator < (double a, const vdouble4& b) { return vdouble4(a) < b; }
__forceinline const vboold4 operator >=( const vdouble4& a, const double b ) { return a >= vdouble4(b); }
__forceinline const vboold4 operator >=( const double a, const vdouble4& b ) { return vdouble4(a) >= b; }
__forceinline vboold4 operator >=(const vdouble4& a, double b) { return a >= vdouble4(b); }
__forceinline vboold4 operator >=(double a, const vdouble4& b) { return vdouble4(a) >= b; }
__forceinline const vboold4 operator > ( const vdouble4& a, const double b ) { return a > vdouble4(b); }
__forceinline const vboold4 operator > ( const double a, const vdouble4& b ) { return vdouble4(a) > b; }
__forceinline vboold4 operator > (const vdouble4& a, double b) { return a > vdouble4(b); }
__forceinline vboold4 operator > (double a, const vdouble4& b) { return vdouble4(a) > b; }
__forceinline const vboold4 operator <=( const vdouble4& a, const double b ) { return a <= vdouble4(b); }
__forceinline const vboold4 operator <=( const double a, const vdouble4& b ) { return vdouble4(a) <= b; }
__forceinline vboold4 operator <=(const vdouble4& a, double b) { return a <= vdouble4(b); }
__forceinline vboold4 operator <=(double a, const vdouble4& b) { return vdouble4(a) <= b; }
__forceinline vboold4 eq(const vdouble4& a, const vdouble4& b) { return a == b; }
__forceinline vboold4 ne(const vdouble4& a, const vdouble4& b) { return a != b; }
@@ -236,7 +242,7 @@ namespace embree
__forceinline vboold4 le(const vboold4& mask, const vdouble4& a, const vdouble4& b) { return mask & (a <= b); }
#endif
__forceinline const vdouble4 select( const vboold4& m, const vdouble4& t, const vdouble4& f ) {
__forceinline vdouble4 select(const vboold4& m, const vdouble4& t, const vdouble4& f) {
#if defined(__AVX512VL__)
return _mm256_mask_blend_pd(m, f, t);
#else
@@ -260,35 +266,43 @@ namespace embree
// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
template<int B, int A> __forceinline vdouble4 shuffle (const vdouble4& v) { return _mm256_permute_pd(v,(int)_MM_SHUF_PERM2(B,A,B,A)); }
template<int A> __forceinline vdouble4 shuffle (const vdouble4& x) { return shuffle<A,A>(x); }
template<int i0, int i1>
__forceinline vdouble4 shuffle(const vdouble4& v) {
return _mm256_permute_pd(v, (i1 << 3) | (i0 << 2) | (i1 << 1) | i0);
}
template<int B, int A> __forceinline vdouble4 shuffle2 (const vdouble4& v) { return _mm256_permute2f128_pd(v,v,(int)_MM_SHUF_PERM3(B,A)); }
template<int i>
__forceinline vdouble4 shuffle(const vdouble4& v) {
return shuffle<i, i>(v);
}
__forceinline double toScalar(const vdouble4& a)
{
return _mm_cvtsd_f64(_mm256_castpd256_pd128(a));
template<int i0, int i1>
__forceinline vdouble4 shuffle2(const vdouble4& v) {
return _mm256_permute2f128_pd(v, v, (i1 << 4) | i0);
}
__forceinline double toScalar(const vdouble4& v) {
return _mm_cvtsd_f64(_mm256_castpd256_pd128(v));
}
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble4 vreduce_min2(const vdouble4& x) { return min(x,shuffle<0,1>(x)); }
__forceinline vdouble4 vreduce_min (const vdouble4& y) { const vdouble4 x = vreduce_min2(y); return min(x,shuffle2<0,1>(x)); }
__forceinline vdouble4 vreduce_min2(const vdouble4& x) { return min(x, shuffle<1,0>(x)); }
__forceinline vdouble4 vreduce_min (const vdouble4& y) { const vdouble4 x = vreduce_min2(y); return min(x, shuffle2<1,0>(x)); }
__forceinline vdouble4 vreduce_max2(const vdouble4& x) { return max(x,shuffle<0,1>(x)); }
__forceinline vdouble4 vreduce_max (const vdouble4& y) { const vdouble4 x = vreduce_max2(y); return max(x,shuffle2<0,1>(x)); }
__forceinline vdouble4 vreduce_max2(const vdouble4& x) { return max(x,shuffle<1,0>(x)); }
__forceinline vdouble4 vreduce_max (const vdouble4& y) { const vdouble4 x = vreduce_max2(y); return max(x, shuffle2<1,0>(x)); }
__forceinline vdouble4 vreduce_and2(const vdouble4& x) { return x & shuffle<0,1>(x); }
__forceinline vdouble4 vreduce_and (const vdouble4& y) { const vdouble4 x = vreduce_and2(y); return x & shuffle2<0,1>(x); }
__forceinline vdouble4 vreduce_and2(const vdouble4& x) { return x & shuffle<1,0>(x); }
__forceinline vdouble4 vreduce_and (const vdouble4& y) { const vdouble4 x = vreduce_and2(y); return x & shuffle2<1,0>(x); }
__forceinline vdouble4 vreduce_or2(const vdouble4& x) { return x | shuffle<0,1>(x); }
__forceinline vdouble4 vreduce_or (const vdouble4& y) { const vdouble4 x = vreduce_or2(y); return x | shuffle2<0,1>(x); }
__forceinline vdouble4 vreduce_or2(const vdouble4& x) { return x | shuffle<1,0>(x); }
__forceinline vdouble4 vreduce_or (const vdouble4& y) { const vdouble4 x = vreduce_or2(y); return x | shuffle2<1,0>(x); }
__forceinline vdouble4 vreduce_add2(const vdouble4& x) { return x + shuffle<0,1>(x); }
__forceinline vdouble4 vreduce_add (const vdouble4& y) { const vdouble4 x = vreduce_add2(y); return x + shuffle2<0,1>(x); }
__forceinline vdouble4 vreduce_add2(const vdouble4& x) { return x + shuffle<1,0>(x); }
__forceinline vdouble4 vreduce_add (const vdouble4& y) { const vdouble4 x = vreduce_add2(y); return x + shuffle2<1,0>(x); }
__forceinline double reduce_add(const vdouble4& a) { return toScalar(vreduce_add(a)); }
__forceinline double reduce_min(const vdouble4& a) { return toScalar(vreduce_min(a)); }
@@ -304,7 +318,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline std::ostream& operator<<(std::ostream& cout, const vdouble4& v)
__forceinline std::ostream& operator <<(std::ostream& cout, const vdouble4& v)
{
cout << "<" << v[0];
for (size_t i=1; i<4; i++) cout << ", " << v[i];
+140 -127
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -18,9 +18,9 @@
namespace embree
{
/* 8-wide AVX-512 64bit double type */
/* 8-wide AVX-512 64-bit double type */
template<>
struct vdouble<8>
struct vdouble<8>
{
typedef vboold8 Bool;
@@ -36,22 +36,22 @@ namespace embree
__forceinline vdouble() {}
__forceinline vdouble(const vdouble8& t) { v = t.v; }
__forceinline vdouble8& operator=(const vdouble8& f) { v = f.v; return *this; }
__forceinline vdouble8& operator =(const vdouble8& f) { v = f.v; return *this; }
__forceinline vdouble(const __m512d& t) { v = t; }
__forceinline operator __m512d () const { return v; }
__forceinline operator __m256d () const { return _mm512_castpd512_pd256(v); }
__forceinline operator __m512d() const { return v; }
__forceinline operator __m256d() const { return _mm512_castpd512_pd256(v); }
__forceinline vdouble(const double i) {
__forceinline vdouble(double i) {
v = _mm512_set1_pd(i);
}
__forceinline vdouble(const double a, const double b, const double c, const double d) {
__forceinline vdouble(double a, double b, double c, double d) {
v = _mm512_set4_pd(d,c,b,a);
}
__forceinline vdouble(const double a0 , const double a1 , const double a2 , const double a3,
const double a4 , const double a5 , const double a6 , const double a7)
__forceinline vdouble(double a0, double a1, double a2, double a3,
double a4, double a5, double a6, double a7)
{
v = _mm512_set_pd(a7,a6,a5,a4,a3,a2,a1,a0);
}
@@ -61,21 +61,17 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble( ZeroTy ) : v(_mm512_setzero_pd()) {}
__forceinline vdouble( OneTy ) : v(_mm512_set1_pd(1)) {}
__forceinline vdouble( StepTy ) : v(_mm512_set_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
__forceinline vdouble( ReverseStepTy ) : v(_mm512_setr_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
__forceinline static vdouble8 zero() { return _mm512_setzero_pd(); }
__forceinline static vdouble8 one () { return _mm512_set1_pd(1); }
__forceinline static vdouble8 neg_one () { return _mm512_set1_pd(-1); }
__forceinline vdouble(ZeroTy) : v(_mm512_setzero_pd()) {}
__forceinline vdouble(OneTy) : v(_mm512_set1_pd(1)) {}
__forceinline vdouble(StepTy) : v(_mm512_set_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
__forceinline vdouble(ReverseStepTy) : v(_mm512_setr_pd(7.0,6.0,5.0,4.0,3.0,2.0,1.0,0.0)) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline void store_nt(void *__restrict__ ptr, const vdouble8& a) {
_mm512_stream_pd((double*)ptr,a);
_mm512_stream_pd((double*)ptr, a);
}
static __forceinline vdouble8 loadu(const void* addr) {
@@ -91,45 +87,46 @@ namespace embree
}
static __forceinline void store(void* ptr, const vdouble8& v) {
_mm512_store_pd(ptr,v);
_mm512_store_pd(ptr, v);
}
static __forceinline void storeu(void* ptr, const vdouble8& v ) {
_mm512_storeu_pd(ptr,v);
static __forceinline void storeu(void* ptr, const vdouble8& v) {
_mm512_storeu_pd(ptr, v);
}
static __forceinline void storeu(const vboold8& mask, double* ptr, const vdouble8& f ) {
_mm512_mask_storeu_pd(ptr,mask,f);
static __forceinline void storeu(const vboold8& mask, double* ptr, const vdouble8& f) {
_mm512_mask_storeu_pd(ptr, mask, f);
}
static __forceinline void store(const vboold8& mask, void* addr, const vdouble8& v2) {
_mm512_mask_store_pd(addr,mask,v2);
_mm512_mask_store_pd(addr, mask, v2);
}
/* pass by value to avoid compiler generating inefficient code */
static __forceinline void storeu_compact(const vboold8 mask,void * addr, const vdouble8& reg) {
_mm512_mask_compressstoreu_pd(addr,mask,reg);
_mm512_mask_compressstoreu_pd(addr, mask, reg);
}
static __forceinline vdouble8 compact64bit(const vboold8& mask, vdouble8& v) {
return _mm512_mask_compress_pd(v,mask,v);
return _mm512_mask_compress_pd(v, mask, v);
}
static __forceinline vdouble8 compact(const vboold8& mask, vdouble8& v) {
return _mm512_mask_compress_pd(v,mask,v);
return _mm512_mask_compress_pd(v, mask, v);
}
static __forceinline vdouble8 compact(const vboold8& mask, const vdouble8& a, vdouble8& b) {
return _mm512_mask_compress_pd(a,mask,b);
return _mm512_mask_compress_pd(a, mask, b);
}
static __forceinline vdouble8 broadcast(const void* a) { return _mm512_set1_pd(*(double*)a); }
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline double& operator[](const size_t index) { assert(index < 8); return i[index]; }
__forceinline const double& operator[](const size_t index) const { assert(index < 8); return i[index]; }
__forceinline double& operator [](size_t index) { assert(index < 8); return i[index]; }
__forceinline const double& operator [](size_t index) const { assert(index < 8); return i[index]; }
};
@@ -137,112 +134,124 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vdouble8 asDouble ( const __m512& a ) { return _mm512_castps_pd(a); }
__forceinline const vdouble8 operator +( const vdouble8& a ) { return a; }
__forceinline const vdouble8 operator -( const vdouble8& a ) { return _mm512_sub_pd(_mm512_setzero_pd(), a); }
__forceinline vdouble8 asDouble(const vllong8& a) { return _mm512_castsi512_pd(a); }
__forceinline vllong8 asLLong (const vdouble8& a) { return _mm512_castpd_si512(a); }
__forceinline vdouble8 operator +(const vdouble8& a) { return a; }
__forceinline vdouble8 operator -(const vdouble8& a) { return _mm512_sub_pd(_mm512_setzero_pd(), a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vdouble8 operator +( const vdouble8& a, const vdouble8& b ) { return _mm512_add_pd(a, b); }
__forceinline const vdouble8 operator +( const vdouble8& a, const double b ) { return a + vdouble8(b); }
__forceinline const vdouble8 operator +( const double a, const vdouble8& b ) { return vdouble8(a) + b; }
__forceinline vdouble8 operator +(const vdouble8& a, const vdouble8& b) { return _mm512_add_pd(a, b); }
__forceinline vdouble8 operator +(const vdouble8& a, double b) { return a + vdouble8(b); }
__forceinline vdouble8 operator +(double a, const vdouble8& b) { return vdouble8(a) + b; }
__forceinline const vdouble8 operator -( const vdouble8& a, const vdouble8& b ) { return _mm512_sub_pd(a, b); }
__forceinline const vdouble8 operator -( const vdouble8& a, const double b ) { return a - vdouble8(b); }
__forceinline const vdouble8 operator -( const double a, const vdouble8& b ) { return vdouble8(a) - b; }
__forceinline vdouble8 operator -(const vdouble8& a, const vdouble8& b) { return _mm512_sub_pd(a, b); }
__forceinline vdouble8 operator -(const vdouble8& a, double b) { return a - vdouble8(b); }
__forceinline vdouble8 operator -(double a, const vdouble8& b) { return vdouble8(a) - b; }
__forceinline const vdouble8 operator *( const vdouble8& a, const vdouble8& b ) { return _mm512_mul_pd(a, b); }
__forceinline const vdouble8 operator *( const vdouble8& a, const double b ) { return a * vdouble8(b); }
__forceinline const vdouble8 operator *( const double a, const vdouble8& b ) { return vdouble8(a) * b; }
__forceinline vdouble8 operator *(const vdouble8& a, const vdouble8& b) { return _mm512_mul_pd(a, b); }
__forceinline vdouble8 operator *(const vdouble8& a, double b) { return a * vdouble8(b); }
__forceinline vdouble8 operator *(double a, const vdouble8& b) { return vdouble8(a) * b; }
__forceinline const vdouble8 operator &( const vdouble8& a, const vdouble8& b ) { return _mm512_and_pd(a, b); }
__forceinline const vdouble8 operator &( const vdouble8& a, const double b ) { return a & vdouble8(b); }
__forceinline const vdouble8 operator &( const double a, const vdouble8& b ) { return vdouble8(a) & b; }
__forceinline vdouble8 operator &(const vdouble8& a, const vdouble8& b) { return _mm512_and_pd(a, b); }
__forceinline vdouble8 operator &(const vdouble8& a, double b) { return a & vdouble8(b); }
__forceinline vdouble8 operator &(double a, const vdouble8& b) { return vdouble8(a) & b; }
__forceinline const vdouble8 operator |( const vdouble8& a, const vdouble8& b ) { return _mm512_or_pd(a, b); }
__forceinline const vdouble8 operator |( const vdouble8& a, const double b ) { return a | vdouble8(b); }
__forceinline const vdouble8 operator |( const double a, const vdouble8& b ) { return vdouble8(a) | b; }
__forceinline vdouble8 operator |(const vdouble8& a, const vdouble8& b) { return _mm512_or_pd(a, b); }
__forceinline vdouble8 operator |(const vdouble8& a, double b) { return a | vdouble8(b); }
__forceinline vdouble8 operator |(double a, const vdouble8& b) { return vdouble8(a) | b; }
__forceinline const vdouble8 operator ^( const vdouble8& a, const vdouble8& b ) { return _mm512_xor_pd(a, b); }
__forceinline const vdouble8 operator ^( const vdouble8& a, const double b ) { return a ^ vdouble8(b); }
__forceinline const vdouble8 operator ^( const double a, const vdouble8& b ) { return vdouble8(a) ^ b; }
__forceinline vdouble8 operator ^(const vdouble8& a, const vdouble8& b) { return _mm512_xor_pd(a, b); }
__forceinline vdouble8 operator ^(const vdouble8& a, double b) { return a ^ vdouble8(b); }
__forceinline vdouble8 operator ^(double a, const vdouble8& b) { return vdouble8(a) ^ b; }
__forceinline const vdouble8 operator <<( const vdouble8& a, const unsigned int n ) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), n)); }
__forceinline const vdouble8 operator >>( const vdouble8& a, const unsigned int n ) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), n)); }
__forceinline vdouble8 operator <<(const vdouble8& a, const unsigned int n) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), n)); }
__forceinline vdouble8 operator >>(const vdouble8& a, const unsigned int n) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), n)); }
__forceinline const vdouble8 operator <<( const vdouble8& a, const vllong8& n ) { return _mm512_castsi512_pd(_mm512_sllv_epi64(_mm512_castpd_si512(a), n)); }
__forceinline const vdouble8 operator >>( const vdouble8& a, const vllong8& n ) { return _mm512_castsi512_pd(_mm512_srav_epi64(_mm512_castpd_si512(a), n)); }
__forceinline vdouble8 operator <<(const vdouble8& a, const vllong8& n) { return _mm512_castsi512_pd(_mm512_sllv_epi64(_mm512_castpd_si512(a), n)); }
__forceinline vdouble8 operator >>(const vdouble8& a, const vllong8& n) { return _mm512_castsi512_pd(_mm512_srav_epi64(_mm512_castpd_si512(a), n)); }
__forceinline const vdouble8 sll ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), b)); }
__forceinline const vdouble8 sra ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), b)); }
__forceinline const vdouble8 srl ( const vdouble8& a, const unsigned int b ) { return _mm512_castsi512_pd(_mm512_srli_epi64(_mm512_castpd_si512(a), b)); }
__forceinline vdouble8 sll (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_slli_epi64(_mm512_castpd_si512(a), b)); }
__forceinline vdouble8 sra (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_srai_epi64(_mm512_castpd_si512(a), b)); }
__forceinline vdouble8 srl (const vdouble8& a, const unsigned int b) { return _mm512_castsi512_pd(_mm512_srli_epi64(_mm512_castpd_si512(a), b)); }
__forceinline const vdouble8 min( const vdouble8& a, const vdouble8& b ) { return _mm512_min_pd(a, b); }
__forceinline const vdouble8 min( const vdouble8& a, const double b ) { return min(a,vdouble8(b)); }
__forceinline const vdouble8 min( const double a, const vdouble8& b ) { return min(vdouble8(a),b); }
__forceinline vdouble8 min(const vdouble8& a, const vdouble8& b) { return _mm512_min_pd(a, b); }
__forceinline vdouble8 min(const vdouble8& a, double b) { return min(a,vdouble8(b)); }
__forceinline vdouble8 min(double a, const vdouble8& b) { return min(vdouble8(a),b); }
__forceinline const vdouble8 max( const vdouble8& a, const vdouble8& b ) { return _mm512_max_pd(a, b); }
__forceinline const vdouble8 max( const vdouble8& a, const double b ) { return max(a,vdouble8(b)); }
__forceinline const vdouble8 max( const double a, const vdouble8& b ) { return max(vdouble8(a),b); }
__forceinline vdouble8 max(const vdouble8& a, const vdouble8& b) { return _mm512_max_pd(a, b); }
__forceinline vdouble8 max(const vdouble8& a, double b) { return max(a,vdouble8(b)); }
__forceinline vdouble8 max(double a, const vdouble8& b) { return max(vdouble8(a),b); }
__forceinline const vdouble8 mask_add(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_add_pd(c,mask,a,b); }
__forceinline const vdouble8 mask_sub(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_sub_pd(c,mask,a,b); }
__forceinline vdouble8 mask_add(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_add_pd(c,mask,a,b); }
__forceinline vdouble8 mask_sub(const vboold8& mask, vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_sub_pd(c,mask,a,b); }
__forceinline vdouble8 mask_and(const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_and_pd(c,m,a,b); }
__forceinline vdouble8 mask_or (const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_or_pd(c,m,a,b); }
////////////////////////////////////////////////////////////////////////////////
/// Ternary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble8 madd (const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fmadd_pd(a,b,c); }
__forceinline vdouble8 msub (const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fmsub_pd(a,b,c); }
__forceinline vdouble8 nmadd(const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fnmadd_pd(a,b,c); }
__forceinline vdouble8 nmsub(const vdouble8& a, const vdouble8& b, const vdouble8& c) { return _mm512_fnmsub_pd(a,b,c); }
__forceinline const vdouble8 mask_and(const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_and_pd(c,m,a,b); }
__forceinline const vdouble8 mask_or (const vboold8& m,vdouble8& c, const vdouble8& a, const vdouble8& b) { return _mm512_mask_or_pd(c,m,a,b); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble8& operator +=( vdouble8& a, const vdouble8& b ) { return a = a + b; }
__forceinline vdouble8& operator +=( vdouble8& a, const double b ) { return a = a + b; }
__forceinline vdouble8& operator +=(vdouble8& a, const vdouble8& b) { return a = a + b; }
__forceinline vdouble8& operator +=(vdouble8& a, double b) { return a = a + b; }
__forceinline vdouble8& operator -=( vdouble8& a, const vdouble8& b ) { return a = a - b; }
__forceinline vdouble8& operator -=( vdouble8& a, const double b ) { return a = a - b; }
__forceinline vdouble8& operator -=(vdouble8& a, const vdouble8& b) { return a = a - b; }
__forceinline vdouble8& operator -=(vdouble8& a, double b) { return a = a - b; }
__forceinline vdouble8& operator *=( vdouble8& a, const vdouble8& b ) { return a = a * b; }
__forceinline vdouble8& operator *=( vdouble8& a, const double b ) { return a = a * b; }
__forceinline vdouble8& operator *=(vdouble8& a, const vdouble8& b) { return a = a * b; }
__forceinline vdouble8& operator *=(vdouble8& a, double b) { return a = a * b; }
__forceinline vdouble8& operator &=( vdouble8& a, const vdouble8& b ) { return a = a & b; }
__forceinline vdouble8& operator &=( vdouble8& a, const double b ) { return a = a & b; }
__forceinline vdouble8& operator &=(vdouble8& a, const vdouble8& b) { return a = a & b; }
__forceinline vdouble8& operator &=(vdouble8& a, double b) { return a = a & b; }
__forceinline vdouble8& operator |=( vdouble8& a, const vdouble8& b ) { return a = a | b; }
__forceinline vdouble8& operator |=( vdouble8& a, const double b ) { return a = a | b; }
__forceinline vdouble8& operator |=(vdouble8& a, const vdouble8& b) { return a = a | b; }
__forceinline vdouble8& operator |=(vdouble8& a, double b) { return a = a | b; }
__forceinline vdouble8& operator <<=( vdouble8& a, const double b ) { return a = a << b; }
__forceinline vdouble8& operator >>=( vdouble8& a, const double b ) { return a = a >> b; }
__forceinline vdouble8& operator <<=(vdouble8& a, const double b) { return a = a << b; }
__forceinline vdouble8& operator >>=(vdouble8& a, const double b) { return a = a >> b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboold8 operator ==( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
__forceinline const vboold8 operator ==( const vdouble8& a, const double b ) { return a == vdouble8(b); }
__forceinline const vboold8 operator ==( const double a, const vdouble8& b ) { return vdouble8(a) == b; }
__forceinline vboold8 operator ==(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboold8 operator ==(const vdouble8& a, double b) { return a == vdouble8(b); }
__forceinline vboold8 operator ==(double a, const vdouble8& b) { return vdouble8(a) == b; }
__forceinline const vboold8 operator !=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
__forceinline const vboold8 operator !=( const vdouble8& a, const double b ) { return a != vdouble8(b); }
__forceinline const vboold8 operator !=( const double a, const vdouble8& b ) { return vdouble8(a) != b; }
__forceinline vboold8 operator !=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
__forceinline vboold8 operator !=(const vdouble8& a, double b) { return a != vdouble8(b); }
__forceinline vboold8 operator !=(double a, const vdouble8& b) { return vdouble8(a) != b; }
__forceinline const vboold8 operator < ( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
__forceinline const vboold8 operator < ( const vdouble8& a, const double b ) { return a < vdouble8(b); }
__forceinline const vboold8 operator < ( const double a, const vdouble8& b ) { return vdouble8(a) < b; }
__forceinline vboold8 operator < (const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LT); }
__forceinline vboold8 operator < (const vdouble8& a, double b) { return a < vdouble8(b); }
__forceinline vboold8 operator < (double a, const vdouble8& b) { return vdouble8(a) < b; }
__forceinline const vboold8 operator >=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
__forceinline const vboold8 operator >=( const vdouble8& a, const double b ) { return a >= vdouble8(b); }
__forceinline const vboold8 operator >=( const double a, const vdouble8& b ) { return vdouble8(a) >= b; }
__forceinline vboold8 operator >=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GE); }
__forceinline vboold8 operator >=(const vdouble8& a, double b) { return a >= vdouble8(b); }
__forceinline vboold8 operator >=(double a, const vdouble8& b) { return vdouble8(a) >= b; }
__forceinline const vboold8 operator > ( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
__forceinline const vboold8 operator > ( const vdouble8& a, const double b ) { return a > vdouble8(b); }
__forceinline const vboold8 operator > ( const double a, const vdouble8& b ) { return vdouble8(a) > b; }
__forceinline vboold8 operator > (const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_GT); }
__forceinline vboold8 operator > (const vdouble8& a, double b) { return a > vdouble8(b); }
__forceinline vboold8 operator > (double a, const vdouble8& b) { return vdouble8(a) > b; }
__forceinline const vboold8 operator <=( const vdouble8& a, const vdouble8& b ) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
__forceinline const vboold8 operator <=( const vdouble8& a, const double b ) { return a <= vdouble8(b); }
__forceinline const vboold8 operator <=( const double a, const vdouble8& b ) { return vdouble8(a) <= b; }
__forceinline vboold8 operator <=(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_LE); }
__forceinline vboold8 operator <=(const vdouble8& a, double b) { return a <= vdouble8(b); }
__forceinline vboold8 operator <=(double a, const vdouble8& b) { return vdouble8(a) <= b; }
__forceinline vboold8 eq(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboold8 ne(const vdouble8& a, const vdouble8& b) { return _mm512_cmp_pd_mask(a,b,_MM_CMPINT_NE); }
@@ -258,7 +267,7 @@ namespace embree
__forceinline vboold8 gt(const vboold8 mask, const vdouble8& a, const vdouble8& b) { return _mm512_mask_cmp_pd_mask(mask,a,b,_MM_CMPINT_GT); }
__forceinline vboold8 le(const vboold8 mask, const vdouble8& a, const vdouble8& b) { return _mm512_mask_cmp_pd_mask(mask,a,b,_MM_CMPINT_LE); }
__forceinline const vdouble8 select( const vboold8& m, const vdouble8& t, const vdouble8& f ) {
__forceinline vdouble8 select(const vboold8& m, const vdouble8& t, const vdouble8& f) {
return _mm512_mask_or_pd(f,m,t,t);
}
@@ -278,34 +287,38 @@ namespace embree
// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
template<size_t i>
__forceinline const vdouble8 shuffle( const vdouble8& a ) {
return _mm512_permute_pd(a, _MM_SHUFFLE(i, i, i, i));
}
template<int A, int B, int C, int D>
__forceinline vdouble8 shuffle (const vdouble8& v) {
return _mm512_permute_pd(v,_MM_SHUFFLE(D,C,B,A));
template<int i0, int i1>
__forceinline vdouble8 shuffle(const vdouble8& v) {
return _mm512_permute_pd(v, (i1 << 7) | (i0 << 6) | (i1 << 5) | (i0 << 4) | (i1 << 3) | (i0 << 2) | (i1 << 1) | i0);
}
template<int i>
__forceinline vdouble8 shuffle4(const vdouble8& x) {
return _mm512_shuffle_f64x2(x,x,_MM_SHUFFLE(i,i,i,i));
__forceinline vdouble8 shuffle(const vdouble8& v) {
return shuffle<i, i>(v);
}
template<int A, int B>
__forceinline vdouble8 shuffle4(const vdouble8& x) {
return _mm512_shuffle_f64x2(x,x,_MM_SHUFFLE(0,0,B,A));
template<int i0, int i1, int i2, int i3>
__forceinline vdouble8 shuffle(const vdouble8& v) {
return _mm512_permutex_pd(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<int i0, int i1>
__forceinline vdouble8 shuffle4(const vdouble8& v) {
return _mm512_shuffle_f64x2(v, v, _MM_SHUFFLE(i1*2+1, i1*2, i0*2+1, i0*2));
}
template<int i>
__forceinline vdouble8 shuffle4(const vdouble8& v) {
return shuffle4<i, i>(v);
}
template<int i>
__forceinline vdouble8 align_shift_right(const vdouble8& a, const vdouble8& b)
{
return _mm512_castsi512_pd(_mm512_alignr_epi64(_mm512_castpd_si512(a),_mm512_castpd_si512(b),i));
__forceinline vdouble8 align_shift_right(const vdouble8& a, const vdouble8& b) {
return _mm512_castsi512_pd(_mm512_alignr_epi64(_mm512_castpd_si512(a), _mm512_castpd_si512(b), i));
}
__forceinline double toScalar(const vdouble8& a) {
return _mm_cvtsd_f64(_mm512_castpd512_pd128(a));
__forceinline double toScalar(const vdouble8& v) {
return _mm_cvtsd_f64(_mm512_castpd512_pd128(v));
}
////////////////////////////////////////////////////////////////////////////////
@@ -316,13 +329,13 @@ namespace embree
__forceinline vdouble8 vreduce_add4(vdouble8 x) { x = vreduce_add2(x); return x + shuffle<2,3,0,1>(x); }
__forceinline vdouble8 vreduce_add (vdouble8 x) { x = vreduce_add4(x); return x + shuffle4<1,0>(x); }
__forceinline vdouble8 vreduce_min2(vdouble8 x) { return min(x,shuffle<1,0,3,2>(x)); }
__forceinline vdouble8 vreduce_min4(vdouble8 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
__forceinline vdouble8 vreduce_min (vdouble8 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0>(x)); }
__forceinline vdouble8 vreduce_min2(vdouble8 x) { return min(x, shuffle<1,0,3,2>(x)); }
__forceinline vdouble8 vreduce_min4(vdouble8 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
__forceinline vdouble8 vreduce_min (vdouble8 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0>(x)); }
__forceinline vdouble8 vreduce_max2(vdouble8 x) { return max(x,shuffle<1,0,3,2>(x)); }
__forceinline vdouble8 vreduce_max4(vdouble8 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
__forceinline vdouble8 vreduce_max (vdouble8 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0>(x)); }
__forceinline vdouble8 vreduce_max2(vdouble8 x) { return max(x, shuffle<1,0,3,2>(x)); }
__forceinline vdouble8 vreduce_max4(vdouble8 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
__forceinline vdouble8 vreduce_max (vdouble8 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0>(x)); }
__forceinline double reduce_add(const vdouble8& v) { return toScalar(vreduce_add(v)); }
__forceinline double reduce_min(const vdouble8& v) { return toScalar(vreduce_min(v)); }
@@ -333,18 +346,18 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble8 permute(const vdouble8& v, const vllong8& index) {
return _mm512_permutexvar_pd(index,v);
return _mm512_permutexvar_pd(index, v);
}
__forceinline vdouble8 reverse(const vdouble8& a) {
return permute(a,vllong8(reverse_step));
return permute(a, vllong8(reverse_step));
}
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline std::ostream& operator<<(std::ostream& cout, const vdouble8& v)
__forceinline std::ostream& operator <<(std::ostream& cout, const vdouble8& v)
{
cout << "<" << v[0];
for (size_t i=1; i<8; i++) cout << ", " << v[i];
+310 -201
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -20,7 +20,7 @@ namespace embree
{
/* 16-wide AVX-512 float type */
template<>
struct vfloat<16>
struct vfloat<16>
{
typedef vboolf16 Bool;
typedef vint16 Int;
@@ -39,161 +39,188 @@ namespace embree
__forceinline vfloat() {}
__forceinline vfloat(const vfloat16& t) { v = t; }
__forceinline vfloat16& operator=(const vfloat16& f) { v = f.v; return *this; }
__forceinline vfloat16& operator =(const vfloat16& f) { v = f.v; return *this; }
__forceinline vfloat(const __m512& t) { v = t; }
__forceinline operator __m512 () const { return v; }
__forceinline operator __m256 () const { return _mm512_castps512_ps256(v); }
__forceinline vfloat(const float& f) {
__forceinline operator __m512() const { return v; }
__forceinline operator __m256() const { return _mm512_castps512_ps256(v); }
__forceinline operator __m128() const { return _mm512_castps512_ps128(v); }
__forceinline vfloat(float f) {
v = _mm512_set1_ps(f);
}
__forceinline vfloat(const float& a, const float& b, const float& c, const float& d) {
v = _mm512_set4_ps(a,b,c,d);
__forceinline vfloat(float a, float b, float c, float d) {
v = _mm512_set4_ps(a, b, c, d);
}
__forceinline vfloat(const vfloat4 &i) {
__forceinline vfloat(const vfloat4& i) {
v = _mm512_broadcast_f32x4(i);
}
__forceinline vfloat(const vfloat4 &a, const vfloat4 &b, const vfloat4 &c, const vfloat4 &d) {
v = _mm512_broadcast_f32x4(a);
__forceinline vfloat(const vfloat4& a, const vfloat4& b, const vfloat4& c, const vfloat4& d) {
v = _mm512_castps128_ps512(a);
v = _mm512_insertf32x4(v, b, 1);
v = _mm512_insertf32x4(v, c, 2);
v = _mm512_insertf32x4(v, d, 3);
}
__forceinline vfloat(const vboolf16& mask, const vfloat4 &a, const vfloat4 &b) {
__forceinline vfloat(const vboolf16& mask, const vfloat4& a, const vfloat4& b) {
v = _mm512_broadcast_f32x4(a);
v = _mm512_mask_broadcast_f32x4(v,mask,b);
}
__forceinline vfloat(const vfloat8 &i) {
__forceinline vfloat(const vfloat8& i) {
v = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(i)));
}
__forceinline vfloat(const vfloat8 &a, const vfloat8 &b) { // FIXME: optimize
const vfloat aa = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(a)));
const vfloat bb = _mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castps_pd(b)));
v = _mm512_mask_blend_ps(0xff, bb, aa);
__forceinline vfloat(const vfloat8& a, const vfloat8& b) {
v = _mm512_castps256_ps512(a);
#if defined(__AVX512DQ__)
v = _mm512_insertf32x8(v, b, 1);
#else
v = _mm512_castpd_ps(_mm512_insertf64x4(_mm512_castps_pd(v), _mm256_castps_pd(b), 1));
#endif
}
/* WARNING: due to f64x4 the mask is considered as an 8bit mask */
__forceinline vfloat(const vboolf16& mask, const vfloat8 &a, const vfloat8 &b) {
__forceinline vfloat(const vboolf16& mask, const vfloat8& a, const vfloat8& b) {
__m512d aa = _mm512_broadcast_f64x4(_mm256_castps_pd(a));
aa = _mm512_mask_broadcast_f64x4(aa,mask,_mm256_castps_pd(b));
v = _mm512_castpd_ps(aa);
}
__forceinline explicit vfloat(const __m512i& a) {
__forceinline explicit vfloat(const vint16& a) {
v = _mm512_cvtepi32_ps(a);
}
__forceinline explicit vfloat(const vuint16& a) {
v = _mm512_cvtepu32_ps(a);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat(ZeroTy) : v(_mm512_setzero_ps()) {}
__forceinline vfloat(OneTy) : v(_mm512_set1_ps(1.0f)) {}
__forceinline vfloat(PosInfTy) : v(_mm512_set1_ps(pos_inf)) {}
__forceinline vfloat(NegInfTy) : v(_mm512_set1_ps(neg_inf)) {}
__forceinline vfloat(StepTy) : v(_mm512_set_ps(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
__forceinline vfloat(NaNTy) : v(_mm512_set1_ps(nan)) {}
__forceinline vfloat(UndefinedTy) : v(_mm512_undefined_ps()) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline vfloat16 load (const void* const ptr) { return _mm512_load_ps((float*)ptr); }
static __forceinline vfloat16 loadu(const void* const ptr) { return _mm512_loadu_ps((float*)ptr); }
static __forceinline vfloat16 load (const void* ptr) { return _mm512_load_ps((float*)ptr); }
static __forceinline vfloat16 loadu(const void* ptr) { return _mm512_loadu_ps((float*)ptr); }
static __forceinline vfloat16 load (const vboolf16& mask, const void* const ptr) { return _mm512_mask_load_ps (_mm512_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat16 loadu(const vboolf16& mask, const void* const ptr) { return _mm512_mask_loadu_ps(_mm512_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat16 load (const vboolf16& mask, const void* ptr) { return _mm512_mask_load_ps (_mm512_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat16 loadu(const vboolf16& mask, const void* ptr) { return _mm512_mask_loadu_ps(_mm512_setzero_ps(),mask,(float*)ptr); }
static __forceinline void store (void* const ptr, const vfloat16& v) { _mm512_store_ps ((float*)ptr,v); }
static __forceinline void storeu(void* const ptr, const vfloat16& v) { _mm512_storeu_ps((float*)ptr,v); }
static __forceinline void store (void* ptr, const vfloat16& v) { _mm512_store_ps ((float*)ptr,v); }
static __forceinline void storeu(void* ptr, const vfloat16& v) { _mm512_storeu_ps((float*)ptr,v); }
static __forceinline void store (const vboolf16& mask, void* ptr, const vfloat16& v) { _mm512_mask_store_ps ((float*)ptr,mask,v); }
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vfloat16& v) { _mm512_mask_storeu_ps((float*)ptr,mask,v); }
static __forceinline void store_nt(void *__restrict__ ptr, const vfloat16& a) {
static __forceinline void store_nt(void* __restrict__ ptr, const vfloat16& a) {
_mm512_stream_ps((float*)ptr,a);
}
static __forceinline vfloat16 broadcast(const float *const f) {
static __forceinline vfloat16 broadcast(const float* f) {
return _mm512_set1_ps(*f);
}
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &v) {
return _mm512_mask_compress_ps(v,mask,v);
return _mm512_mask_compress_ps(v, mask, v);
}
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &a, const vfloat16 &b) {
return _mm512_mask_compress_ps(a,mask,b);
static __forceinline vfloat16 compact(const vboolf16& mask, vfloat16 &a, const vfloat16& b) {
return _mm512_mask_compress_ps(a, mask, b);
}
static __forceinline vfloat16 expand(const vboolf16& mask, const vfloat16& a, vfloat16& b) {
return _mm512_mask_expand_ps(b,mask,a);
return _mm512_mask_expand_ps(b, mask, a);
}
static __forceinline vfloat16 loadu_compact(const vboolf16& mask, const void *const ptr) {
return _mm512_mask_expandloadu_ps(vfloat16::undefined(),mask,(float*)ptr);
static __forceinline vfloat16 loadu_compact(const vboolf16& mask, const void* ptr) {
return _mm512_mask_expandloadu_ps(_mm512_setzero_ps(), mask, (float*)ptr);
}
static __forceinline void storeu_compact(const vboolf16& mask, float *addr, const vfloat16 reg) {
_mm512_mask_compressstoreu_ps(addr,mask,reg);
_mm512_mask_compressstoreu_ps(addr, mask, reg);
}
static __forceinline void storeu_compact_single(const vboolf16& mask, float * addr, const vfloat16 &reg) {
static __forceinline void storeu_compact_single(const vboolf16& mask, float * addr, const vfloat16& reg) {
//_mm512_mask_compressstoreu_ps(addr,mask,reg);
*addr = mm512_cvtss_f32(_mm512_mask_compress_ps(reg,mask,reg));
*addr = mm512_cvtss_f32(_mm512_mask_compress_ps(reg, mask, reg));
}
template<int scale = 4>
static __forceinline vfloat16 gather(const float* ptr, const vint16& index) {
return _mm512_i32gather_ps(index, ptr, scale);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat( ZeroTy ) : v(_mm512_setzero_ps()) {}
__forceinline vfloat( OneTy ) : v(_mm512_set1_ps(1.0f)) {}
__forceinline vfloat( PosInfTy ) : v(_mm512_set1_ps(pos_inf)) {}
__forceinline vfloat( NegInfTy ) : v(_mm512_set1_ps(neg_inf)) {}
__forceinline vfloat( StepTy ) : v(_mm512_set_ps(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
__forceinline vfloat( NaNTy ) : v(_mm512_set1_ps(nan)) {}
template<int scale = 4>
static __forceinline vfloat16 gather(const vboolf16& mask, const float* ptr, const vint16& index) {
vfloat16 r = zero;
return _mm512_mask_i32gather_ps(r, mask, index, ptr, scale);
}
__forceinline static vfloat16 undefined() { return _mm512_undefined_ps(); }
__forceinline static vfloat16 zero() { return _mm512_setzero_ps(); }
__forceinline static vfloat16 one () { return _mm512_set1_ps(1.0f); }
__forceinline static vfloat16 ulp () { return _mm512_set1_ps(embree::ulp); }
__forceinline static vfloat16 inf () { return _mm512_set1_ps((float)pos_inf); }
__forceinline static vfloat16 minus_inf () { return _mm512_set1_ps((float)neg_inf); }
template<int scale = 4>
static __forceinline void scatter(float* ptr, const vint16& index, const vfloat16& v) {
_mm512_i32scatter_ps(ptr, index, v, scale);
}
template<int scale = 4>
static __forceinline void scatter(const vboolf16& mask, float* ptr, const vint16& index, const vfloat16& v) {
_mm512_mask_i32scatter_ps(ptr, mask, index, v, scale);
}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline float& operator [](const size_t index) { assert(index < 16); return f[index]; }
__forceinline const float& operator [](const size_t index) const { assert(index < 16); return f[index]; }
__forceinline float& operator [](size_t index) { assert(index < 16); return f[index]; }
__forceinline const float& operator [](size_t index) const { assert(index < 16); return f[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat16 asFloat ( const __m512i& a ) { return _mm512_castsi512_ps(a); }
__forceinline const vfloat16 operator +( const vfloat16& a ) { return a; }
__forceinline const vfloat16 operator -( const vfloat16& a ) { return _mm512_mul_ps(a,vfloat16(-1)); }
__forceinline const vfloat16 abs ( const vfloat16& a ) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x7FFFFFFF))); }
__forceinline const vfloat16 signmsk ( const vfloat16& a ) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x80000000))); }
__forceinline vfloat16 asFloat(const vint16& a) { return _mm512_castsi512_ps(a); }
__forceinline vint16 asInt (const vfloat16& a) { return _mm512_castps_si512(a); }
__forceinline vuint16 asUInt (const vfloat16& a) { return _mm512_castps_si512(a); }
__forceinline const vfloat16 rcp(const vfloat16& a) {
__forceinline vfloat16 operator +(const vfloat16& a) { return a; }
__forceinline vfloat16 operator -(const vfloat16& a) { return _mm512_mul_ps(a,vfloat16(-1)); }
__forceinline vfloat16 abs (const vfloat16& a) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x7FFFFFFF))); }
__forceinline vfloat16 signmsk(const vfloat16& a) { return _mm512_castsi512_ps(_mm512_and_epi32(_mm512_castps_si512(a),_mm512_set1_epi32(0x80000000))); }
__forceinline vfloat16 rcp(const vfloat16& a) {
#if defined(__AVX512ER__)
return _mm512_rcp28_ps(a);
#else
const vfloat16 r = _mm512_rcp14_ps(a.v);
const vfloat16 r = _mm512_rcp14_ps(a);
return _mm512_mul_ps(r, _mm512_fnmadd_ps(r, a, vfloat16(2.0f)));
#endif
}
__forceinline const vfloat16 sqr ( const vfloat16& a ) { return _mm512_mul_ps(a,a); }
__forceinline const vfloat16 sqrt ( const vfloat16& a ) { return _mm512_sqrt_ps(a); }
__forceinline vfloat16 sqr (const vfloat16& a) { return _mm512_mul_ps(a,a); }
__forceinline vfloat16 sqrt(const vfloat16& a) { return _mm512_sqrt_ps(a); }
__forceinline const vfloat16 rsqrt( const vfloat16& a )
__forceinline vfloat16 rsqrt(const vfloat16& a)
{
#if defined(__AVX512VL__)
const vfloat16 r = _mm512_rsqrt14_ps(a.v);
const vfloat16 r = _mm512_rsqrt14_ps(a);
return _mm512_fmadd_ps(_mm512_set1_ps(1.5f), r,
_mm512_mul_ps(_mm512_mul_ps(_mm512_mul_ps(a, _mm512_set1_ps(-0.5f)), r), _mm512_mul_ps(r, r)));
#else
return _mm512_rsqrt28_ps(a.v);
return _mm512_rsqrt28_ps(a);
#endif
}
@@ -201,43 +228,43 @@ namespace embree
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat16 operator +( const vfloat16& a, const vfloat16& b ) { return _mm512_add_ps(a, b); }
__forceinline const vfloat16 operator +( const vfloat16& a, const float& b ) { return a + vfloat16(b); }
__forceinline const vfloat16 operator +( const float& a, const vfloat16& b ) { return vfloat16(a) + b; }
__forceinline vfloat16 operator +(const vfloat16& a, const vfloat16& b) { return _mm512_add_ps(a, b); }
__forceinline vfloat16 operator +(const vfloat16& a, float b) { return a + vfloat16(b); }
__forceinline vfloat16 operator +(float a, const vfloat16& b) { return vfloat16(a) + b; }
__forceinline const vfloat16 operator -( const vfloat16& a, const vfloat16& b ) { return _mm512_sub_ps(a, b); }
__forceinline const vfloat16 operator -( const vfloat16& a, const float& b ) { return a - vfloat16(b); }
__forceinline const vfloat16 operator -( const float& a, const vfloat16& b ) { return vfloat16(a) - b; }
__forceinline vfloat16 operator -(const vfloat16& a, const vfloat16& b) { return _mm512_sub_ps(a, b); }
__forceinline vfloat16 operator -(const vfloat16& a, float b) { return a - vfloat16(b); }
__forceinline vfloat16 operator -(float a, const vfloat16& b) { return vfloat16(a) - b; }
__forceinline const vfloat16 operator *( const vfloat16& a, const vfloat16& b ) { return _mm512_mul_ps(a, b); }
__forceinline const vfloat16 operator *( const vfloat16& a, const float& b ) { return a * vfloat16(b); }
__forceinline const vfloat16 operator *( const float& a, const vfloat16& b ) { return vfloat16(a) * b; }
__forceinline vfloat16 operator *(const vfloat16& a, const vfloat16& b) { return _mm512_mul_ps(a, b); }
__forceinline vfloat16 operator *(const vfloat16& a, float b) { return a * vfloat16(b); }
__forceinline vfloat16 operator *(float a, const vfloat16& b) { return vfloat16(a) * b; }
__forceinline const vfloat16 operator /( const vfloat16& a, const vfloat16& b ) { return _mm512_div_ps(a,b); }
__forceinline const vfloat16 operator /( const vfloat16& a, const float& b ) { return a/vfloat16(b); }
__forceinline const vfloat16 operator /( const float& a, const vfloat16& b ) { return vfloat16(a)/b; }
__forceinline vfloat16 operator /(const vfloat16& a, const vfloat16& b) { return _mm512_div_ps(a,b); }
__forceinline vfloat16 operator /(const vfloat16& a, float b) { return a/vfloat16(b); }
__forceinline vfloat16 operator /(float a, const vfloat16& b) { return vfloat16(a)/b; }
__forceinline const vfloat16 operator^(const vfloat16& a, const vfloat16& b) {
__forceinline vfloat16 operator ^(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_xor_epi32(_mm512_castps_si512(a),_mm512_castps_si512(b)));
}
__forceinline const vfloat16 min( const vfloat16& a, const vfloat16& b ) {
__forceinline vfloat16 min(const vfloat16& a, const vfloat16& b) {
return _mm512_min_ps(a,b);
}
__forceinline const vfloat16 min( const vfloat16& a, const float& b ) {
__forceinline vfloat16 min(const vfloat16& a, float b) {
return _mm512_min_ps(a,vfloat16(b));
}
__forceinline const vfloat16 min( const float& a, const vfloat16& b ) {
__forceinline vfloat16 min(const float& a, const vfloat16& b) {
return _mm512_min_ps(vfloat16(a),b);
}
__forceinline const vfloat16 max( const vfloat16& a, const vfloat16& b ) {
__forceinline vfloat16 max(const vfloat16& a, const vfloat16& b) {
return _mm512_max_ps(a,b);
}
__forceinline const vfloat16 max( const vfloat16& a, const float& b ) {
__forceinline vfloat16 max(const vfloat16& a, float b) {
return _mm512_max_ps(a,vfloat16(b));
}
__forceinline const vfloat16 max( const float& a, const vfloat16& b ) {
__forceinline vfloat16 max(const float& a, const vfloat16& b) {
return _mm512_max_ps(vfloat16(a),b);
}
@@ -276,12 +303,11 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat16 madd (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_ps(a,b,c); }
__forceinline vfloat16 msub (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmsub_ps(a,b,c); }
__forceinline vfloat16 nmadd (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmadd_ps(a,b,c); }
__forceinline vfloat16 nmsub (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmsub_ps(a,b,c); }
__forceinline vfloat16 nmadd(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmadd_ps(a,b,c); }
__forceinline vfloat16 nmsub(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fnmsub_ps(a,b,c); }
__forceinline vfloat16 mask_msub (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_ps(a,mask,b,c); }
__forceinline vfloat16 mask_msub(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_ps(a,mask,b,c); }
__forceinline vfloat16 madd231 (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_ps(c,b,a); }
__forceinline vfloat16 msub213 (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmsub_ps(a,b,c); }
@@ -293,74 +319,74 @@ namespace embree
/// Operators with rounding
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat16 madd_round_down (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 madd_round_up (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 madd_round_down(const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 madd_round_up (const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_fmadd_round_ps(a,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mul_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mul_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mul_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mul_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_mul_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 add_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 add_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 add_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 add_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_add_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 sub_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 sub_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 sub_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 sub_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_sub_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 div_round_down (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 div_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 div_round_down(const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 div_round_up (const vfloat16& a, const vfloat16& b) { return _mm512_div_round_ps(a,b,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_msub_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_msub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_msub_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_msub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_fmsub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_mul_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_mul_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_mul_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_mul_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_mul_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_sub_round_down (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_sub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_sub_round_down(const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); }
__forceinline vfloat16 mask_sub_round_up (const vboolf16& mask,const vfloat16& a, const vfloat16& b, const vfloat16& c) { return _mm512_mask_sub_round_ps(a,mask,b,c,_MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat16& operator +=( vfloat16& a, const vfloat16& b ) { return a = a + b; }
__forceinline vfloat16& operator +=( vfloat16& a, const float& b ) { return a = a + b; }
__forceinline vfloat16& operator +=(vfloat16& a, const vfloat16& b) { return a = a + b; }
__forceinline vfloat16& operator +=(vfloat16& a, float b) { return a = a + b; }
__forceinline vfloat16& operator -=( vfloat16& a, const vfloat16& b ) { return a = a - b; }
__forceinline vfloat16& operator -=( vfloat16& a, const float& b ) { return a = a - b; }
__forceinline vfloat16& operator -=(vfloat16& a, const vfloat16& b) { return a = a - b; }
__forceinline vfloat16& operator -=(vfloat16& a, float b) { return a = a - b; }
__forceinline vfloat16& operator *=( vfloat16& a, const vfloat16& b ) { return a = a * b; }
__forceinline vfloat16& operator *=( vfloat16& a, const float& b ) { return a = a * b; }
__forceinline vfloat16& operator *=(vfloat16& a, const vfloat16& b) { return a = a * b; }
__forceinline vfloat16& operator *=(vfloat16& a, float b) { return a = a * b; }
__forceinline vfloat16& operator /=( vfloat16& a, const vfloat16& b ) { return a = a / b; }
__forceinline vfloat16& operator /=( vfloat16& a, const float& b ) { return a = a / b; }
__forceinline vfloat16& operator /=(vfloat16& a, const vfloat16& b) { return a = a / b; }
__forceinline vfloat16& operator /=(vfloat16& a, float b) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf16 operator ==( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
__forceinline const vboolf16 operator ==( const vfloat16& a, const float& b ) { return a == vfloat16(b); }
__forceinline const vboolf16 operator ==( const float& a, const vfloat16& b ) { return vfloat16(a) == b; }
__forceinline vboolf16 operator ==(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboolf16 operator ==(const vfloat16& a, float b) { return a == vfloat16(b); }
__forceinline vboolf16 operator ==(float a, const vfloat16& b) { return vfloat16(a) == b; }
__forceinline const vboolf16 operator !=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
__forceinline const vboolf16 operator !=( const vfloat16& a, const float& b ) { return a != vfloat16(b); }
__forceinline const vboolf16 operator !=( const float& a, const vfloat16& b ) { return vfloat16(a) != b; }
__forceinline vboolf16 operator !=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
__forceinline vboolf16 operator !=(const vfloat16& a, float b) { return a != vfloat16(b); }
__forceinline vboolf16 operator !=(float a, const vfloat16& b) { return vfloat16(a) != b; }
__forceinline const vboolf16 operator < ( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LT); }
__forceinline const vboolf16 operator < ( const vfloat16& a, const float& b ) { return a < vfloat16(b); }
__forceinline const vboolf16 operator < ( const float& a, const vfloat16& b ) { return vfloat16(a) < b; }
__forceinline vboolf16 operator < (const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LT); }
__forceinline vboolf16 operator < (const vfloat16& a, float b) { return a < vfloat16(b); }
__forceinline vboolf16 operator < (float a, const vfloat16& b) { return vfloat16(a) < b; }
__forceinline const vboolf16 operator >=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GE); }
__forceinline const vboolf16 operator >=( const vfloat16& a, const float& b ) { return a >= vfloat16(b); }
__forceinline const vboolf16 operator >=( const float& a, const vfloat16& b ) { return vfloat16(a) >= b; }
__forceinline vboolf16 operator >=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GE); }
__forceinline vboolf16 operator >=(const vfloat16& a, float b) { return a >= vfloat16(b); }
__forceinline vboolf16 operator >=(float a, const vfloat16& b) { return vfloat16(a) >= b; }
__forceinline const vboolf16 operator > ( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GT); }
__forceinline const vboolf16 operator > ( const vfloat16& a, const float& b ) { return a > vfloat16(b); }
__forceinline const vboolf16 operator > ( const float& a, const vfloat16& b ) { return vfloat16(a) > b; }
__forceinline vboolf16 operator > (const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_GT); }
__forceinline vboolf16 operator > (const vfloat16& a, float b) { return a > vfloat16(b); }
__forceinline vboolf16 operator > (float a, const vfloat16& b) { return vfloat16(a) > b; }
__forceinline const vboolf16 operator <=( const vfloat16& a, const vfloat16& b ) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LE); }
__forceinline const vboolf16 operator <=( const vfloat16& a, const float& b ) { return a <= vfloat16(b); }
__forceinline const vboolf16 operator <=( const float& a, const vfloat16& b ) { return vfloat16(a) <= b; }
__forceinline vboolf16 operator <=(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_LE); }
__forceinline vboolf16 operator <=(const vfloat16& a, float b) { return a <= vfloat16(b); }
__forceinline vboolf16 operator <=(float a, const vfloat16& b) { return vfloat16(a) <= b; }
__forceinline vboolf16 eq(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboolf16 ne(const vfloat16& a, const vfloat16& b) { return _mm512_cmp_ps_mask(a,b,_MM_CMPINT_NE); }
@@ -376,7 +402,7 @@ namespace embree
__forceinline vboolf16 gt(const vboolf16& mask, const vfloat16& a, const vfloat16& b) { return _mm512_mask_cmp_ps_mask(mask,a,b,_MM_CMPINT_GT); }
__forceinline vboolf16 le(const vboolf16& mask, const vfloat16& a, const vfloat16& b) { return _mm512_mask_cmp_ps_mask(mask,a,b,_MM_CMPINT_LE); }
__forceinline const vfloat16 select( const vboolf16& s, const vfloat16& t, const vfloat16& f ) {
__forceinline vfloat16 select(const vboolf16& s, const vfloat16& t, const vfloat16& f) {
return _mm512_mask_blend_ps(s, f, t);
}
@@ -409,61 +435,86 @@ namespace embree
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
template<size_t i>
__forceinline const vfloat16 shuffle( const vfloat16& a ) {
return _mm512_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
__forceinline vfloat16 unpacklo(const vfloat16& a, const vfloat16& b) { return _mm512_unpacklo_ps(a, b); }
__forceinline vfloat16 unpackhi(const vfloat16& a, const vfloat16& b) { return _mm512_unpackhi_ps(a, b); }
template<int i>
__forceinline vfloat16 shuffle(const vfloat16& v) {
return _mm512_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
}
template<int A, int B, int C, int D>
__forceinline vfloat16 shuffle (const vfloat16& v) {
return _mm512_permute_ps(v,_MM_SHUFFLE(D,C,B,A));
template<int i0, int i1, int i2, int i3>
__forceinline vfloat16 shuffle(const vfloat16& v) {
return _mm512_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<int i>
__forceinline vfloat16 shuffle4(const vfloat16& x) {
return _mm512_shuffle_f32x4(x,x,_MM_SHUFFLE(i,i,i,i));
__forceinline vfloat16 shuffle4(const vfloat16& v) {
return _mm512_shuffle_f32x4(v, v ,_MM_SHUFFLE(i, i, i, i));
}
template<int A, int B, int C, int D>
__forceinline vfloat16 shuffle4(const vfloat16& x) {
return _mm512_shuffle_f32x4(x,x,_MM_SHUFFLE(D,C,B,A));
template<int i0, int i1, int i2, int i3>
__forceinline vfloat16 shuffle4(const vfloat16& v) {
return _mm512_shuffle_f32x4(v, v, _MM_SHUFFLE(i3, i2, i1, i0));
}
__forceinline vfloat16 permute(vfloat16 v,__m512i index)
{
return _mm512_castsi512_ps(_mm512_permutexvar_epi32(index,_mm512_castps_si512(v)));
__forceinline vfloat16 interleave_even(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), (_MM_PERM_ENUM)0xb1));
}
__forceinline vfloat16 reverse(const vfloat16 &a)
{
return permute(a,_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0));
__forceinline vfloat16 interleave_odd(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), (_MM_PERM_ENUM)0xb1));
}
__forceinline vfloat16 interleave2_even(const vfloat16& a, const vfloat16& b) {
/* mask should be 8-bit but is 16-bit to reuse for interleave_even */
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), (_MM_PERM_ENUM)0xb1));
}
__forceinline vfloat16 interleave2_odd(const vfloat16& a, const vfloat16& b) {
/* mask should be 8-bit but is 16-bit to reuse for interleave_odd */
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), (_MM_PERM_ENUM)0xb1));
}
__forceinline vfloat16 interleave4_even(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xcc), _mm512_castps_si512(b), (_MM_PERM_ENUM)0x4e));
}
__forceinline vfloat16 interleave4_odd(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x33), _mm512_castps_si512(a), (_MM_PERM_ENUM)0x4e));
}
__forceinline vfloat16 permute(vfloat16 v, __m512i index) {
return _mm512_castsi512_ps(_mm512_permutexvar_epi32(index, _mm512_castps_si512(v)));
}
__forceinline vfloat16 reverse(const vfloat16& v) {
return permute(v,_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0));
}
template<int i>
__forceinline vfloat16 align_shift_right(const vfloat16 &a, const vfloat16 &b)
{
__forceinline vfloat16 align_shift_right(const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_alignr_epi32(_mm512_castps_si512(a),_mm512_castps_si512(b),i));
};
template<int i>
__forceinline vfloat16 mask_align_shift_right(const vboolf16 &mask,vfloat16 &c,const vfloat16 &a, const vfloat16 &b)
{
__forceinline vfloat16 mask_align_shift_right(const vboolf16& mask, vfloat16& c, const vfloat16& a, const vfloat16& b) {
return _mm512_castsi512_ps(_mm512_mask_alignr_epi32(_mm512_castps_si512(c),mask,_mm512_castps_si512(a),_mm512_castps_si512(b),i));
};
__forceinline vfloat16 shift_left_1(const vfloat16 &a) {
vfloat16 z = vfloat16::zero();
__forceinline vfloat16 shift_left_1(const vfloat16& a) {
vfloat16 z = zero;
return mask_align_shift_right<15>(0xfffe,z,a,a);
}
__forceinline vfloat16 shift_right_1( const vfloat16& x) {
__forceinline vfloat16 shift_right_1(const vfloat16& x) {
return align_shift_right<1>(zero,x);
}
__forceinline float toScalar(const vfloat16& a) { return mm512_cvtss_f32(a); }
__forceinline float toScalar(const vfloat16& v) { return mm512_cvtss_f32(v); }
template<int i> __forceinline const vfloat16 insert4(const vfloat16& a, const vfloat4& b) { return _mm512_insertf32x4(a, b, i); }
template<int i> __forceinline vfloat16 insert4(const vfloat16& a, const vfloat4& b) { return _mm512_insertf32x4(a, b, i); }
template<int N, int i>
vfloat<N> extractN(const vfloat16& v);
@@ -482,6 +533,79 @@ namespace embree
template<int i> __forceinline vfloat8 extract8 (const vfloat16& v) { return _mm512_extractf32x8_ps(v, i); }
template<> __forceinline vfloat8 extract8<0>(const vfloat16& v) { return _mm512_castps512_ps256(v); }
////////////////////////////////////////////////////////////////////////////////
/// Transpose
////////////////////////////////////////////////////////////////////////////////
__forceinline void transpose(const vfloat16& r0, const vfloat16& r1, const vfloat16& r2, const vfloat16& r3,
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3)
{
#if defined(__AVX512F__) && !defined(__AVX512VL__) // KNL
vfloat16 a0a1_c0c1 = interleave_even(r0, r1);
vfloat16 a2a3_c2c3 = interleave_even(r2, r3);
vfloat16 b0b1_d0d1 = interleave_odd (r0, r1);
vfloat16 b2b3_d2d3 = interleave_odd (r2, r3);
c0 = interleave2_even(a0a1_c0c1, a2a3_c2c3);
c1 = interleave2_even(b0b1_d0d1, b2b3_d2d3);
c2 = interleave2_odd (a0a1_c0c1, a2a3_c2c3);
c3 = interleave2_odd (b0b1_d0d1, b2b3_d2d3);
#else
vfloat16 a0a2_b0b2 = unpacklo(r0, r2);
vfloat16 c0c2_d0d2 = unpackhi(r0, r2);
vfloat16 a1a3_b1b3 = unpacklo(r1, r3);
vfloat16 c1c3_d1d3 = unpackhi(r1, r3);
c0 = unpacklo(a0a2_b0b2, a1a3_b1b3);
c1 = unpackhi(a0a2_b0b2, a1a3_b1b3);
c2 = unpacklo(c0c2_d0d2, c1c3_d1d3);
c3 = unpackhi(c0c2_d0d2, c1c3_d1d3);
#endif
}
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3,
const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
const vfloat4& r8, const vfloat4& r9, const vfloat4& r10, const vfloat4& r11,
const vfloat4& r12, const vfloat4& r13, const vfloat4& r14, const vfloat4& r15,
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3)
{
return transpose(vfloat16(r0, r4, r8, r12), vfloat16(r1, r5, r9, r13), vfloat16(r2, r6, r10, r14), vfloat16(r3, r7, r11, r15),
c0, c1, c2, c3);
}
__forceinline void transpose(const vfloat16& r0, const vfloat16& r1, const vfloat16& r2, const vfloat16& r3,
const vfloat16& r4, const vfloat16& r5, const vfloat16& r6, const vfloat16& r7,
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3,
vfloat16& c4, vfloat16& c5, vfloat16& c6, vfloat16& c7)
{
vfloat16 a0a1a2a3_e0e1e2e3, b0b1b2b3_f0f1f2f3, c0c1c2c3_g0g1g2g3, d0d1d2d3_h0h1h2h3;
transpose(r0, r1, r2, r3, a0a1a2a3_e0e1e2e3, b0b1b2b3_f0f1f2f3, c0c1c2c3_g0g1g2g3, d0d1d2d3_h0h1h2h3);
vfloat16 a4a5a6a7_e4e5e6e7, b4b5b6b7_f4f5f6f7, c4c5c6c7_g4g5g6g7, d4d5d6d7_h4h5h6h7;
transpose(r4, r5, r6, r7, a4a5a6a7_e4e5e6e7, b4b5b6b7_f4f5f6f7, c4c5c6c7_g4g5g6g7, d4d5d6d7_h4h5h6h7);
c0 = interleave4_even(a0a1a2a3_e0e1e2e3, a4a5a6a7_e4e5e6e7);
c1 = interleave4_even(b0b1b2b3_f0f1f2f3, b4b5b6b7_f4f5f6f7);
c2 = interleave4_even(c0c1c2c3_g0g1g2g3, c4c5c6c7_g4g5g6g7);
c3 = interleave4_even(d0d1d2d3_h0h1h2h3, d4d5d6d7_h4h5h6h7);
c4 = interleave4_odd (a0a1a2a3_e0e1e2e3, a4a5a6a7_e4e5e6e7);
c5 = interleave4_odd (b0b1b2b3_f0f1f2f3, b4b5b6b7_f4f5f6f7);
c6 = interleave4_odd (c0c1c2c3_g0g1g2g3, c4c5c6c7_g4g5g6g7);
c7 = interleave4_odd (d0d1d2d3_h0h1h2h3, d4d5d6d7_h4h5h6h7);
}
__forceinline void transpose(const vfloat8& r0, const vfloat8& r1, const vfloat8& r2, const vfloat8& r3,
const vfloat8& r4, const vfloat8& r5, const vfloat8& r6, const vfloat8& r7,
const vfloat8& r8, const vfloat8& r9, const vfloat8& r10, const vfloat8& r11,
const vfloat8& r12, const vfloat8& r13, const vfloat8& r14, const vfloat8& r15,
vfloat16& c0, vfloat16& c1, vfloat16& c2, vfloat16& c3,
vfloat16& c4, vfloat16& c5, vfloat16& c6, vfloat16& c7)
{
return transpose(vfloat16(r0, r8), vfloat16(r1, r9), vfloat16(r2, r10), vfloat16(r3, r11),
vfloat16(r4, r12), vfloat16(r5, r13), vfloat16(r6, r14), vfloat16(r7, r15),
c0, c1, c2, c3, c4, c5, c6, c7);
}
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
@@ -491,40 +615,40 @@ namespace embree
__forceinline vfloat16 vreduce_add8(vfloat16 x) { x = vreduce_add4(x); return x + shuffle4<1,0,3,2>(x); }
__forceinline vfloat16 vreduce_add (vfloat16 x) { x = vreduce_add8(x); return x + shuffle4<2,3,0,1>(x); }
__forceinline vfloat16 vreduce_min2(vfloat16 x) { return min(x,shuffle<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_min4(vfloat16 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_min8(vfloat16 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_min (vfloat16 x) { x = vreduce_min8(x); return min(x,shuffle4<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_min2(vfloat16 x) { return min(x, shuffle<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_min4(vfloat16 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_min8(vfloat16 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_min (vfloat16 x) { x = vreduce_min8(x); return min(x, shuffle4<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_max2(vfloat16 x) { return max(x,shuffle<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_max4(vfloat16 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_max8(vfloat16 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_max (vfloat16 x) { x = vreduce_max8(x); return max(x,shuffle4<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_max2(vfloat16 x) { return max(x, shuffle<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_max4(vfloat16 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
__forceinline vfloat16 vreduce_max8(vfloat16 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0,3,2>(x)); }
__forceinline vfloat16 vreduce_max (vfloat16 x) { x = vreduce_max8(x); return max(x, shuffle4<2,3,0,1>(x)); }
__forceinline float reduce_add(const vfloat16& v) { return toScalar(vreduce_add(v)); }
__forceinline float reduce_min(const vfloat16& v) { return toScalar(vreduce_min(v)); }
__forceinline float reduce_max(const vfloat16& v) { return toScalar(vreduce_max(v)); }
__forceinline size_t select_min(const vfloat16& v) {
return __bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_min(v)),_MM_CMPINT_EQ)));
return bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_min(v)),_MM_CMPINT_EQ)));
}
__forceinline size_t select_max(const vfloat16& v) {
return __bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_max(v)),_MM_CMPINT_EQ)));
return bsf(_mm512_kmov(_mm512_cmp_epi32_mask(_mm512_castps_si512(v),_mm512_castps_si512(vreduce_max(v)),_MM_CMPINT_EQ)));
}
__forceinline size_t select_min(const vboolf16& valid, const vfloat16& v)
{
const vfloat16 a = select(valid,v,vfloat16(pos_inf));
const vbool16 valid_min = valid & (a == vreduce_min(a));
return __bsf(movemask(any(valid_min) ? valid_min : valid));
return bsf(movemask(any(valid_min) ? valid_min : valid));
}
__forceinline size_t select_max(const vboolf16& valid, const vfloat16& v)
{
const vfloat16 a = select(valid,v,vfloat16(neg_inf));
const vbool16 valid_max = valid & (a == vreduce_max(a));
return __bsf(movemask(any(valid_max) ? valid_max : valid));
return bsf(movemask(any(valid_max) ? valid_max : valid));
}
__forceinline vfloat16 prefix_sum(const vfloat16& a)
@@ -598,47 +722,32 @@ namespace embree
/// Memory load and store operations
////////////////////////////////////////////////////////////////////////////////
__forceinline void compactustore16f_low(const vboolf16& mask, float * addr, const vfloat16 &reg) {
_mm512_mask_compressstoreu_ps(addr,mask,reg);
}
template<int scale = 4>
__forceinline vfloat16 gather16f(const vboolf16& mask, const float *const ptr, __m512i index) {
vfloat16 r = vfloat16::undefined();
return _mm512_mask_i32gather_ps(r,mask,index,ptr,scale);
}
template<int scale = 4>
__forceinline void scatter16f(const vboolf16& mask,const float *const ptr, const __m512i index,const vfloat16 v) {
_mm512_mask_i32scatter_ps(ptr,mask,index,v,scale);
}
__forceinline vfloat16 loadAOS4to16f(const float& x,const float& y, const float& z)
__forceinline vfloat16 loadAOS4to16f(const float& x, const float& y, const float& z)
{
vfloat16 f = vfloat16::zero();
vfloat16 f = zero;
f = select(0x1111,vfloat16::broadcast(&x),f);
f = select(0x2222,vfloat16::broadcast(&y),f);
f = select(0x4444,vfloat16::broadcast(&z),f);
return f;
}
__forceinline vfloat16 loadAOS4to16f(const unsigned int index,
const vfloat16 &x,
const vfloat16 &y,
const vfloat16 &z)
__forceinline vfloat16 loadAOS4to16f(unsigned int index,
const vfloat16& x,
const vfloat16& y,
const vfloat16& z)
{
vfloat16 f = vfloat16::zero();
vfloat16 f = zero;
f = select(0x1111,vfloat16::broadcast((float*)&x + index),f);
f = select(0x2222,vfloat16::broadcast((float*)&y + index),f);
f = select(0x4444,vfloat16::broadcast((float*)&z + index),f);
return f;
}
__forceinline vfloat16 loadAOS4to16f(const unsigned int index,
const vfloat16 &x,
const vfloat16 &y,
const vfloat16 &z,
const vfloat16 &fill)
__forceinline vfloat16 loadAOS4to16f(unsigned int index,
const vfloat16& x,
const vfloat16& y,
const vfloat16& z,
const vfloat16& fill)
{
vfloat16 f = fill;
f = select(0x1111,vfloat16::broadcast((float*)&x + index),f);
@@ -647,15 +756,15 @@ namespace embree
return f;
}
__forceinline vfloat16 rcp_safe( const vfloat16& a ) {
return rcp(select(a != vfloat16::zero(),a,vfloat16(min_rcp_input)));
__forceinline vfloat16 rcp_safe(const vfloat16& a) {
return rcp(select(a != vfloat16(zero), a, vfloat16(min_rcp_input)));
}
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline std::ostream &operator<<(std::ostream& cout, const vfloat16& v)
__forceinline std::ostream& operator <<(std::ostream& cout, const vfloat16& v)
{
cout << "<" << v[0];
for (int i=1; i<16; i++) cout << ", " << v[i];
+267 -172
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,67 +33,83 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat ( ) {}
__forceinline vfloat ( const vfloat4& other ) { v = other.v; }
__forceinline vfloat4& operator=( const vfloat4& other ) { v = other.v; return *this; }
__forceinline vfloat() {}
__forceinline vfloat(const vfloat4& other) { v = other.v; }
__forceinline vfloat4& operator =(const vfloat4& other) { v = other.v; return *this; }
__forceinline vfloat( const __m128 a ) : v(a) {}
__forceinline operator const __m128&( void ) const { return v; }
__forceinline operator __m128&( void ) { return v; }
__forceinline vfloat(__m128 a) : v(a) {}
__forceinline operator const __m128&() const { return v; }
__forceinline operator __m128&() { return v; }
__forceinline vfloat( float a ) : v(_mm_set1_ps(a)) {}
__forceinline vfloat( float a, float b, float c, float d) : v(_mm_set_ps(d, c, b, a)) {}
__forceinline vfloat(float a) : v(_mm_set1_ps(a)) {}
__forceinline vfloat(float a, float b, float c, float d) : v(_mm_set_ps(d, c, b, a)) {}
__forceinline explicit vfloat( const __m128i a ) : v(_mm_cvtepi32_ps(a)) {}
__forceinline explicit vfloat(const vint4& a) : v(_mm_cvtepi32_ps(a)) {}
__forceinline explicit vfloat(const vuint4& x) {
const __m128i a = _mm_and_si128(x,_mm_set1_epi32(0x7FFFFFFF));
const __m128i b = _mm_and_si128(_mm_srai_epi32(x,31),_mm_set1_epi32(0x4F000000)); //0x4F000000 = 2^31
const __m128 af = _mm_cvtepi32_ps(a);
const __m128 bf = _mm_castsi128_ps(b);
v = _mm_add_ps(af,bf);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat( ZeroTy ) : v(_mm_setzero_ps()) {}
__forceinline vfloat( OneTy ) : v(_mm_set1_ps(1.0f)) {}
__forceinline vfloat( PosInfTy ) : v(_mm_set1_ps(pos_inf)) {}
__forceinline vfloat( NegInfTy ) : v(_mm_set1_ps(neg_inf)) {}
__forceinline vfloat( StepTy ) : v(_mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f)) {}
__forceinline vfloat( NaNTy ) : v(_mm_set1_ps(nan)) {}
__forceinline vfloat(ZeroTy) : v(_mm_setzero_ps()) {}
__forceinline vfloat(OneTy) : v(_mm_set1_ps(1.0f)) {}
__forceinline vfloat(PosInfTy) : v(_mm_set1_ps(pos_inf)) {}
__forceinline vfloat(NegInfTy) : v(_mm_set1_ps(neg_inf)) {}
__forceinline vfloat(StepTy) : v(_mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f)) {}
__forceinline vfloat(NaNTy) : v(_mm_set1_ps(nan)) {}
__forceinline vfloat(UndefinedTy) : v(_mm_undefined_ps()) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline vfloat4 load ( const void* const a ) { return _mm_load_ps((float*)a); }
static __forceinline vfloat4 loadu( const void* const a ) { return _mm_loadu_ps((float*)a); }
static __forceinline vfloat4 load (const void* a) { return _mm_load_ps((float*)a); }
static __forceinline vfloat4 loadu(const void* a) { return _mm_loadu_ps((float*)a); }
static __forceinline void store ( void* ptr, const vfloat4& v ) { _mm_store_ps((float*)ptr,v); }
static __forceinline void storeu( void* ptr, const vfloat4& v ) { _mm_storeu_ps((float*)ptr,v); }
static __forceinline void store (void* ptr, const vfloat4& v) { _mm_store_ps((float*)ptr,v); }
static __forceinline void storeu(void* ptr, const vfloat4& v) { _mm_storeu_ps((float*)ptr,v); }
#if defined(__AVX512VL__)
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr) { return _mm_mask_load_ps (_mm_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr) { return _mm_mask_loadu_ps(_mm_setzero_ps(),mask,(float*)ptr); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_store_ps ((float*)ptr,mask,v); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_storeu_ps((float*)ptr,mask,v); }
static __forceinline vfloat4 compact(const vboolf4& mask, vfloat4 &v) {
return _mm_mask_compress_ps(v, mask, v);
}
static __forceinline vfloat4 compact(const vboolf4& mask, vfloat4 &a, const vfloat4& b) {
return _mm_mask_compress_ps(a, mask, b);
}
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_mask_load_ps (_mm_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_mask_loadu_ps(_mm_setzero_ps(),mask,(float*)ptr); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_store_ps ((float*)ptr,mask,v); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_mask_storeu_ps((float*)ptr,mask,v); }
#elif defined(__AVX__)
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_maskload_ps((float*)ptr,mask); }
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_maskload_ps((float*)ptr,mask); }
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_maskload_ps((float*)ptr,mask); }
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_maskload_ps((float*)ptr,mask); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,v); }
#else
static __forceinline vfloat4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_and_ps(_mm_load_ps ((float*)ptr),mask); }
static __forceinline vfloat4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_and_ps(_mm_loadu_ps((float*)ptr),mask); }
static __forceinline vfloat4 load (const vboolf4& mask, const void* ptr) { return _mm_and_ps(_mm_load_ps ((float*)ptr),mask); }
static __forceinline vfloat4 loadu(const vboolf4& mask, const void* ptr) { return _mm_and_ps(_mm_loadu_ps((float*)ptr),mask); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vfloat4& v ) { store (ptr,select(mask,v,load (ptr))); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vfloat4& v ) { storeu(ptr,select(mask,v,loadu(ptr))); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vfloat4& v) { store (ptr,select(mask,v,load (ptr))); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vfloat4& v) { storeu(ptr,select(mask,v,loadu(ptr))); }
#endif
#if defined(__AVX__)
static __forceinline vfloat4 broadcast( const void* const a ) { return _mm_broadcast_ss((float*)a); }
static __forceinline vfloat4 broadcast(const void* a) { return _mm_broadcast_ss((float*)a); }
#else
static __forceinline vfloat4 broadcast( const void* const a ) { return _mm_set1_ps(*(float*)a); }
static __forceinline vfloat4 broadcast(const void* a) { return _mm_set1_ps(*(float*)a); }
#endif
static __forceinline vfloat4 load_nt ( const float* ptr ) {
static __forceinline vfloat4 load_nt (const float* ptr) {
#if defined (__SSE4_1__)
return _mm_castsi128_ps(_mm_stream_load_si128((__m128i*)ptr));
#else
@@ -102,21 +118,41 @@ namespace embree
}
#if defined(__SSE4_1__)
static __forceinline vfloat4 load( const unsigned char* const ptr ) {
static __forceinline vfloat4 load(const char* ptr) {
return _mm_cvtepi32_ps(_mm_cvtepi8_epi32(_mm_loadu_si128((__m128i*)ptr)));
}
#else
static __forceinline vfloat4 load(const char* ptr) {
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
}
#endif
#if defined(__SSE4_1__)
static __forceinline vfloat4 load(const unsigned char* ptr) {
return _mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)));
}
#else
static __forceinline vfloat4 load( const unsigned char* const ptr ) {
static __forceinline vfloat4 load(const unsigned char* ptr) {
//return _mm_cvtpu8_ps(*(__m64*)ptr); // don't enable, will use MMX instructions
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
}
#endif
static __forceinline vfloat4 load(const unsigned short* const ptr) {
return _mm_mul_ps(vfloat4(vint4::load(ptr)),vfloat4(1.0f/65535.0f));
}
#if defined(__SSE4_1__)
static __forceinline vfloat4 load(const short* ptr) {
return _mm_cvtepi32_ps(_mm_cvtepi16_epi32(_mm_loadu_si128((__m128i*)ptr)));
}
#else
static __forceinline vfloat4 load(const short* ptr) {
return vfloat4(ptr[0],ptr[1],ptr[2],ptr[3]);
}
#endif
static __forceinline void store_nt ( void* ptr, const vfloat4& v)
static __forceinline vfloat4 load(const unsigned short* ptr) {
return _mm_mul_ps(vfloat4(vint4::load(ptr)),vfloat4(1.0f/65535.0f));
}
static __forceinline void store_nt(void* ptr, const vfloat4& v)
{
#if defined (__SSE4_1__)
_mm_stream_ps((float*)ptr,v);
@@ -125,16 +161,58 @@ namespace embree
#endif
}
template<int scale>
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& ofs, const vfloat4& v)
template<int scale = 4>
static __forceinline vfloat4 gather(const float* ptr, const vint4& index) {
#if defined(__AVX2__)
return _mm_i32gather_ps(ptr, index, scale);
#else
return vfloat4(
*(float*)(((char*)ptr)+scale*index[0]),
*(float*)(((char*)ptr)+scale*index[1]),
*(float*)(((char*)ptr)+scale*index[2]),
*(float*)(((char*)ptr)+scale*index[3]));
#endif
}
template<int scale = 4>
static __forceinline vfloat4 gather(const vboolf4& mask, const float* ptr, const vint4& index) {
vfloat4 r = zero;
#if defined(__AVX512VL__)
return _mm_mmask_i32gather_ps(r, mask, index, ptr, scale);
#elif defined(__AVX2__)
return _mm_mask_i32gather_ps(r, ptr, index, mask, scale);
#else
if (likely(mask[0])) r[0] = *(float*)(((char*)ptr)+scale*index[0]);
if (likely(mask[1])) r[1] = *(float*)(((char*)ptr)+scale*index[1]);
if (likely(mask[2])) r[2] = *(float*)(((char*)ptr)+scale*index[2]);
if (likely(mask[3])) r[3] = *(float*)(((char*)ptr)+scale*index[3]);
return r;
#endif
}
template<int scale = 4>
static __forceinline void scatter(void* ptr, const vint4& index, const vfloat4& v)
{
#if defined(__AVX512VL__)
_mm_mask_i32scatter_ps((float*)ptr,mask,ofs,v,scale);
_mm_i32scatter_ps((float*)ptr, index, v, scale);
#else
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
if (likely(mask[2])) *(float*)(((char*)ptr)+scale*ofs[2]) = v[2];
if (likely(mask[3])) *(float*)(((char*)ptr)+scale*ofs[3]) = v[3];
*(float*)(((char*)ptr)+scale*index[0]) = v[0];
*(float*)(((char*)ptr)+scale*index[1]) = v[1];
*(float*)(((char*)ptr)+scale*index[2]) = v[2];
*(float*)(((char*)ptr)+scale*index[3]) = v[3];
#endif
}
template<int scale = 4>
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& index, const vfloat4& v)
{
#if defined(__AVX512VL__)
_mm_mask_i32scatter_ps((float*)ptr ,mask, index, v, scale);
#else
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*index[0]) = v[0];
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*index[1]) = v[1];
if (likely(mask[2])) *(float*)(((char*)ptr)+scale*index[2]) = v[2];
if (likely(mask[3])) *(float*)(((char*)ptr)+scale*index[3]) = v[3];
#endif
}
@@ -149,10 +227,10 @@ namespace embree
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline const float& operator []( const size_t index ) const { assert(index < 4); return f[index]; }
__forceinline float& operator []( const size_t index ) { assert(index < 4); return f[index]; }
__forceinline const float& operator [](size_t index) const { assert(index < 4); return f[index]; }
__forceinline float& operator [](size_t index) { assert(index < 4); return f[index]; }
friend __forceinline const vfloat4 select( const vboolf4& m, const vfloat4& t, const vfloat4& f ) {
friend __forceinline vfloat4 select(const vboolf4& m, const vfloat4& t, const vfloat4& f) {
#if defined(__AVX512VL__)
return _mm_mask_blend_ps(m, f, t);
#elif defined(__SSE4_1__)
@@ -168,23 +246,27 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat4 asFloat ( const __m128i& a ) { return _mm_castsi128_ps(a); }
__forceinline const vfloat4 operator +( const vfloat4& a ) { return a; }
__forceinline const vfloat4 operator -( const vfloat4& a ) { return _mm_xor_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
__forceinline const vfloat4 abs ( const vfloat4& a ) { return _mm_and_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); }
__forceinline vfloat4 asFloat(const vint4& a) { return _mm_castsi128_ps(a); }
__forceinline vint4 asInt (const vfloat4& a) { return _mm_castps_si128(a); }
__forceinline vuint4 asUInt (const vfloat4& a) { return _mm_castps_si128(a); }
__forceinline vfloat4 operator +(const vfloat4& a) { return a; }
__forceinline vfloat4 operator -(const vfloat4& a) { return _mm_xor_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
__forceinline vfloat4 abs(const vfloat4& a) { return _mm_and_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); }
#if defined(__AVX512VL__)
__forceinline const vfloat4 sign ( const vfloat4& a ) { return _mm_mask_blend_ps(_mm_cmp_ps_mask(a, vfloat4(zero), _CMP_LT_OQ), vfloat4(one), -vfloat4(one)); }
__forceinline vfloat4 sign(const vfloat4& a) { return _mm_mask_blend_ps(_mm_cmp_ps_mask(a, vfloat4(zero), _CMP_LT_OQ), vfloat4(one), -vfloat4(one)); }
#else
__forceinline const vfloat4 sign ( const vfloat4& a ) { return blendv_ps(vfloat4(one), -vfloat4(one), _mm_cmplt_ps(a, vfloat4(zero))); }
__forceinline vfloat4 sign(const vfloat4& a) { return blendv_ps(vfloat4(one), -vfloat4(one), _mm_cmplt_ps(a, vfloat4(zero))); }
#endif
__forceinline const vfloat4 signmsk ( const vfloat4& a ) { return _mm_and_ps(a.v,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
__forceinline vfloat4 signmsk(const vfloat4& a) { return _mm_and_ps(a,_mm_castsi128_ps(_mm_set1_epi32(0x80000000))); }
__forceinline const vfloat4 rcp ( const vfloat4& a )
__forceinline vfloat4 rcp(const vfloat4& a)
{
#if defined(__AVX512VL__)
const vfloat4 r = _mm_rcp14_ps(a.v);
const vfloat4 r = _mm_rcp14_ps(a);
#else
const vfloat4 r = _mm_rcp_ps(a.v);
const vfloat4 r = _mm_rcp_ps(a);
#endif
#if defined(__AVX2__)
@@ -193,15 +275,15 @@ namespace embree
return _mm_mul_ps(r,_mm_sub_ps(vfloat4(2.0f), _mm_mul_ps(r, a)));
#endif
}
__forceinline const vfloat4 sqr ( const vfloat4& a ) { return _mm_mul_ps(a,a); }
__forceinline const vfloat4 sqrt ( const vfloat4& a ) { return _mm_sqrt_ps(a.v); }
__forceinline vfloat4 sqr (const vfloat4& a) { return _mm_mul_ps(a,a); }
__forceinline vfloat4 sqrt(const vfloat4& a) { return _mm_sqrt_ps(a); }
__forceinline const vfloat4 rsqrt( const vfloat4& a )
__forceinline vfloat4 rsqrt(const vfloat4& a)
{
#if defined(__AVX512VL__)
const vfloat4 r = _mm_rsqrt14_ps(a.v);
const vfloat4 r = _mm_rsqrt14_ps(a);
#else
const vfloat4 r = _mm_rsqrt_ps(a.v);
const vfloat4 r = _mm_rsqrt_ps(a);
#endif
#if defined(__AVX2__)
@@ -213,8 +295,8 @@ namespace embree
#endif
}
__forceinline const vboolf4 isnan( const vfloat4& a ) {
const vfloat4 b = _mm_and_ps(a.v, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)));
__forceinline vboolf4 isnan(const vfloat4& a) {
const vfloat4 b = _mm_and_ps(a, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)));
#if defined(__AVX512VL__)
return _mm_cmp_epi32_mask(_mm_castps_si128(b), _mm_set1_epi32(0x7f800000), _MM_CMPINT_GT);
#else
@@ -226,32 +308,32 @@ namespace embree
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat4 operator +( const vfloat4& a, const vfloat4& b ) { return _mm_add_ps(a.v, b.v); }
__forceinline const vfloat4 operator +( const vfloat4& a, const float& b ) { return a + vfloat4(b); }
__forceinline const vfloat4 operator +( const float& a, const vfloat4& b ) { return vfloat4(a) + b; }
__forceinline vfloat4 operator +(const vfloat4& a, const vfloat4& b) { return _mm_add_ps(a, b); }
__forceinline vfloat4 operator +(const vfloat4& a, float b) { return a + vfloat4(b); }
__forceinline vfloat4 operator +(float a, const vfloat4& b) { return vfloat4(a) + b; }
__forceinline const vfloat4 operator -( const vfloat4& a, const vfloat4& b ) { return _mm_sub_ps(a.v, b.v); }
__forceinline const vfloat4 operator -( const vfloat4& a, const float& b ) { return a - vfloat4(b); }
__forceinline const vfloat4 operator -( const float& a, const vfloat4& b ) { return vfloat4(a) - b; }
__forceinline vfloat4 operator -(const vfloat4& a, const vfloat4& b) { return _mm_sub_ps(a, b); }
__forceinline vfloat4 operator -(const vfloat4& a, float b) { return a - vfloat4(b); }
__forceinline vfloat4 operator -(float a, const vfloat4& b) { return vfloat4(a) - b; }
__forceinline const vfloat4 operator *( const vfloat4& a, const vfloat4& b ) { return _mm_mul_ps(a.v, b.v); }
__forceinline const vfloat4 operator *( const vfloat4& a, const float& b ) { return a * vfloat4(b); }
__forceinline const vfloat4 operator *( const float& a, const vfloat4& b ) { return vfloat4(a) * b; }
__forceinline vfloat4 operator *(const vfloat4& a, const vfloat4& b) { return _mm_mul_ps(a, b); }
__forceinline vfloat4 operator *(const vfloat4& a, float b) { return a * vfloat4(b); }
__forceinline vfloat4 operator *(float a, const vfloat4& b) { return vfloat4(a) * b; }
__forceinline const vfloat4 operator /( const vfloat4& a, const vfloat4& b ) { return _mm_div_ps(a.v,b.v); }
__forceinline const vfloat4 operator /( const vfloat4& a, const float& b ) { return a/vfloat4(b); }
__forceinline const vfloat4 operator /( const float& a, const vfloat4& b ) { return vfloat4(a)/b; }
__forceinline vfloat4 operator /(const vfloat4& a, const vfloat4& b) { return _mm_div_ps(a,b); }
__forceinline vfloat4 operator /(const vfloat4& a, float b) { return a/vfloat4(b); }
__forceinline vfloat4 operator /(float a, const vfloat4& b) { return vfloat4(a)/b; }
__forceinline const vfloat4 operator^( const vfloat4& a, const vfloat4& b ) { return _mm_xor_ps(a.v,b.v); }
__forceinline const vfloat4 operator^( const vfloat4& a, const vint4& b ) { return _mm_xor_ps(a.v,_mm_castsi128_ps(b.v)); }
__forceinline vfloat4 operator ^(const vfloat4& a, const vfloat4& b) { return _mm_xor_ps(a,b); }
__forceinline vfloat4 operator ^(const vfloat4& a, const vint4& b) { return _mm_xor_ps(a,_mm_castsi128_ps(b)); }
__forceinline const vfloat4 min( const vfloat4& a, const vfloat4& b ) { return _mm_min_ps(a.v,b.v); }
__forceinline const vfloat4 min( const vfloat4& a, const float& b ) { return _mm_min_ps(a.v,vfloat4(b)); }
__forceinline const vfloat4 min( const float& a, const vfloat4& b ) { return _mm_min_ps(vfloat4(a),b.v); }
__forceinline vfloat4 min(const vfloat4& a, const vfloat4& b) { return _mm_min_ps(a,b); }
__forceinline vfloat4 min(const vfloat4& a, float b) { return _mm_min_ps(a,vfloat4(b)); }
__forceinline vfloat4 min(float a, const vfloat4& b) { return _mm_min_ps(vfloat4(a),b); }
__forceinline const vfloat4 max( const vfloat4& a, const vfloat4& b ) { return _mm_max_ps(a.v,b.v); }
__forceinline const vfloat4 max( const vfloat4& a, const float& b ) { return _mm_max_ps(a.v,vfloat4(b)); }
__forceinline const vfloat4 max( const float& a, const vfloat4& b ) { return _mm_max_ps(vfloat4(a),b.v); }
__forceinline vfloat4 max(const vfloat4& a, const vfloat4& b) { return _mm_max_ps(a,b); }
__forceinline vfloat4 max(const vfloat4& a, float b) { return _mm_max_ps(a,vfloat4(b)); }
__forceinline vfloat4 max(float a, const vfloat4& b) { return _mm_max_ps(vfloat4(a),b); }
#if defined(__SSE4_1__)
__forceinline vfloat4 mini(const vfloat4& a, const vfloat4& b) {
@@ -260,6 +342,7 @@ namespace embree
const vint4 ci = _mm_min_epi32(ai,bi);
return _mm_castsi128_ps(ci);
}
__forceinline vfloat4 maxi(const vfloat4& a, const vfloat4& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
@@ -273,17 +356,18 @@ namespace embree
const vint4 ci = _mm_min_epu32(ai,bi);
return _mm_castsi128_ps(ci);
}
__forceinline vfloat4 maxui(const vfloat4& a, const vfloat4& b) {
const vint4 ai = _mm_castps_si128(a);
const vint4 bi = _mm_castps_si128(b);
const vint4 ci = _mm_max_epu32(ai,bi);
return _mm_castsi128_ps(ci);
}
#else
__forceinline vfloat4 mini(const vfloat4& a, const vfloat4& b) {
return min(a,b);
}
__forceinline vfloat4 maxi(const vfloat4& a, const vfloat4& b) {
return max(a,b);
}
@@ -294,70 +378,70 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX2__)
__forceinline const vfloat4 madd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmadd_ps(a,b,c); }
__forceinline const vfloat4 msub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmsub_ps(a,b,c); }
__forceinline const vfloat4 nmadd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmadd_ps(a,b,c); }
__forceinline const vfloat4 nmsub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmsub_ps(a,b,c); }
__forceinline vfloat4 madd (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmadd_ps(a,b,c); }
__forceinline vfloat4 msub (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fmsub_ps(a,b,c); }
__forceinline vfloat4 nmadd(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmadd_ps(a,b,c); }
__forceinline vfloat4 nmsub(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return _mm_fnmsub_ps(a,b,c); }
#else
__forceinline const vfloat4 madd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b+c; }
__forceinline const vfloat4 msub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b-c; }
__forceinline const vfloat4 nmadd ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b+c;}
__forceinline const vfloat4 nmsub ( const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b-c; }
__forceinline vfloat4 madd (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b+c; }
__forceinline vfloat4 msub (const vfloat4& a, const vfloat4& b, const vfloat4& c) { return a*b-c; }
__forceinline vfloat4 nmadd(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b+c;}
__forceinline vfloat4 nmsub(const vfloat4& a, const vfloat4& b, const vfloat4& c) { return -a*b-c; }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat4& operator +=( vfloat4& a, const vfloat4& b ) { return a = a + b; }
__forceinline vfloat4& operator +=( vfloat4& a, const float& b ) { return a = a + b; }
__forceinline vfloat4& operator +=(vfloat4& a, const vfloat4& b) { return a = a + b; }
__forceinline vfloat4& operator +=(vfloat4& a, float b) { return a = a + b; }
__forceinline vfloat4& operator -=( vfloat4& a, const vfloat4& b ) { return a = a - b; }
__forceinline vfloat4& operator -=( vfloat4& a, const float& b ) { return a = a - b; }
__forceinline vfloat4& operator -=(vfloat4& a, const vfloat4& b) { return a = a - b; }
__forceinline vfloat4& operator -=(vfloat4& a, float b) { return a = a - b; }
__forceinline vfloat4& operator *=( vfloat4& a, const vfloat4& b ) { return a = a * b; }
__forceinline vfloat4& operator *=( vfloat4& a, const float& b ) { return a = a * b; }
__forceinline vfloat4& operator *=(vfloat4& a, const vfloat4& b) { return a = a * b; }
__forceinline vfloat4& operator *=(vfloat4& a, float b) { return a = a * b; }
__forceinline vfloat4& operator /=( vfloat4& a, const vfloat4& b ) { return a = a / b; }
__forceinline vfloat4& operator /=( vfloat4& a, const float& b ) { return a = a / b; }
__forceinline vfloat4& operator /=(vfloat4& a, const vfloat4& b) { return a = a / b; }
__forceinline vfloat4& operator /=(vfloat4& a, float b) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX512VL__)
__forceinline const vboolf4 operator ==( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
__forceinline const vboolf4 operator !=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
__forceinline const vboolf4 operator < ( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
__forceinline const vboolf4 operator >=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
__forceinline const vboolf4 operator > ( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
__forceinline const vboolf4 operator <=( const vfloat4& a, const vfloat4& b ) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
__forceinline vboolf4 operator ==(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
__forceinline vboolf4 operator !=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
__forceinline vboolf4 operator < (const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
__forceinline vboolf4 operator >=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
__forceinline vboolf4 operator > (const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
__forceinline vboolf4 operator <=(const vfloat4& a, const vfloat4& b) { return _mm_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
#else
__forceinline const vboolf4 operator ==( const vfloat4& a, const vfloat4& b ) { return _mm_cmpeq_ps (a, b); }
__forceinline const vboolf4 operator !=( const vfloat4& a, const vfloat4& b ) { return _mm_cmpneq_ps(a, b); }
__forceinline const vboolf4 operator < ( const vfloat4& a, const vfloat4& b ) { return _mm_cmplt_ps (a, b); }
__forceinline const vboolf4 operator >=( const vfloat4& a, const vfloat4& b ) { return _mm_cmpnlt_ps(a, b); }
__forceinline const vboolf4 operator > ( const vfloat4& a, const vfloat4& b ) { return _mm_cmpnle_ps(a, b); }
__forceinline const vboolf4 operator <=( const vfloat4& a, const vfloat4& b ) { return _mm_cmple_ps (a, b); }
__forceinline vboolf4 operator ==(const vfloat4& a, const vfloat4& b) { return _mm_cmpeq_ps (a, b); }
__forceinline vboolf4 operator !=(const vfloat4& a, const vfloat4& b) { return _mm_cmpneq_ps(a, b); }
__forceinline vboolf4 operator < (const vfloat4& a, const vfloat4& b) { return _mm_cmplt_ps (a, b); }
__forceinline vboolf4 operator >=(const vfloat4& a, const vfloat4& b) { return _mm_cmpnlt_ps(a, b); }
__forceinline vboolf4 operator > (const vfloat4& a, const vfloat4& b) { return _mm_cmpnle_ps(a, b); }
__forceinline vboolf4 operator <=(const vfloat4& a, const vfloat4& b) { return _mm_cmple_ps (a, b); }
#endif
__forceinline const vboolf4 operator ==( const vfloat4& a, const float& b ) { return a == vfloat4(b); }
__forceinline const vboolf4 operator ==( const float& a, const vfloat4& b ) { return vfloat4(a) == b; }
__forceinline vboolf4 operator ==(const vfloat4& a, float b) { return a == vfloat4(b); }
__forceinline vboolf4 operator ==(float a, const vfloat4& b) { return vfloat4(a) == b; }
__forceinline const vboolf4 operator !=( const vfloat4& a, const float& b ) { return a != vfloat4(b); }
__forceinline const vboolf4 operator !=( const float& a, const vfloat4& b ) { return vfloat4(a) != b; }
__forceinline vboolf4 operator !=(const vfloat4& a, float b) { return a != vfloat4(b); }
__forceinline vboolf4 operator !=(float a, const vfloat4& b) { return vfloat4(a) != b; }
__forceinline const vboolf4 operator < ( const vfloat4& a, const float& b ) { return a < vfloat4(b); }
__forceinline const vboolf4 operator < ( const float& a, const vfloat4& b ) { return vfloat4(a) < b; }
__forceinline vboolf4 operator < (const vfloat4& a, float b) { return a < vfloat4(b); }
__forceinline vboolf4 operator < (float a, const vfloat4& b) { return vfloat4(a) < b; }
__forceinline const vboolf4 operator >=( const vfloat4& a, const float& b ) { return a >= vfloat4(b); }
__forceinline const vboolf4 operator >=( const float& a, const vfloat4& b ) { return vfloat4(a) >= b; }
__forceinline vboolf4 operator >=(const vfloat4& a, float b) { return a >= vfloat4(b); }
__forceinline vboolf4 operator >=(float a, const vfloat4& b) { return vfloat4(a) >= b; }
__forceinline const vboolf4 operator > ( const vfloat4& a, const float& b ) { return a > vfloat4(b); }
__forceinline const vboolf4 operator > ( const float& a, const vfloat4& b ) { return vfloat4(a) > b; }
__forceinline vboolf4 operator > (const vfloat4& a, float b) { return a > vfloat4(b); }
__forceinline vboolf4 operator > (float a, const vfloat4& b) { return vfloat4(a) > b; }
__forceinline const vboolf4 operator <=( const vfloat4& a, const float& b ) { return a <= vfloat4(b); }
__forceinline const vboolf4 operator <=( const float& a, const vfloat4& b ) { return vfloat4(a) <= b; }
__forceinline vboolf4 operator <=(const vfloat4& a, float b) { return a <= vfloat4(b); }
__forceinline vboolf4 operator <=(float a, const vfloat4& b) { return vfloat4(a) <= b; }
__forceinline vboolf4 eq(const vfloat4& a, const vfloat4& b) { return a == b; }
__forceinline vboolf4 ne(const vfloat4& a, const vfloat4& b) { return a != b; }
@@ -383,7 +467,7 @@ namespace embree
#endif
template<int mask>
__forceinline const vfloat4 select(const vfloat4& t, const vfloat4& f)
__forceinline vfloat4 select(const vfloat4& t, const vfloat4& f)
{
#if defined(__SSE4_1__)
return _mm_blend_ps(f, t, mask);
@@ -396,15 +480,15 @@ namespace embree
return madd(t,b-a,a);
}
__forceinline bool isvalid ( const vfloat4& v ) {
__forceinline bool isvalid(const vfloat4& v) {
return all((v > vfloat4(-FLT_LARGE)) & (v < vfloat4(+FLT_LARGE)));
}
__forceinline bool is_finite ( const vfloat4& a ) {
__forceinline bool is_finite(const vfloat4& a) {
return all((a >= vfloat4(-FLT_MAX)) & (a <= vfloat4(+FLT_MAX)));
}
__forceinline bool is_finite ( const vboolf4& valid, const vfloat4& a ) {
__forceinline bool is_finite(const vboolf4& valid, const vfloat4& a) {
return all(valid, (a >= vfloat4(-FLT_MAX)) & (a <= vfloat4(+FLT_MAX)));
}
@@ -413,17 +497,17 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined (__SSE4_1__)
__forceinline const vfloat4 floor ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline const vfloat4 ceil ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
__forceinline const vfloat4 trunc ( const vfloat4& a ) { return _mm_round_ps(a, _MM_FROUND_TO_ZERO ); }
__forceinline vfloat4 floor(const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline vfloat4 ceil (const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_POS_INF ); }
__forceinline vfloat4 trunc(const vfloat4& a) { return _mm_round_ps(a, _MM_FROUND_TO_ZERO ); }
#else
__forceinline const vfloat4 floor ( const vfloat4& a ) { return vfloat4(floorf(a[0]),floorf(a[1]),floorf(a[2]),floorf(a[3])); }
__forceinline const vfloat4 ceil ( const vfloat4& a ) { return vfloat4(ceilf (a[0]),ceilf (a[1]),ceilf (a[2]),ceilf (a[3])); }
//__forceinline const vfloat4 trunc ( const vfloat4& a ) { return vfloat4(truncf(a[0]),truncf(a[1]),truncf(a[2]),truncf(a[3])); }
__forceinline vfloat4 floor(const vfloat4& a) { return vfloat4(floorf(a[0]),floorf(a[1]),floorf(a[2]),floorf(a[3])); }
__forceinline vfloat4 ceil (const vfloat4& a) { return vfloat4(ceilf (a[0]),ceilf (a[1]),ceilf (a[2]),ceilf (a[3])); }
//__forceinline vfloat4 trunc(const vfloat4& a) { return vfloat4(truncf(a[0]),truncf(a[1]),truncf(a[2]),truncf(a[3])); }
#endif
__forceinline const vfloat4 frac ( const vfloat4& a ) { return a-floor(a); }
__forceinline vfloat4 frac(const vfloat4& a) { return a-floor(a); }
__forceinline vint4 floori (const vfloat4& a) {
__forceinline vint4 floori(const vfloat4& a) {
#if defined(__SSE4_1__)
return vint4(floor(a));
#else
@@ -435,56 +519,59 @@ namespace embree
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat4 unpacklo( const vfloat4& a, const vfloat4& b ) { return _mm_unpacklo_ps(a.v, b.v); }
__forceinline vfloat4 unpackhi( const vfloat4& a, const vfloat4& b ) { return _mm_unpackhi_ps(a.v, b.v); }
__forceinline vfloat4 unpacklo(const vfloat4& a, const vfloat4& b) { return _mm_unpacklo_ps(a, b); }
__forceinline vfloat4 unpackhi(const vfloat4& a, const vfloat4& b) { return _mm_unpackhi_ps(a, b); }
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat4 shuffle( const vfloat4& b ) {
return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(i3, i2, i1, i0)));
template<int i0, int i1, int i2, int i3>
__forceinline vfloat4 shuffle(const vfloat4& v) {
return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v), _MM_SHUFFLE(i3, i2, i1, i0)));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat4 shuffle( const vfloat4& a, const vfloat4& b ) {
template<int i0, int i1, int i2, int i3>
__forceinline vfloat4 shuffle(const vfloat4& a, const vfloat4& b) {
return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
}
#if defined (__SSSE3__)
__forceinline const vfloat4 shuffle8(const vfloat4& a, const vint4& shuf) {
__forceinline vfloat4 shuffle8(const vfloat4& a, const vint4& shuf) {
return _mm_castsi128_ps(_mm_shuffle_epi8(_mm_castps_si128(a), shuf));
}
#endif
#if defined(__SSE3__)
template<> __forceinline const vfloat4 shuffle<0, 0, 2, 2>( const vfloat4& b ) { return _mm_moveldup_ps(b); }
template<> __forceinline const vfloat4 shuffle<1, 1, 3, 3>( const vfloat4& b ) { return _mm_movehdup_ps(b); }
template<> __forceinline const vfloat4 shuffle<0, 1, 0, 1>( const vfloat4& b ) { return _mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b))); }
template<> __forceinline vfloat4 shuffle<0, 0, 2, 2>(const vfloat4& v) { return _mm_moveldup_ps(v); }
template<> __forceinline vfloat4 shuffle<1, 1, 3, 3>(const vfloat4& v) { return _mm_movehdup_ps(v); }
template<> __forceinline vfloat4 shuffle<0, 1, 0, 1>(const vfloat4& v) { return _mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(v))); }
#endif
template<size_t i0> __forceinline const vfloat4 shuffle( const vfloat4& b ) {
return shuffle<i0,i0,i0,i0>(b);
template<int i>
__forceinline vfloat4 shuffle(const vfloat4& v) {
return shuffle<i,i,i,i>(v);
}
#if defined (__SSE4_1__) && !defined(__GNUC__)
template<size_t i> __forceinline float extract ( const vfloat4& a ) { return _mm_cvtss_f32(_mm_extract_ps(a,i)); }
template<int i> __forceinline float extract(const vfloat4& a) { return _mm_cvtss_f32(_mm_extract_ps(a,i)); }
#else
template<size_t i> __forceinline float extract ( const vfloat4& a ) { return _mm_cvtss_f32(shuffle<i,i,i,i>(a)); }
template<int i> __forceinline float extract(const vfloat4& a) { return _mm_cvtss_f32(shuffle<i,i,i,i>(a)); }
#endif
template<> __forceinline float extract<0>( const vfloat4& a ) { return _mm_cvtss_f32(a); }
template<> __forceinline float extract<0>(const vfloat4& a) { return _mm_cvtss_f32(a); }
#if defined (__SSE4_1__)
template<size_t dst, size_t src, size_t clr> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
template<size_t dst, size_t src> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { return insert<dst, src, 0>(a, b); }
template<size_t dst> __forceinline const vfloat4 insert( const vfloat4& a, const float b ) { return insert<dst, 0>(a, _mm_set_ss(b)); }
template<int dst, int src, int clr> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); }
template<int dst, int src> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { return insert<dst, src, 0>(a, b); }
template<int dst> __forceinline vfloat4 insert(const vfloat4& a, const float b) { return insert<dst, 0>(a, _mm_set_ss(b)); }
#else
template<size_t dst, size_t src> __forceinline const vfloat4 insert( const vfloat4& a, const vfloat4& b ) { vfloat4 c = a; c[dst] = b[src]; return c; }
template<size_t dst> __forceinline const vfloat4 insert( const vfloat4& a, const float b ) { vfloat4 c = a; c[dst] = b; return c; }
template<int dst, int src> __forceinline vfloat4 insert(const vfloat4& a, const vfloat4& b) { vfloat4 c = a; c[dst&3] = b[src&3]; return c; }
template<int dst> __forceinline vfloat4 insert(const vfloat4& a, float b) { vfloat4 c = a; c[dst&3] = b; return c; }
#endif
__forceinline float toScalar(const vfloat4& a) { return _mm_cvtss_f32(a); }
__forceinline float toScalar(const vfloat4& v) { return _mm_cvtss_f32(v); }
__forceinline vfloat4 broadcast4f( const vfloat4& a, const size_t k ) {
__forceinline vfloat4 broadcast4f(const vfloat4& a, size_t k) {
return vfloat4::broadcast(&a[k]);
}
__forceinline vfloat4 shift_right_1( const vfloat4& x) {
__forceinline vfloat4 shift_right_1(const vfloat4& x) {
return _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(x), 4));
}
@@ -493,10 +580,18 @@ namespace embree
return _mm_permutevar_ps(a,index);
}
__forceinline vfloat4 broadcast1f( const void* const a ) { return _mm_broadcast_ss((float*)a); }
__forceinline vfloat4 broadcast1f(const void* a) { return _mm_broadcast_ss((float*)a); }
#endif
#if defined(__AVX512VL__)
template<int i>
__forceinline vfloat4 align_shift_right(const vfloat4& a, const vfloat4& b) {
return _mm_castsi128_ps(_mm_alignr_epi32(_mm_castps_si128(a), _mm_castps_si128(b), i));
}
#endif
////////////////////////////////////////////////////////////////////////////////
/// Sorting Network
////////////////////////////////////////////////////////////////////////////////
@@ -568,9 +663,9 @@ namespace embree
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat4 vreduce_min(const vfloat4& v) { vfloat4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
__forceinline const vfloat4 vreduce_max(const vfloat4& v) { vfloat4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
__forceinline const vfloat4 vreduce_add(const vfloat4& v) { vfloat4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
__forceinline vfloat4 vreduce_min(const vfloat4& v) { vfloat4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
__forceinline vfloat4 vreduce_max(const vfloat4& v) { vfloat4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
__forceinline vfloat4 vreduce_add(const vfloat4& v) { vfloat4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
__forceinline float reduce_min(const vfloat4& v) { return _mm_cvtss_f32(vreduce_min(v)); }
__forceinline float reduce_max(const vfloat4& v) { return _mm_cvtss_f32(vreduce_max(v)); }
@@ -580,24 +675,24 @@ namespace embree
{
const vfloat4 a = select(valid,v,vfloat4(pos_inf));
const vbool4 valid_min = valid & (a == vreduce_min(a));
return __bsf(movemask(any(valid_min) ? valid_min : valid));
return bsf(movemask(any(valid_min) ? valid_min : valid));
}
__forceinline size_t select_max(const vboolf4& valid, const vfloat4& v)
{
const vfloat4 a = select(valid,v,vfloat4(neg_inf));
const vbool4 valid_max = valid & (a == vreduce_max(a));
return __bsf(movemask(any(valid_max) ? valid_max : valid));
return bsf(movemask(any(valid_max) ? valid_max : valid));
}
////////////////////////////////////////////////////////////////////////////////
/// Euclidian Space Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline float dot ( const vfloat4& a, const vfloat4& b ) {
__forceinline float dot(const vfloat4& a, const vfloat4& b) {
return reduce_add(a*b);
}
__forceinline vfloat4 cross ( const vfloat4& a, const vfloat4& b )
__forceinline vfloat4 cross(const vfloat4& a, const vfloat4& b)
{
const vfloat4 a0 = a;
const vfloat4 b0 = shuffle<1,2,0,3>(b);
@@ -610,7 +705,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vfloat4& a) {
inline std::ostream& operator <<(std::ostream& cout, const vfloat4& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
}
+320 -219
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -33,45 +33,46 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat ( ) {}
__forceinline vfloat ( const vfloat8& other ) { v = other.v; }
__forceinline vfloat8& operator=( const vfloat8& other ) { v = other.v; return *this; }
__forceinline vfloat() {}
__forceinline vfloat(const vfloat8& other) { v = other.v; }
__forceinline vfloat8& operator =(const vfloat8& other) { v = other.v; return *this; }
__forceinline vfloat( const __m256 a ) : v(a) {}
__forceinline operator const __m256&( void ) const { return v; }
__forceinline operator __m256&( void ) { return v; }
__forceinline vfloat(__m256 a) : v(a) {}
__forceinline operator const __m256&() const { return v; }
__forceinline operator __m256&() { return v; }
__forceinline explicit vfloat( const vfloat4& a ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
__forceinline vfloat( const vfloat4& a, const vfloat4& b ) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
__forceinline explicit vfloat(const vfloat4& a) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),a,1)) {}
__forceinline vfloat(const vfloat4& a, const vfloat4& b) : v(_mm256_insertf128_ps(_mm256_castps128_ps256(a),b,1)) {}
__forceinline explicit vfloat( const char* const a ) : v(_mm256_loadu_ps((const float*)a)) {}
__forceinline vfloat( const float& a ) : v(_mm256_broadcast_ss(&a)) {}
__forceinline vfloat( float a, float b) : v(_mm256_set_ps(b, a, b, a, b, a, b, a)) {}
__forceinline vfloat( float a, float b, float c, float d ) : v(_mm256_set_ps(d, c, b, a, d, c, b, a)) {}
__forceinline vfloat( float a, float b, float c, float d, float e, float f, float g, float h ) : v(_mm256_set_ps(h, g, f, e, d, c, b, a)) {}
__forceinline explicit vfloat(const char* a) : v(_mm256_loadu_ps((const float*)a)) {}
__forceinline vfloat(float a) : v(_mm256_set1_ps(a)) {}
__forceinline vfloat(float a, float b) : v(_mm256_set_ps(b, a, b, a, b, a, b, a)) {}
__forceinline vfloat(float a, float b, float c, float d) : v(_mm256_set_ps(d, c, b, a, d, c, b, a)) {}
__forceinline vfloat(float a, float b, float c, float d, float e, float f, float g, float h) : v(_mm256_set_ps(h, g, f, e, d, c, b, a)) {}
__forceinline explicit vfloat( const __m256i a ) : v(_mm256_cvtepi32_ps(a)) {}
__forceinline explicit vfloat(__m256i a) : v(_mm256_cvtepi32_ps(a)) {}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat( ZeroTy ) : v(_mm256_setzero_ps()) {}
__forceinline vfloat( OneTy ) : v(_mm256_set1_ps(1.0f)) {}
__forceinline vfloat( PosInfTy ) : v(_mm256_set1_ps(pos_inf)) {}
__forceinline vfloat( NegInfTy ) : v(_mm256_set1_ps(neg_inf)) {}
__forceinline vfloat( StepTy ) : v(_mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f)) {}
__forceinline vfloat( NaNTy ) : v(_mm256_set1_ps(nan)) {}
__forceinline vfloat(ZeroTy) : v(_mm256_setzero_ps()) {}
__forceinline vfloat(OneTy) : v(_mm256_set1_ps(1.0f)) {}
__forceinline vfloat(PosInfTy) : v(_mm256_set1_ps(pos_inf)) {}
__forceinline vfloat(NegInfTy) : v(_mm256_set1_ps(neg_inf)) {}
__forceinline vfloat(StepTy) : v(_mm256_set_ps(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f)) {}
__forceinline vfloat(NaNTy) : v(_mm256_set1_ps(nan)) {}
__forceinline vfloat(UndefinedTy) : v(_mm256_undefined_ps()) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline vfloat8 broadcast( const void* const a ) {
static __forceinline vfloat8 broadcast(const void* a) {
return _mm256_broadcast_ss((float*)a);
}
static __forceinline vfloat8 broadcast2( const float* const a, const float* const b ) {
static __forceinline vfloat8 broadcast2(const float* a, const float* b) {
#if defined(__INTEL_COMPILER)
const vfloat8 v0 = _mm256_broadcast_ss(a);
const vfloat8 v1 = _mm256_broadcast_ss(b);
@@ -81,36 +82,60 @@ namespace embree
#endif
}
static __forceinline const vfloat8 broadcast4f(const vfloat4* ptr) {
static __forceinline vfloat8 broadcast4f(const vfloat4* ptr) {
return _mm256_broadcast_ps((__m128*)ptr);
}
static __forceinline vfloat8 load( const unsigned char* const ptr ) {
static __forceinline vfloat8 load(const char* ptr) {
#if defined(__AVX2__)
return _mm256_cvtepi32_ps(_mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)ptr)));
#else
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
#endif
}
static __forceinline vfloat8 load(const unsigned char* ptr) {
#if defined(__AVX2__)
return _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)));
#else
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
#endif
}
static __forceinline vfloat8 load ( const void* const ptr) { return _mm256_load_ps((float*)ptr); }
static __forceinline vfloat8 loadu( const void* const ptr) { return _mm256_loadu_ps((float*)ptr); }
static __forceinline void store ( void* ptr, const vfloat8& v) { return _mm256_store_ps((float*)ptr,v); }
static __forceinline void storeu( void* ptr, const vfloat8& v) { return _mm256_storeu_ps((float*)ptr,v); }
static __forceinline vfloat8 load(const short* ptr) {
#if defined(__AVX2__)
return _mm256_cvtepi32_ps(_mm256_cvtepi16_epi32(_mm_loadu_si128((__m128i*)ptr)));
#else
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
#endif
}
static __forceinline vfloat8 load (const void* ptr) { return _mm256_load_ps((float*)ptr); }
static __forceinline vfloat8 loadu(const void* ptr) { return _mm256_loadu_ps((float*)ptr); }
static __forceinline void store (void* ptr, const vfloat8& v) { return _mm256_store_ps((float*)ptr,v); }
static __forceinline void storeu(void* ptr, const vfloat8& v) { return _mm256_storeu_ps((float*)ptr,v); }
#if defined(__AVX512VL__)
static __forceinline vfloat8 load ( const vboolf8& mask, const void* const ptr) { return _mm256_mask_load_ps (_mm256_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat8 loadu( const vboolf8& mask, const void* const ptr) { return _mm256_mask_loadu_ps(_mm256_setzero_ps(),mask,(float*)ptr); }
static __forceinline void store ( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_store_ps ((float*)ptr,mask,v); }
static __forceinline void storeu( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_storeu_ps((float*)ptr,mask,v); }
static __forceinline vfloat8 compact(const vboolf8& mask, vfloat8 &v) {
return _mm256_mask_compress_ps(v, mask, v);
}
static __forceinline vfloat8 compact(const vboolf8& mask, vfloat8 &a, const vfloat8& b) {
return _mm256_mask_compress_ps(a, mask, b);
}
static __forceinline vfloat8 load (const vboolf8& mask, const void* ptr) { return _mm256_mask_load_ps (_mm256_setzero_ps(),mask,(float*)ptr); }
static __forceinline vfloat8 loadu(const vboolf8& mask, const void* ptr) { return _mm256_mask_loadu_ps(_mm256_setzero_ps(),mask,(float*)ptr); }
static __forceinline void store (const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_store_ps ((float*)ptr,mask,v); }
static __forceinline void storeu(const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_mask_storeu_ps((float*)ptr,mask,v); }
#else
static __forceinline vfloat8 load ( const vboolf8& mask, const void* const ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
static __forceinline vfloat8 loadu( const vboolf8& mask, const void* const ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
static __forceinline vfloat8 load (const vboolf8& mask, const void* ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
static __forceinline vfloat8 loadu(const vboolf8& mask, const void* ptr) { return _mm256_maskload_ps((float*)ptr,(__m256i)mask); }
static __forceinline void store ( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
static __forceinline void storeu( const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
static __forceinline void store (const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
static __forceinline void storeu(const vboolf8& mask, void* ptr, const vfloat8& v) { _mm256_maskstore_ps((float*)ptr,(__m256i)mask,v); }
#endif
#if defined(__AVX2__)
@@ -123,11 +148,65 @@ namespace embree
_mm256_stream_ps((float*)ptr,v);
}
template<int scale>
static __forceinline void scatter(const vboolf8& mask, void* ptr, const vint8& ofs, const vfloat8& v)
template<int scale = 4>
static __forceinline vfloat8 gather(const float* ptr, const vint8& index) {
#if defined(__AVX2__)
return _mm256_i32gather_ps(ptr, index ,scale);
#else
return vfloat8(
*(float*)(((char*)ptr)+scale*index[0]),
*(float*)(((char*)ptr)+scale*index[1]),
*(float*)(((char*)ptr)+scale*index[2]),
*(float*)(((char*)ptr)+scale*index[3]),
*(float*)(((char*)ptr)+scale*index[4]),
*(float*)(((char*)ptr)+scale*index[5]),
*(float*)(((char*)ptr)+scale*index[6]),
*(float*)(((char*)ptr)+scale*index[7]));
#endif
}
template<int scale = 4>
static __forceinline vfloat8 gather(const vboolf8& mask, const float* ptr, const vint8& index) {
vfloat8 r = zero;
#if defined(__AVX512VL__)
return _mm256_mmask_i32gather_ps(r, mask, index, ptr, scale);
#elif defined(__AVX2__)
return _mm256_mask_i32gather_ps(r, ptr, index, mask, scale);
#else
if (likely(mask[0])) r[0] = *(float*)(((char*)ptr)+scale*index[0]);
if (likely(mask[1])) r[1] = *(float*)(((char*)ptr)+scale*index[1]);
if (likely(mask[2])) r[2] = *(float*)(((char*)ptr)+scale*index[2]);
if (likely(mask[3])) r[3] = *(float*)(((char*)ptr)+scale*index[3]);
if (likely(mask[4])) r[4] = *(float*)(((char*)ptr)+scale*index[4]);
if (likely(mask[5])) r[5] = *(float*)(((char*)ptr)+scale*index[5]);
if (likely(mask[6])) r[6] = *(float*)(((char*)ptr)+scale*index[6]);
if (likely(mask[7])) r[7] = *(float*)(((char*)ptr)+scale*index[7]);
return r;
#endif
}
template<int scale = 4>
static __forceinline void scatter(void* ptr, const vint8& ofs, const vfloat8& v)
{
#if defined(__AVX512VL__)
_mm256_mask_i32scatter_ps((float*)ptr,mask,ofs,v,scale);
_mm256_i32scatter_ps((float*)ptr, ofs, v, scale);
#else
*(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
*(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
*(float*)(((char*)ptr)+scale*ofs[2]) = v[2];
*(float*)(((char*)ptr)+scale*ofs[3]) = v[3];
*(float*)(((char*)ptr)+scale*ofs[4]) = v[4];
*(float*)(((char*)ptr)+scale*ofs[5]) = v[5];
*(float*)(((char*)ptr)+scale*ofs[6]) = v[6];
*(float*)(((char*)ptr)+scale*ofs[7]) = v[7];
#endif
}
template<int scale = 4>
static __forceinline void scatter(const vboolf8& mask, void* ptr, const vint8& ofs, const vfloat8& v)
{
#if defined(__AVX512VL__)
_mm256_mask_i32scatter_ps((float*)ptr, mask, ofs, v, scale);
#else
if (likely(mask[0])) *(float*)(((char*)ptr)+scale*ofs[0]) = v[0];
if (likely(mask[1])) *(float*)(((char*)ptr)+scale*ofs[1]) = v[1];
@@ -151,8 +230,8 @@ namespace embree
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline const float& operator []( const size_t index ) const { assert(index < 8); return f[index]; }
__forceinline float& operator []( const size_t index ) { assert(index < 8); return f[index]; }
__forceinline const float& operator [](size_t index) const { assert(index < 8); return f[index]; }
__forceinline float& operator [](size_t index) { assert(index < 8); return f[index]; }
};
@@ -160,44 +239,49 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat8 asFloat ( const vint8& a ) { return _mm256_castsi256_ps(a); }
__forceinline const vint8 asInt ( const vfloat8& a ) { return _mm256_castps_si256(a); }
__forceinline const vfloat8 operator +( const vfloat8& a ) { return a; }
__forceinline const vfloat8 operator -( const vfloat8& a ) {
__forceinline vfloat8 asFloat(const vint8& a) { return _mm256_castsi256_ps(a); }
__forceinline vint8 asInt (const vfloat8& a) { return _mm256_castps_si256(a); }
#if defined(__AVX512VL__)
#endif
__forceinline vfloat8 operator +(const vfloat8& a) { return a; }
__forceinline vfloat8 operator -(const vfloat8& a) {
const __m256 mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x80000000));
return _mm256_xor_ps(a.v, mask);
return _mm256_xor_ps(a, mask);
}
__forceinline const vfloat8 abs ( const vfloat8& a ) {
__forceinline vfloat8 abs(const vfloat8& a) {
const __m256 mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff));
return _mm256_and_ps(a.v, mask);
return _mm256_and_ps(a, mask);
}
__forceinline const vfloat8 sign ( const vfloat8& a ) { return _mm256_blendv_ps(vfloat8(one), -vfloat8(one), _mm256_cmp_ps(a, vfloat8(zero), _CMP_NGE_UQ )); }
__forceinline const vfloat8 signmsk ( const vfloat8& a ) { return _mm256_and_ps(a.v,_mm256_castsi256_ps(_mm256_set1_epi32(0x80000000))); }
__forceinline vfloat8 sign (const vfloat8& a) { return _mm256_blendv_ps(vfloat8(one), -vfloat8(one), _mm256_cmp_ps(a, vfloat8(zero), _CMP_NGE_UQ)); }
__forceinline vfloat8 signmsk(const vfloat8& a) { return _mm256_and_ps(a,_mm256_castsi256_ps(_mm256_set1_epi32(0x80000000))); }
__forceinline const vfloat8 rcp(const vfloat8& a)
__forceinline vfloat8 rcp(const vfloat8& a)
{
#if defined(__AVX512VL__)
const vfloat8 r = _mm256_rcp14_ps(a.v);
const vfloat8 r = _mm256_rcp14_ps(a);
#else
const vfloat8 r = _mm256_rcp_ps(a.v);
const vfloat8 r = _mm256_rcp_ps(a);
#endif
#if defined(__AVX2__)
return _mm256_mul_ps(r,_mm256_fnmadd_ps(r, a, vfloat8(2.0f)));
return _mm256_mul_ps(r, _mm256_fnmadd_ps(r, a, vfloat8(2.0f)));
#else
return _mm256_mul_ps(r,_mm256_sub_ps(vfloat8(2.0f), _mm256_mul_ps(r, a)));
return _mm256_mul_ps(r, _mm256_sub_ps(vfloat8(2.0f), _mm256_mul_ps(r, a)));
#endif
}
__forceinline const vfloat8 sqr ( const vfloat8& a ) { return _mm256_mul_ps(a,a); }
__forceinline const vfloat8 sqrt ( const vfloat8& a ) { return _mm256_sqrt_ps(a.v); }
__forceinline vfloat8 sqr (const vfloat8& a) { return _mm256_mul_ps(a,a); }
__forceinline vfloat8 sqrt(const vfloat8& a) { return _mm256_sqrt_ps(a); }
__forceinline const vfloat8 rsqrt( const vfloat8& a )
__forceinline vfloat8 rsqrt(const vfloat8& a)
{
#if defined(__AVX512VL__)
const vfloat8 r = _mm256_rsqrt14_ps(a.v);
const vfloat8 r = _mm256_rsqrt14_ps(a);
#else
const vfloat8 r = _mm256_rsqrt_ps(a.v);
const vfloat8 r = _mm256_rsqrt_ps(a);
#endif
#if defined(__AVX2__)
@@ -213,70 +297,75 @@ namespace embree
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat8 operator +( const vfloat8& a, const vfloat8& b ) { return _mm256_add_ps(a.v, b.v); }
__forceinline const vfloat8 operator +( const vfloat8& a, const float b ) { return a + vfloat8(b); }
__forceinline const vfloat8 operator +( const float a, const vfloat8& b ) { return vfloat8(a) + b; }
__forceinline vfloat8 operator +(const vfloat8& a, const vfloat8& b) { return _mm256_add_ps(a, b); }
__forceinline vfloat8 operator +(const vfloat8& a, float b) { return a + vfloat8(b); }
__forceinline vfloat8 operator +(float a, const vfloat8& b) { return vfloat8(a) + b; }
__forceinline const vfloat8 operator -( const vfloat8& a, const vfloat8& b ) { return _mm256_sub_ps(a.v, b.v); }
__forceinline const vfloat8 operator -( const vfloat8& a, const float b ) { return a - vfloat8(b); }
__forceinline const vfloat8 operator -( const float a, const vfloat8& b ) { return vfloat8(a) - b; }
__forceinline vfloat8 operator -(const vfloat8& a, const vfloat8& b) { return _mm256_sub_ps(a, b); }
__forceinline vfloat8 operator -(const vfloat8& a, float b) { return a - vfloat8(b); }
__forceinline vfloat8 operator -(float a, const vfloat8& b) { return vfloat8(a) - b; }
__forceinline const vfloat8 operator *( const vfloat8& a, const vfloat8& b ) { return _mm256_mul_ps(a.v, b.v); }
__forceinline const vfloat8 operator *( const vfloat8& a, const float b ) { return a * vfloat8(b); }
__forceinline const vfloat8 operator *( const float a, const vfloat8& b ) { return vfloat8(a) * b; }
__forceinline vfloat8 operator *(const vfloat8& a, const vfloat8& b) { return _mm256_mul_ps(a, b); }
__forceinline vfloat8 operator *(const vfloat8& a, float b) { return a * vfloat8(b); }
__forceinline vfloat8 operator *(float a, const vfloat8& b) { return vfloat8(a) * b; }
__forceinline const vfloat8 operator /( const vfloat8& a, const vfloat8& b ) { return _mm256_div_ps(a.v, b.v); }
__forceinline const vfloat8 operator /( const vfloat8& a, const float b ) { return a / vfloat8(b); }
__forceinline const vfloat8 operator /( const float a, const vfloat8& b ) { return vfloat8(a) / b; }
__forceinline vfloat8 operator /(const vfloat8& a, const vfloat8& b) { return _mm256_div_ps(a, b); }
__forceinline vfloat8 operator /(const vfloat8& a, float b) { return a / vfloat8(b); }
__forceinline vfloat8 operator /(float a, const vfloat8& b) { return vfloat8(a) / b; }
__forceinline const vfloat8 operator^( const vfloat8& a, const vfloat8& b ) { return _mm256_xor_ps(a.v,b.v); }
__forceinline const vfloat8 operator^( const vfloat8& a, const vint8& b ) { return _mm256_xor_ps(a.v,_mm256_castsi256_ps(b.v)); }
__forceinline vfloat8 operator ^(const vfloat8& a, const vfloat8& b) { return _mm256_xor_ps(a,b); }
__forceinline vfloat8 operator ^(const vfloat8& a, const vint8& b) { return _mm256_xor_ps(a,_mm256_castsi256_ps(b)); }
__forceinline const vfloat8 operator&( const vfloat8& a, const vfloat8& b ) { return _mm256_and_ps(a.v,b.v); }
__forceinline vfloat8 operator &(const vfloat8& a, const vfloat8& b) { return _mm256_and_ps(a,b); }
__forceinline const vfloat8 min( const vfloat8& a, const vfloat8& b ) { return _mm256_min_ps(a.v, b.v); }
__forceinline const vfloat8 min( const vfloat8& a, const float b ) { return _mm256_min_ps(a.v, vfloat8(b)); }
__forceinline const vfloat8 min( const float a, const vfloat8& b ) { return _mm256_min_ps(vfloat8(a), b.v); }
__forceinline vfloat8 min(const vfloat8& a, const vfloat8& b) { return _mm256_min_ps(a, b); }
__forceinline vfloat8 min(const vfloat8& a, float b) { return _mm256_min_ps(a, vfloat8(b)); }
__forceinline vfloat8 min(float a, const vfloat8& b) { return _mm256_min_ps(vfloat8(a), b); }
__forceinline const vfloat8 max( const vfloat8& a, const vfloat8& b ) { return _mm256_max_ps(a.v, b.v); }
__forceinline const vfloat8 max( const vfloat8& a, const float b ) { return _mm256_max_ps(a.v, vfloat8(b)); }
__forceinline const vfloat8 max( const float a, const vfloat8& b ) { return _mm256_max_ps(vfloat8(a), b.v); }
__forceinline vfloat8 max(const vfloat8& a, const vfloat8& b) { return _mm256_max_ps(a, b); }
__forceinline vfloat8 max(const vfloat8& a, float b) { return _mm256_max_ps(a, vfloat8(b)); }
__forceinline vfloat8 max(float a, const vfloat8& b) { return _mm256_max_ps(vfloat8(a), b); }
#if defined (__AVX2__)
#if defined(__AVX2__)
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_min_epi32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_max_epi32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_min_epi32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 minui(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_min_epu32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 maxui(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_max_epu32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_max_epi32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 minui(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_min_epu32(ai,bi);
return _mm256_castsi256_ps(ci);
}
__forceinline vfloat8 maxui(const vfloat8& a, const vfloat8& b) {
const vint8 ai = _mm256_castps_si256(a);
const vint8 bi = _mm256_castps_si256(b);
const vint8 ci = _mm256_max_epu32(ai,bi);
return _mm256_castsi256_ps(ci);
}
#else
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
return min(a,b);
}
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
return max(a,b);
}
__forceinline vfloat8 mini(const vfloat8& a, const vfloat8& b) {
return min(a,b);
}
__forceinline vfloat8 maxi(const vfloat8& a, const vfloat8& b) {
return max(a,b);
}
#endif
////////////////////////////////////////////////////////////////////////////////
@@ -284,83 +373,83 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX2__)
__forceinline const vfloat8 madd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmadd_ps(a,b,c); }
__forceinline const vfloat8 msub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmsub_ps(a,b,c); }
__forceinline const vfloat8 nmadd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmadd_ps(a,b,c); }
__forceinline const vfloat8 nmsub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmsub_ps(a,b,c); }
__forceinline vfloat8 madd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmadd_ps(a,b,c); }
__forceinline vfloat8 msub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fmsub_ps(a,b,c); }
__forceinline vfloat8 nmadd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmadd_ps(a,b,c); }
__forceinline vfloat8 nmsub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return _mm256_fnmsub_ps(a,b,c); }
#else
__forceinline const vfloat8 madd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b+c; }
__forceinline const vfloat8 msub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b-c; }
__forceinline const vfloat8 nmadd ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b+c;}
__forceinline const vfloat8 nmsub ( const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b-c; }
__forceinline vfloat8 madd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b+c; }
__forceinline vfloat8 msub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return a*b-c; }
__forceinline vfloat8 nmadd (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b+c;}
__forceinline vfloat8 nmsub (const vfloat8& a, const vfloat8& b, const vfloat8& c) { return -a*b-c; }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat8& operator +=( vfloat8& a, const vfloat8& b ) { return a = a + b; }
__forceinline vfloat8& operator +=( vfloat8& a, const float b ) { return a = a + b; }
__forceinline vfloat8& operator +=(vfloat8& a, const vfloat8& b) { return a = a + b; }
__forceinline vfloat8& operator +=(vfloat8& a, float b) { return a = a + b; }
__forceinline vfloat8& operator -=( vfloat8& a, const vfloat8& b ) { return a = a - b; }
__forceinline vfloat8& operator -=( vfloat8& a, const float b ) { return a = a - b; }
__forceinline vfloat8& operator -=(vfloat8& a, const vfloat8& b) { return a = a - b; }
__forceinline vfloat8& operator -=(vfloat8& a, float b) { return a = a - b; }
__forceinline vfloat8& operator *=( vfloat8& a, const vfloat8& b ) { return a = a * b; }
__forceinline vfloat8& operator *=( vfloat8& a, const float b ) { return a = a * b; }
__forceinline vfloat8& operator *=(vfloat8& a, const vfloat8& b) { return a = a * b; }
__forceinline vfloat8& operator *=(vfloat8& a, float b) { return a = a * b; }
__forceinline vfloat8& operator /=( vfloat8& a, const vfloat8& b ) { return a = a / b; }
__forceinline vfloat8& operator /=( vfloat8& a, const float b ) { return a = a / b; }
__forceinline vfloat8& operator /=(vfloat8& a, const vfloat8& b) { return a = a / b; }
__forceinline vfloat8& operator /=(vfloat8& a, float b) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX512VL__)
__forceinline const vboolf8 operator ==( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
__forceinline const vboolf8 operator !=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
__forceinline const vboolf8 operator < ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
__forceinline const vboolf8 operator >=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
__forceinline const vboolf8 operator > ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
__forceinline const vboolf8 operator <=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
__forceinline vboolf8 operator ==(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_EQ); }
__forceinline vboolf8 operator !=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_NE); }
__forceinline vboolf8 operator < (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LT); }
__forceinline vboolf8 operator >=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GE); }
__forceinline vboolf8 operator > (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_GT); }
__forceinline vboolf8 operator <=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps_mask(a, b, _MM_CMPINT_LE); }
__forceinline const vfloat8 select( const vboolf8& m, const vfloat8& t, const vfloat8& f ) {
__forceinline vfloat8 select(const vboolf8& m, const vfloat8& t, const vfloat8& f) {
return _mm256_mask_blend_ps(m, f, t);
}
#else
__forceinline const vboolf8 operator ==( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_EQ_OQ ); }
__forceinline const vboolf8 operator !=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_NEQ_OQ); }
__forceinline const vboolf8 operator < ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_LT_OQ ); }
__forceinline const vboolf8 operator >=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_GE_OQ ); }
__forceinline const vboolf8 operator > ( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_GT_OQ ); }
__forceinline const vboolf8 operator <=( const vfloat8& a, const vfloat8& b ) { return _mm256_cmp_ps(a, b, _CMP_LE_OQ ); }
__forceinline vboolf8 operator ==(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_EQ_OQ); }
__forceinline vboolf8 operator !=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NEQ_UQ); }
__forceinline vboolf8 operator < (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LT_OS); }
__forceinline vboolf8 operator >=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NLT_US); }
__forceinline vboolf8 operator > (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_NLE_US); }
__forceinline vboolf8 operator <=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LE_OS); }
__forceinline const vfloat8 select( const vboolf8& m, const vfloat8& t, const vfloat8& f ) {
__forceinline vfloat8 select(const vboolf8& m, const vfloat8& t, const vfloat8& f) {
return _mm256_blendv_ps(f, t, m);
}
#endif
template<int mask>
__forceinline const vfloat8 select( const vfloat8& t, const vfloat8& f ) {
__forceinline vfloat8 select(const vfloat8& t, const vfloat8& f) {
return _mm256_blend_ps(f, t, mask);
}
__forceinline const vboolf8 operator ==( const vfloat8& a, const float& b ) { return a == vfloat8(b); }
__forceinline const vboolf8 operator ==( const float& a, const vfloat8& b ) { return vfloat8(a) == b; }
__forceinline vboolf8 operator ==(const vfloat8& a, const float& b) { return a == vfloat8(b); }
__forceinline vboolf8 operator ==(const float& a, const vfloat8& b) { return vfloat8(a) == b; }
__forceinline const vboolf8 operator !=( const vfloat8& a, const float& b ) { return a != vfloat8(b); }
__forceinline const vboolf8 operator !=( const float& a, const vfloat8& b ) { return vfloat8(a) != b; }
__forceinline vboolf8 operator !=(const vfloat8& a, const float& b) { return a != vfloat8(b); }
__forceinline vboolf8 operator !=(const float& a, const vfloat8& b) { return vfloat8(a) != b; }
__forceinline const vboolf8 operator < ( const vfloat8& a, const float& b ) { return a < vfloat8(b); }
__forceinline const vboolf8 operator < ( const float& a, const vfloat8& b ) { return vfloat8(a) < b; }
__forceinline vboolf8 operator < (const vfloat8& a, const float& b) { return a < vfloat8(b); }
__forceinline vboolf8 operator < (const float& a, const vfloat8& b) { return vfloat8(a) < b; }
__forceinline const vboolf8 operator >=( const vfloat8& a, const float& b ) { return a >= vfloat8(b); }
__forceinline const vboolf8 operator >=( const float& a, const vfloat8& b ) { return vfloat8(a) >= b; }
__forceinline vboolf8 operator >=(const vfloat8& a, const float& b) { return a >= vfloat8(b); }
__forceinline vboolf8 operator >=(const float& a, const vfloat8& b) { return vfloat8(a) >= b; }
__forceinline const vboolf8 operator > ( const vfloat8& a, const float& b ) { return a > vfloat8(b); }
__forceinline const vboolf8 operator > ( const float& a, const vfloat8& b ) { return vfloat8(a) > b; }
__forceinline vboolf8 operator > (const vfloat8& a, const float& b) { return a > vfloat8(b); }
__forceinline vboolf8 operator > (const float& a, const vfloat8& b) { return vfloat8(a) > b; }
__forceinline const vboolf8 operator <=( const vfloat8& a, const float& b ) { return a <= vfloat8(b); }
__forceinline const vboolf8 operator <=( const float& a, const vfloat8& b ) { return vfloat8(a) <= b; }
__forceinline vboolf8 operator <=(const vfloat8& a, const float& b) { return a <= vfloat8(b); }
__forceinline vboolf8 operator <=(const float& a, const vfloat8& b) { return vfloat8(a) <= b; }
__forceinline vboolf8 eq(const vfloat8& a, const vfloat8& b) { return a == b; }
__forceinline vboolf8 ne(const vfloat8& a, const vfloat8& b) { return a != b; }
@@ -389,15 +478,15 @@ namespace embree
return madd(t,b-a,a);
}
__forceinline bool isvalid ( const vfloat8& v ) {
__forceinline bool isvalid (const vfloat8& v) {
return all((v > vfloat8(-FLT_LARGE)) & (v < vfloat8(+FLT_LARGE)));
}
__forceinline bool is_finite ( const vfloat8& a ) {
__forceinline bool is_finite (const vfloat8& a) {
return all((a >= vfloat8(-FLT_MAX)) & (a <= vfloat8(+FLT_MAX)));
}
__forceinline bool is_finite ( const vboolf8& valid, const vfloat8& a ) {
__forceinline bool is_finite (const vboolf8& valid, const vfloat8& a) {
return all(valid, (a >= vfloat8(-FLT_MAX)) & (a <= vfloat8(+FLT_MAX)));
}
@@ -405,98 +494,104 @@ namespace embree
/// Rounding Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat8 floor( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline const vfloat8 ceil ( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_POS_INF ); }
__forceinline const vfloat8 trunc( const vfloat8& a ) { return _mm256_round_ps(a, _MM_FROUND_TO_ZERO ); }
__forceinline const vfloat8 frac ( const vfloat8& a ) { return a-floor(a); }
__forceinline vfloat8 floor(const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_NEG_INF ); }
__forceinline vfloat8 ceil (const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_POS_INF ); }
__forceinline vfloat8 trunc(const vfloat8& a) { return _mm256_round_ps(a, _MM_FROUND_TO_ZERO ); }
__forceinline vfloat8 frac (const vfloat8& a) { return a-floor(a); }
////////////////////////////////////////////////////////////////////////////////
/// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vfloat8 unpacklo( const vfloat8& a, const vfloat8& b ) { return _mm256_unpacklo_ps(a.v, b.v); }
__forceinline vfloat8 unpackhi( const vfloat8& a, const vfloat8& b ) { return _mm256_unpackhi_ps(a.v, b.v); }
__forceinline vfloat8 unpacklo(const vfloat8& a, const vfloat8& b) { return _mm256_unpacklo_ps(a, b); }
__forceinline vfloat8 unpackhi(const vfloat8& a, const vfloat8& b) { return _mm256_unpackhi_ps(a, b); }
template<size_t i> __forceinline const vfloat8 shuffle( const vfloat8& a ) {
return _mm256_permute_ps(a, _MM_SHUFFLE(i, i, i, i));
template<int i>
__forceinline vfloat8 shuffle(const vfloat8& v) {
return _mm256_permute_ps(v, _MM_SHUFFLE(i, i, i, i));
}
template<size_t i0, size_t i1> __forceinline const vfloat8 shuffle4( const vfloat8& a ) {
return _mm256_permute2f128_ps(a, a, (i1 << 4) | (i0 << 0));
template<int i0, int i1>
__forceinline vfloat8 shuffle4(const vfloat8& v) {
return _mm256_permute2f128_ps(v, v, (i1 << 4) | (i0 << 0));
}
template<size_t i0, size_t i1> __forceinline const vfloat8 shuffle4( const vfloat8& a, const vfloat8& b) {
template<int i0, int i1>
__forceinline vfloat8 shuffle4(const vfloat8& a, const vfloat8& b) {
return _mm256_permute2f128_ps(a, b, (i1 << 4) | (i0 << 0));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat8 shuffle( const vfloat8& a ) {
return _mm256_permute_ps(a, _MM_SHUFFLE(i3, i2, i1, i0));
template<int i0, int i1, int i2, int i3>
__forceinline vfloat8 shuffle(const vfloat8& v) {
return _mm256_permute_ps(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vfloat8 shuffle( const vfloat8& a, const vfloat8& b ) {
template<int i0, int i1, int i2, int i3>
__forceinline vfloat8 shuffle(const vfloat8& a, const vfloat8& b) {
return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<> __forceinline const vfloat8 shuffle<0, 0, 2, 2>( const vfloat8& b ) { return _mm256_moveldup_ps(b); }
template<> __forceinline const vfloat8 shuffle<1, 1, 3, 3>( const vfloat8& b ) { return _mm256_movehdup_ps(b); }
template<> __forceinline const vfloat8 shuffle<0, 1, 0, 1>( const vfloat8& b ) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(b))); }
template<> __forceinline vfloat8 shuffle<0, 0, 2, 2>(const vfloat8& v) { return _mm256_moveldup_ps(v); }
template<> __forceinline vfloat8 shuffle<1, 1, 3, 3>(const vfloat8& v) { return _mm256_movehdup_ps(v); }
template<> __forceinline vfloat8 shuffle<0, 1, 0, 1>(const vfloat8& v) { return _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(v))); }
__forceinline const vfloat8 broadcast(const float* ptr) { return _mm256_broadcast_ss(ptr); }
template<size_t i> __forceinline const vfloat8 insert4(const vfloat8& a, const vfloat4& b) { return _mm256_insertf128_ps(a, b, i); }
template<size_t i> __forceinline const vfloat4 extract4 (const vfloat8& a) { return _mm256_extractf128_ps(a, i); }
template<> __forceinline const vfloat4 extract4<0>(const vfloat8& a) { return _mm256_castps256_ps128(a); }
__forceinline vfloat8 broadcast(const float* ptr) { return _mm256_broadcast_ss(ptr); }
template<size_t i> __forceinline vfloat8 insert4(const vfloat8& a, const vfloat4& b) { return _mm256_insertf128_ps(a, b, i); }
template<size_t i> __forceinline vfloat4 extract4 (const vfloat8& a) { return _mm256_extractf128_ps(a, i); }
template<> __forceinline vfloat4 extract4<0>(const vfloat8& a) { return _mm256_castps256_ps128(a); }
__forceinline float toScalar(const vfloat8& a) { return _mm_cvtss_f32(_mm256_castps256_ps128(a)); }
__forceinline float toScalar(const vfloat8& v) { return _mm_cvtss_f32(_mm256_castps256_ps128(v)); }
__forceinline vfloat8 assign( const vfloat4& a ) { return _mm256_castps128_ps256(a); }
__forceinline vfloat8 assign(const vfloat4& a) { return _mm256_castps128_ps256(a); }
#if defined (__AVX2__)
__forceinline vfloat8 permute(const vfloat8 &a, const __m256i &index) {
return _mm256_permutevar8x32_ps(a,index);
__forceinline vfloat8 permute(const vfloat8& a, const __m256i& index) {
return _mm256_permutevar8x32_ps(a, index);
}
#endif
#if defined(__AVX512VL__)
template<int i>
__forceinline vfloat8 align_shift_right(const vfloat8 &a, const vfloat8 &b) {
__forceinline vfloat8 align_shift_right(const vfloat8& a, const vfloat8& b) {
return _mm256_castsi256_ps(_mm256_alignr_epi32(_mm256_castps_si256(a), _mm256_castps_si256(b), i));
}
#endif
#if defined (__AVX_I__)
template<const int mode>
__forceinline vint4 convert_to_hf16(const vfloat8 &a) {
return _mm256_cvtps_ph(a,mode);
__forceinline vint4 convert_to_hf16(const vfloat8& a) {
return _mm256_cvtps_ph(a, mode);
}
__forceinline vfloat8 convert_from_hf16(const vint4 &a) {
__forceinline vfloat8 convert_from_hf16(const vint4& a) {
return _mm256_cvtph_ps(a);
}
#endif
__forceinline vfloat4 broadcast4f( const vfloat8& a, const size_t k ) {
__forceinline vfloat4 broadcast4f(const vfloat8& a, const size_t k) {
return vfloat4::broadcast(&a[k]);
}
__forceinline vfloat8 broadcast8f( const vfloat8& a, const size_t k ) {
__forceinline vfloat8 broadcast8f(const vfloat8& a, const size_t k) {
return vfloat8::broadcast(&a[k]);
}
#if defined(__AVX512VL__)
__forceinline vfloat8 shift_right_1( const vfloat8& x) {
__forceinline vfloat8 shift_right_1(const vfloat8& x) {
return align_shift_right<1>(zero,x);
}
#else
__forceinline vfloat8 shift_right_1( const vfloat8& x) {
__forceinline vfloat8 shift_right_1(const vfloat8& x) {
const vfloat8 t0 = shuffle<1,2,3,0>(x);
const vfloat8 t1 = shuffle4<1,0>(t0);
return _mm256_blend_ps(t0,t1,0x88);
}
#endif
__forceinline vint8 floori (const vfloat8& a) {
__forceinline vint8 floori(const vfloat8& a) {
return vint8(floor(a));
}
////////////////////////////////////////////////////////////////////////////////
/// Transpose
////////////////////////////////////////////////////////////////////////////////
@@ -539,6 +634,12 @@ namespace embree
c7 = shuffle4<1,3>(h3,h7);
}
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3, const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
vfloat8& c0, vfloat8& c1, vfloat8& c2, vfloat8& c3)
{
transpose(vfloat8(r0,r4), vfloat8(r1,r5), vfloat8(r2,r6), vfloat8(r3,r7), c0, c1, c2, c3);
}
__forceinline void transpose(const vfloat4& r0, const vfloat4& r1, const vfloat4& r2, const vfloat4& r3, const vfloat4& r4, const vfloat4& r5, const vfloat4& r6, const vfloat4& r7,
vfloat8& c0, vfloat8& c1, vfloat8& c2)
{
@@ -549,17 +650,17 @@ namespace embree
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline const vfloat8 vreduce_min2(const vfloat8& v) { return min(v,shuffle<1,0,3,2>(v)); }
__forceinline const vfloat8 vreduce_min4(const vfloat8& v) { vfloat8 v1 = vreduce_min2(v); return min(v1,shuffle<2,3,0,1>(v1)); }
__forceinline const vfloat8 vreduce_min (const vfloat8& v) { vfloat8 v1 = vreduce_min4(v); return min(v1,shuffle4<1,0>(v1)); }
__forceinline vfloat8 vreduce_min2(const vfloat8& v) { return min(v,shuffle<1,0,3,2>(v)); }
__forceinline vfloat8 vreduce_min4(const vfloat8& v) { vfloat8 v1 = vreduce_min2(v); return min(v1,shuffle<2,3,0,1>(v1)); }
__forceinline vfloat8 vreduce_min (const vfloat8& v) { vfloat8 v1 = vreduce_min4(v); return min(v1,shuffle4<1,0>(v1)); }
__forceinline const vfloat8 vreduce_max2(const vfloat8& v) { return max(v,shuffle<1,0,3,2>(v)); }
__forceinline const vfloat8 vreduce_max4(const vfloat8& v) { vfloat8 v1 = vreduce_max2(v); return max(v1,shuffle<2,3,0,1>(v1)); }
__forceinline const vfloat8 vreduce_max (const vfloat8& v) { vfloat8 v1 = vreduce_max4(v); return max(v1,shuffle4<1,0>(v1)); }
__forceinline vfloat8 vreduce_max2(const vfloat8& v) { return max(v,shuffle<1,0,3,2>(v)); }
__forceinline vfloat8 vreduce_max4(const vfloat8& v) { vfloat8 v1 = vreduce_max2(v); return max(v1,shuffle<2,3,0,1>(v1)); }
__forceinline vfloat8 vreduce_max (const vfloat8& v) { vfloat8 v1 = vreduce_max4(v); return max(v1,shuffle4<1,0>(v1)); }
__forceinline const vfloat8 vreduce_add2(const vfloat8& v) { return v + shuffle<1,0,3,2>(v); }
__forceinline const vfloat8 vreduce_add4(const vfloat8& v) { vfloat8 v1 = vreduce_add2(v); return v1 + shuffle<2,3,0,1>(v1); }
__forceinline const vfloat8 vreduce_add (const vfloat8& v) { vfloat8 v1 = vreduce_add4(v); return v1 + shuffle4<1,0>(v1); }
__forceinline vfloat8 vreduce_add2(const vfloat8& v) { return v + shuffle<1,0,3,2>(v); }
__forceinline vfloat8 vreduce_add4(const vfloat8& v) { vfloat8 v1 = vreduce_add2(v); return v1 + shuffle<2,3,0,1>(v1); }
__forceinline vfloat8 vreduce_add (const vfloat8& v) { vfloat8 v1 = vreduce_add4(v); return v1 + shuffle4<1,0>(v1); }
__forceinline float reduce_min(const vfloat8& v) { return toScalar(vreduce_min(v)); }
__forceinline float reduce_max(const vfloat8& v) { return toScalar(vreduce_max(v)); }
@@ -569,14 +670,14 @@ namespace embree
{
const vfloat8 a = select(valid,v,vfloat8(pos_inf));
const vbool8 valid_min = valid & (a == vreduce_min(a));
return __bsf(movemask(any(valid_min) ? valid_min : valid));
return bsf(movemask(any(valid_min) ? valid_min : valid));
}
__forceinline size_t select_max(const vboolf8& valid, const vfloat8& v)
{
const vfloat8 a = select(valid,v,vfloat8(neg_inf));
const vbool8 valid_max = valid & (a == vreduce_max(a));
return __bsf(movemask(any(valid_max) ? valid_max : valid));
return bsf(movemask(any(valid_max) ? valid_max : valid));
}
@@ -584,15 +685,15 @@ namespace embree
/// Euclidian Space Operators (pairs of Vec3fa's)
////////////////////////////////////////////////////////////////////////////////
//__forceinline vfloat8 dot ( const vfloat8& a, const vfloat8& b ) {
//__forceinline vfloat8 dot(const vfloat8& a, const vfloat8& b) {
// return vreduce_add4(a*b);
//}
__forceinline vfloat8 dot ( const vfloat8& a, const vfloat8& b ) {
__forceinline vfloat8 dot(const vfloat8& a, const vfloat8& b) {
return _mm256_dp_ps(a,b,0x7F);
}
__forceinline vfloat8 cross ( const vfloat8& a, const vfloat8& b )
__forceinline vfloat8 cross(const vfloat8& a, const vfloat8& b)
{
const vfloat8 a0 = a;
const vfloat8 b0 = shuffle<1,2,0,3>(b);
@@ -601,17 +702,17 @@ namespace embree
return shuffle<1,2,0,3>(msub(a0,b0,a1*b1));
}
//__forceinline float sqr_length ( const vfloat<8>& a ) { return dot(a,a); }
//__forceinline float rcp_length ( const vfloat<8>& a ) { return rsqrt(dot(a,a)); }
//__forceinline float rcp_length2( const vfloat<8>& a ) { return rcp(dot(a,a)); }
//__forceinline float length ( const vfloat<8>& a ) { return sqrt(dot(a,a)); }
__forceinline vfloat<8> normalize( const vfloat<8>& a ) { return a*rsqrt(dot(a,a)); }
//__forceinline float distance ( const vfloat<8>& a, const vfloat<8>& b ) { return length(a-b); }
//__forceinline float halfArea ( const vfloat<8>& d ) { return madd(d.x,(d.y+d.z),d.y*d.z); }
//__forceinline float area ( const vfloat<8>& d ) { return 2.0f*halfArea(d); }
//__forceinline vfloat<8> reflect ( const vfloat<8>& V, const vfloat<8>& N ) { return 2.0f*dot(V,N)*N-V; }
//__forceinline float sqr_length (const vfloat<8>& a) { return dot(a,a); }
//__forceinline float rcp_length (const vfloat<8>& a) { return rsqrt(dot(a,a)); }
//__forceinline float rcp_length2(const vfloat<8>& a) { return rcp(dot(a,a)); }
//__forceinline float length (const vfloat<8>& a) { return sqrt(dot(a,a)); }
__forceinline vfloat<8> normalize(const vfloat<8>& a) { return a*rsqrt(dot(a,a)); }
//__forceinline float distance(const vfloat<8>& a, const vfloat<8>& b) { return length(a-b); }
//__forceinline float halfArea(const vfloat<8>& d) { return madd(d.x,(d.y+d.z),d.y*d.z); }
//__forceinline float area (const vfloat<8>& d) { return 2.0f*halfArea(d); }
//__forceinline vfloat<8> reflect(const vfloat<8>& V, const vfloat<8>& N) { return 2.0f*dot(V,N)*N-V; }
//__forceinline vfloat<8> normalize_safe( const vfloat<8>& a ) {
//__forceinline vfloat<8> normalize_safe(const vfloat<8>& a) {
// const float d = dot(a,a); if (unlikely(d == 0.0f)) return a; else return a*rsqrt(d);
//}
@@ -683,7 +784,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vfloat8& a) {
inline std::ostream& operator <<(std::ostream& cout, const vfloat8& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ", " << a[4] << ", " << a[5] << ", " << a[6] << ", " << a[7] << ">";
}
}
+170 -157
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -20,7 +20,7 @@ namespace embree
{
/* 16-wide AVX-512 integer type */
template<>
struct vint<16>
struct vint<16>
{
typedef vboolf16 Bool;
typedef vint16 Int;
@@ -38,24 +38,24 @@ namespace embree
__forceinline vint() {}
__forceinline vint(const vint16& t) { v = t.v; }
__forceinline vint16& operator=(const vint16& f) { v = f.v; return *this; }
__forceinline vint16& operator =(const vint16& f) { v = f.v; return *this; }
__forceinline vint(const __m512i& t) { v = t; }
__forceinline operator __m512i () const { return v; }
__forceinline operator __m256i () const { return _mm512_castsi512_si256(v); }
__forceinline operator __m512i() const { return v; }
__forceinline operator __m256i() const { return _mm512_castsi512_si256(v); }
__forceinline vint(const int i) {
__forceinline vint(int i) {
v = _mm512_set1_epi32(i);
}
__forceinline vint(const int a, const int b, const int c, const int d) {
__forceinline vint(int a, int b, int c, int d) {
v = _mm512_set4_epi32(d,c,b,a);
}
__forceinline vint(const int a0 , const int a1 , const int a2 , const int a3,
const int a4 , const int a5 , const int a6 , const int a7,
const int a8 , const int a9 , const int a10, const int a11,
const int a12, const int a13, const int a14, const int a15)
__forceinline vint(int a0 , int a1 , int a2 , int a3,
int a4 , int a5 , int a6 , int a7,
int a8 , int a9 , int a10, int a11,
int a12, int a13, int a14, int a15)
{
v = _mm512_set_epi32(a15,a14,a13,a12,a11,a10,a9,a8,a7,a6,a5,a4,a3,a2,a1,a0);
}
@@ -64,9 +64,21 @@ namespace embree
v = _mm512_broadcast_i32x4(i);
}
__forceinline vint(const vint4& a, const vint4& b, const vint4& c, const vint4& d) {
v = _mm512_castsi128_si512(a);
v = _mm512_inserti32x4(v, b, 1);
v = _mm512_inserti32x4(v, c, 2);
v = _mm512_inserti32x4(v, d, 3);
}
__forceinline vint(const vint8& i) {
v = _mm512_castps_si512(_mm512_castpd_ps(_mm512_broadcast_f64x4(_mm256_castsi256_pd(i))));
}
__forceinline vint(const vint8& a, const vint8& b) {
v = _mm512_castsi256_si512(a);
v = _mm512_inserti64x4(v, b, 1);
}
__forceinline explicit vint(const __m512& f) {
v = _mm512_cvtps_epi32(f);
@@ -76,17 +88,12 @@ namespace embree
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vint( ZeroTy ) : v(_mm512_setzero_epi32()) {}
__forceinline vint( OneTy ) : v(_mm512_set1_epi32(1)) {}
__forceinline vint( PosInfTy ) : v(_mm512_set1_epi32(pos_inf)) {}
__forceinline vint( NegInfTy ) : v(_mm512_set1_epi32(neg_inf)) {}
__forceinline vint( StepTy ) : v(_mm512_set_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
__forceinline vint( ReverseStepTy ) : v(_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
__forceinline static vint16 zero() { return _mm512_setzero_epi32(); }
__forceinline static vint16 one () { return _mm512_set1_epi32(1); }
__forceinline static vint16 neg_one () { return _mm512_set1_epi32(-1); }
__forceinline vint(ZeroTy) : v(_mm512_setzero_epi32()) {}
__forceinline vint(OneTy) : v(_mm512_set1_epi32(1)) {}
__forceinline vint(PosInfTy) : v(_mm512_set1_epi32(pos_inf)) {}
__forceinline vint(NegInfTy) : v(_mm512_set1_epi32(neg_inf)) {}
__forceinline vint(StepTy) : v(_mm512_set_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
__forceinline vint(ReverseStepTy) : v(_mm512_setr_epi32(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
@@ -94,8 +101,11 @@ namespace embree
static __forceinline vint16 load (const void* addr) { return _mm512_load_si512((int*)addr); }
static __forceinline const vint16 load( const unsigned char* const ptr ) { return _mm512_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr)); }
static __forceinline const vint16 load( const unsigned short* const ptr ) { return _mm512_cvtepu16_epi32(*(__m256i*)ptr); }
static __forceinline vint16 load(const unsigned char* ptr) { return _mm512_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr)); }
static __forceinline vint16 load(const unsigned short* ptr) { return _mm512_cvtepu16_epi32(_mm256_load_si256((__m256i*)ptr)); }
static __forceinline vint16 loadu(const unsigned char* ptr) { return _mm512_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr)); }
static __forceinline vint16 loadu(const unsigned short* ptr) { return _mm512_cvtepu16_epi32(_mm256_loadu_si256((__m256i*)ptr)); }
static __forceinline vint16 loadu(const void* addr) { return _mm512_loadu_si512(addr); }
@@ -106,16 +116,16 @@ namespace embree
static __forceinline void storeu(void* ptr, const vint16& v) { _mm512_storeu_si512(ptr,v); }
static __forceinline void store (const vboolf16& mask, void* addr, const vint16& v2) { _mm512_mask_store_epi32(addr,mask,v2); }
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vint16& f ) { _mm512_mask_storeu_epi32((int*)ptr,mask,f); }
static __forceinline void storeu(const vboolf16& mask, void* ptr, const vint16& f) { _mm512_mask_storeu_epi32((int*)ptr,mask,f); }
static __forceinline void store_nt(void *__restrict__ ptr, const vint16& a) { _mm512_stream_si512((__m512i*)ptr,a); }
static __forceinline void store_nt(void* __restrict__ ptr, const vint16& a) { _mm512_stream_si512((__m512i*)ptr,a); }
/* pass by value to avoid compiler generating inefficient code */
static __forceinline void storeu_compact(const vboolf16 mask,void * addr, const vint16 reg) {
static __forceinline void storeu_compact(const vboolf16 mask, void* addr, vint16 reg) {
_mm512_mask_compressstoreu_epi32(addr,mask,reg);
}
static __forceinline void storeu_compact_single(const vboolf16 mask,void * addr, const vint16 reg) {
static __forceinline void storeu_compact_single(const vboolf16 mask, void* addr, vint16 reg) {
//_mm512_mask_compressstoreu_epi32(addr,mask,reg);
*(float*)addr = mm512_cvtss_f32(_mm512_mask_compress_ps(_mm512_castsi512_ps(reg),mask,_mm512_castsi512_ps(reg)));
}
@@ -136,135 +146,160 @@ namespace embree
return _mm512_mask_expand_epi32(b,mask,a);
}
template<int scale = 4>
static __forceinline vint16 gather(const int* ptr, const vint16& index) {
return _mm512_i32gather_epi32(index,ptr,scale);
}
template<int scale = 4>
static __forceinline vint16 gather(const vboolf16& mask, const int* ptr, const vint16& index) {
return _mm512_mask_i32gather_epi32(_mm512_undefined_epi32(),mask,index,ptr,scale);
}
template<int scale = 4>
static __forceinline vint16 gather(const vboolf16& mask, vint16& dest, const int* ptr, const vint16& index) {
return _mm512_mask_i32gather_epi32(dest,mask,index,ptr,scale);
}
template<int scale = 4>
static __forceinline void scatter(int* ptr, const vint16& index, const vint16& v) {
_mm512_i32scatter_epi32((int*)ptr,index,v,scale);
}
template<int scale = 4>
static __forceinline void scatter(const vboolf16& mask, int* ptr, const vint16& index, const vint16& v) {
_mm512_mask_i32scatter_epi32((int*)ptr,mask,index,v,scale);
}
static __forceinline vint16 broadcast64bit(size_t v) {
return _mm512_set1_epi64(v);
}
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline int& operator[](const size_t index) { assert(index < 16); return i[index]; }
__forceinline const int& operator[](const size_t index) const { assert(index < 16); return i[index]; }
__forceinline int& operator [](size_t index) { assert(index < 16); return i[index]; }
__forceinline const int& operator [](size_t index) const { assert(index < 16); return i[index]; }
__forceinline unsigned int uint (const size_t index) const { assert(index < 16); return ((unsigned int*)i)[index]; }
__forceinline size_t& uint64_t(const size_t index) const { assert(index < 8); return ((size_t*)i)[index]; }
__forceinline unsigned int uint (size_t index) const { assert(index < 16); return ((unsigned int*)i)[index]; }
__forceinline size_t& uint64_t(size_t index) const { assert(index < 8); return ((size_t*)i)[index]; }
};
////////////////////////////////////////////////////////////////////////////////
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vint16 asInt ( const __m512& a ) { return _mm512_castps_si512(a); }
__forceinline const vint16 operator +( const vint16& a ) { return a; }
__forceinline const vint16 operator -( const vint16& a ) { return _mm512_sub_epi32(_mm512_setzero_epi32(), a); }
__forceinline vboolf16 asBool(const vint16& a) { return _mm512_movepi32_mask(a); }
__forceinline vint16 operator +(const vint16& a) { return a; }
__forceinline vint16 operator -(const vint16& a) { return _mm512_sub_epi32(_mm512_setzero_epi32(), a); }
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vint16 operator +( const vint16& a, const vint16& b ) { return _mm512_add_epi32(a, b); }
__forceinline const vint16 operator +( const vint16& a, const int b ) { return a + vint16(b); }
__forceinline const vint16 operator +( const int a, const vint16& b ) { return vint16(a) + b; }
__forceinline vint16 operator +(const vint16& a, const vint16& b) { return _mm512_add_epi32(a, b); }
__forceinline vint16 operator +(const vint16& a, int b) { return a + vint16(b); }
__forceinline vint16 operator +(int a, const vint16& b) { return vint16(a) + b; }
__forceinline const vint16 operator -( const vint16& a, const vint16& b ) { return _mm512_sub_epi32(a, b); }
__forceinline const vint16 operator -( const vint16& a, const int b ) { return a - vint16(b); }
__forceinline const vint16 operator -( const int a, const vint16& b ) { return vint16(a) - b; }
__forceinline vint16 operator -(const vint16& a, const vint16& b) { return _mm512_sub_epi32(a, b); }
__forceinline vint16 operator -(const vint16& a, int b) { return a - vint16(b); }
__forceinline vint16 operator -(int a, const vint16& b) { return vint16(a) - b; }
__forceinline const vint16 operator *( const vint16& a, const vint16& b ) { return _mm512_mullo_epi32(a, b); }
__forceinline const vint16 operator *( const vint16& a, const int b ) { return a * vint16(b); }
__forceinline const vint16 operator *( const int a, const vint16& b ) { return vint16(a) * b; }
__forceinline vint16 operator *(const vint16& a, const vint16& b) { return _mm512_mullo_epi32(a, b); }
__forceinline vint16 operator *(const vint16& a, int b) { return a * vint16(b); }
__forceinline vint16 operator *(int a, const vint16& b) { return vint16(a) * b; }
__forceinline const vint16 operator &( const vint16& a, const vint16& b ) { return _mm512_and_epi32(a, b); }
__forceinline const vint16 operator &( const vint16& a, const int b ) { return a & vint16(b); }
__forceinline const vint16 operator &( const int a, const vint16& b ) { return vint16(a) & b; }
__forceinline vint16 operator &(const vint16& a, const vint16& b) { return _mm512_and_epi32(a, b); }
__forceinline vint16 operator &(const vint16& a, int b) { return a & vint16(b); }
__forceinline vint16 operator &(int a, const vint16& b) { return vint16(a) & b; }
__forceinline const vint16 operator |( const vint16& a, const vint16& b ) { return _mm512_or_epi32(a, b); }
__forceinline const vint16 operator |( const vint16& a, const int b ) { return a | vint16(b); }
__forceinline const vint16 operator |( const int a, const vint16& b ) { return vint16(a) | b; }
__forceinline vint16 operator |(const vint16& a, const vint16& b) { return _mm512_or_epi32(a, b); }
__forceinline vint16 operator |(const vint16& a, int b) { return a | vint16(b); }
__forceinline vint16 operator |(int a, const vint16& b) { return vint16(a) | b; }
__forceinline const vint16 operator ^( const vint16& a, const vint16& b ) { return _mm512_xor_epi32(a, b); }
__forceinline const vint16 operator ^( const vint16& a, const int b ) { return a ^ vint16(b); }
__forceinline const vint16 operator ^( const int a, const vint16& b ) { return vint16(a) ^ b; }
__forceinline vint16 operator ^(const vint16& a, const vint16& b) { return _mm512_xor_epi32(a, b); }
__forceinline vint16 operator ^(const vint16& a, int b) { return a ^ vint16(b); }
__forceinline vint16 operator ^(int a, const vint16& b) { return vint16(a) ^ b; }
__forceinline const vint16 operator <<( const vint16& a, const int n ) { return _mm512_slli_epi32(a, n); }
__forceinline const vint16 operator >>( const vint16& a, const int n ) { return _mm512_srai_epi32(a, n); }
__forceinline vint16 operator <<(const vint16& a, int n) { return _mm512_slli_epi32(a, n); }
__forceinline vint16 operator >>(const vint16& a, int n) { return _mm512_srai_epi32(a, n); }
__forceinline const vint16 operator <<( const vint16& a, const vint16& n ) { return _mm512_sllv_epi32(a, n); }
__forceinline const vint16 operator >>( const vint16& a, const vint16& n ) { return _mm512_srav_epi32(a, n); }
__forceinline vint16 operator <<(const vint16& a, const vint16& n) { return _mm512_sllv_epi32(a, n); }
__forceinline vint16 operator >>(const vint16& a, const vint16& n) { return _mm512_srav_epi32(a, n); }
__forceinline const vint16 sll ( const vint16& a, const int b ) { return _mm512_slli_epi32(a, b); }
__forceinline const vint16 sra ( const vint16& a, const int b ) { return _mm512_srai_epi32(a, b); }
__forceinline const vint16 srl ( const vint16& a, const int b ) { return _mm512_srli_epi32(a, b); }
__forceinline vint16 sll (const vint16& a, int b) { return _mm512_slli_epi32(a, b); }
__forceinline vint16 sra (const vint16& a, int b) { return _mm512_srai_epi32(a, b); }
__forceinline vint16 srl (const vint16& a, int b) { return _mm512_srli_epi32(a, b); }
__forceinline const vint16 min( const vint16& a, const vint16& b ) { return _mm512_min_epi32(a, b); }
__forceinline const vint16 min( const vint16& a, const int b ) { return min(a,vint16(b)); }
__forceinline const vint16 min( const int a, const vint16& b ) { return min(vint16(a),b); }
__forceinline vint16 min(const vint16& a, const vint16& b) { return _mm512_min_epi32(a, b); }
__forceinline vint16 min(const vint16& a, int b) { return min(a,vint16(b)); }
__forceinline vint16 min(int a, const vint16& b) { return min(vint16(a),b); }
__forceinline const vint16 max( const vint16& a, const vint16& b ) { return _mm512_max_epi32(a, b); }
__forceinline const vint16 max( const vint16& a, const int b ) { return max(a,vint16(b)); }
__forceinline const vint16 max( const int a, const vint16& b ) { return max(vint16(a),b); }
__forceinline vint16 max(const vint16& a, const vint16& b) { return _mm512_max_epi32(a, b); }
__forceinline vint16 max(const vint16& a, int b) { return max(a,vint16(b)); }
__forceinline vint16 max(int a, const vint16& b) { return max(vint16(a),b); }
__forceinline const vint16 umin( const vint16& a, const vint16& b ) { return _mm512_min_epu32(a.v, b.v); }
__forceinline const vint16 umax( const vint16& a, const vint16& b ) { return _mm512_max_epu32(a.v, b.v); }
__forceinline vint16 umin(const vint16& a, const vint16& b) { return _mm512_min_epu32(a, b); }
__forceinline vint16 umax(const vint16& a, const vint16& b) { return _mm512_max_epu32(a, b); }
__forceinline const vint16 mask_add(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_add_epi32(c,mask,a,b); }
__forceinline const vint16 mask_sub(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_sub_epi32(c,mask,a,b); }
__forceinline vint16 mask_add(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_add_epi32(c,mask,a,b); }
__forceinline vint16 mask_sub(const vboolf16& mask, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_sub_epi32(c,mask,a,b); }
__forceinline const vint16 mask_and(const vboolf16& m,vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_and_epi32(c,m,a,b); }
__forceinline const vint16 mask_or (const vboolf16& m,vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_or_epi32(c,m,a,b); }
__forceinline vint16 mask_and(const vboolf16& m, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_and_epi32(c,m,a,b); }
__forceinline vint16 mask_or (const vboolf16& m, vint16& c, const vint16& a, const vint16& b) { return _mm512_mask_or_epi32(c,m,a,b); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vint16& operator +=( vint16& a, const vint16& b ) { return a = a + b; }
__forceinline vint16& operator +=( vint16& a, const int b ) { return a = a + b; }
__forceinline vint16& operator +=(vint16& a, const vint16& b) { return a = a + b; }
__forceinline vint16& operator +=(vint16& a, int b) { return a = a + b; }
__forceinline vint16& operator -=( vint16& a, const vint16& b ) { return a = a - b; }
__forceinline vint16& operator -=( vint16& a, const int b ) { return a = a - b; }
__forceinline vint16& operator -=(vint16& a, const vint16& b) { return a = a - b; }
__forceinline vint16& operator -=(vint16& a, int b) { return a = a - b; }
__forceinline vint16& operator *=( vint16& a, const vint16& b ) { return a = a * b; }
__forceinline vint16& operator *=( vint16& a, const int b ) { return a = a * b; }
__forceinline vint16& operator *=(vint16& a, const vint16& b) { return a = a * b; }
__forceinline vint16& operator *=(vint16& a, int b) { return a = a * b; }
__forceinline vint16& operator &=( vint16& a, const vint16& b ) { return a = a & b; }
__forceinline vint16& operator &=( vint16& a, const int b ) { return a = a & b; }
__forceinline vint16& operator &=(vint16& a, const vint16& b) { return a = a & b; }
__forceinline vint16& operator &=(vint16& a, int b) { return a = a & b; }
__forceinline vint16& operator |=( vint16& a, const vint16& b ) { return a = a | b; }
__forceinline vint16& operator |=( vint16& a, const int b ) { return a = a | b; }
__forceinline vint16& operator |=(vint16& a, const vint16& b) { return a = a | b; }
__forceinline vint16& operator |=(vint16& a, int b) { return a = a | b; }
__forceinline vint16& operator <<=( vint16& a, const int b ) { return a = a << b; }
__forceinline vint16& operator >>=( vint16& a, const int b ) { return a = a >> b; }
__forceinline vint16& operator <<=(vint16& a, int b) { return a = a << b; }
__forceinline vint16& operator >>=(vint16& a, int b) { return a = a >> b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
__forceinline const vboolf16 operator ==( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
__forceinline const vboolf16 operator ==( const vint16& a, const int b ) { return a == vint16(b); }
__forceinline const vboolf16 operator ==( const int a, const vint16& b ) { return vint16(a) == b; }
__forceinline vboolf16 operator ==(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboolf16 operator ==(const vint16& a, int b) { return a == vint16(b); }
__forceinline vboolf16 operator ==(int a, const vint16& b) { return vint16(a) == b; }
__forceinline const vboolf16 operator !=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
__forceinline const vboolf16 operator !=( const vint16& a, const int b ) { return a != vint16(b); }
__forceinline const vboolf16 operator !=( const int a, const vint16& b ) { return vint16(a) != b; }
__forceinline vboolf16 operator !=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
__forceinline vboolf16 operator !=(const vint16& a, int b) { return a != vint16(b); }
__forceinline vboolf16 operator !=(int a, const vint16& b) { return vint16(a) != b; }
__forceinline const vboolf16 operator < ( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
__forceinline const vboolf16 operator < ( const vint16& a, const int b ) { return a < vint16(b); }
__forceinline const vboolf16 operator < ( const int a, const vint16& b ) { return vint16(a) < b; }
__forceinline vboolf16 operator < (const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
__forceinline vboolf16 operator < (const vint16& a, int b) { return a < vint16(b); }
__forceinline vboolf16 operator < (int a, const vint16& b) { return vint16(a) < b; }
__forceinline const vboolf16 operator >=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
__forceinline const vboolf16 operator >=( const vint16& a, const int b ) { return a >= vint16(b); }
__forceinline const vboolf16 operator >=( const int a, const vint16& b ) { return vint16(a) >= b; }
__forceinline vboolf16 operator >=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
__forceinline vboolf16 operator >=(const vint16& a, int b) { return a >= vint16(b); }
__forceinline vboolf16 operator >=(int a, const vint16& b) { return vint16(a) >= b; }
__forceinline const vboolf16 operator > ( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
__forceinline const vboolf16 operator > ( const vint16& a, const int b ) { return a > vint16(b); }
__forceinline const vboolf16 operator > ( const int a, const vint16& b ) { return vint16(a) > b; }
__forceinline vboolf16 operator > (const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
__forceinline vboolf16 operator > (const vint16& a, int b) { return a > vint16(b); }
__forceinline vboolf16 operator > (int a, const vint16& b) { return vint16(a) > b; }
__forceinline const vboolf16 operator <=( const vint16& a, const vint16& b ) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
__forceinline const vboolf16 operator <=( const vint16& a, const int b ) { return a <= vint16(b); }
__forceinline const vboolf16 operator <=( const int a, const vint16& b ) { return vint16(a) <= b; }
__forceinline vboolf16 operator <=(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
__forceinline vboolf16 operator <=(const vint16& a, int b) { return a <= vint16(b); }
__forceinline vboolf16 operator <=(int a, const vint16& b) { return vint16(a) <= b; }
__forceinline vboolf16 eq(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboolf16 ne(const vint16& a, const vint16& b) { return _mm512_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
@@ -285,7 +320,7 @@ namespace embree
__forceinline vboolf16 uint_gt(const vboolf16 mask, const vint16& a, const vint16& b) { return _mm512_mask_cmp_epu32_mask(mask,a,b,_MM_CMPINT_GT); }
__forceinline const vint16 select( const vboolf16& m, const vint16& t, const vint16& f ) {
__forceinline vint16 select(const vboolf16& m, const vint16& t, const vint16& f) {
return _mm512_mask_or_epi32(f,m,t,t);
}
@@ -305,41 +340,39 @@ namespace embree
// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vint16 unpacklo( const vint16& a, const vint16& b ) { return _mm512_unpacklo_epi32(a.v, b.v); }
__forceinline vint16 unpackhi( const vint16& a, const vint16& b ) { return _mm512_unpackhi_epi32(a.v, b.v); }
__forceinline vint16 unpacklo(const vint16& a, const vint16& b) { return _mm512_unpacklo_epi32(a, b); }
__forceinline vint16 unpackhi(const vint16& a, const vint16& b) { return _mm512_unpackhi_epi32(a, b); }
template<size_t i>
__forceinline const vint16 shuffle( const vint16& a ) {
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(a), _MM_SHUFFLE(i, i, i, i)));
template<int i>
__forceinline vint16 shuffle(const vint16& v) {
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v), _MM_SHUFFLE(i, i, i, i)));
}
template<int A, int B, int C, int D>
__forceinline vint16 shuffle (const vint16& v) {
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v),_MM_SHUFFLE(D,C,B,A)));
template<int i0, int i1, int i2, int i3>
__forceinline vint16 shuffle(const vint16& v) {
return _mm512_castps_si512(_mm512_permute_ps(_mm512_castsi512_ps(v), _MM_SHUFFLE(i3, i2, i1, i0)));
}
template<int i>
__forceinline vint16 shuffle4(const vint16& x) {
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(x),_mm512_castsi512_ps(x),_MM_SHUFFLE(i,i,i,i)));
__forceinline vint16 shuffle4(const vint16& v) {
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(v), _mm512_castsi512_ps(v), _MM_SHUFFLE(i, i, i, i)));
}
template<int A, int B, int C, int D>
__forceinline vint16 shuffle4(const vint16& x) {
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(x),_mm512_castsi512_ps(x),_MM_SHUFFLE(D,C,B,A)));
template<int i0, int i1, int i2, int i3>
__forceinline vint16 shuffle4(const vint16& v) {
return _mm512_castps_si512(_mm512_shuffle_f32x4(_mm512_castsi512_ps(v), _mm512_castsi512_ps(v), _MM_SHUFFLE(i3, i2, i1, i0)));
}
template<int i>
__forceinline vint16 align_shift_right(const vint16& a, const vint16& b)
{
return _mm512_alignr_epi32(a,b,i);
__forceinline vint16 align_shift_right(const vint16& a, const vint16& b) {
return _mm512_alignr_epi32(a, b, i);
};
__forceinline int toScalar(const vint16& a)
{
return _mm_cvtsi128_si32(_mm512_castsi512_si128(a));
__forceinline int toScalar(const vint16& v) {
return _mm_cvtsi128_si32(_mm512_castsi512_si128(v));
}
template<int i> __forceinline const vint16 insert4(const vint16& a, const vint4& b) { return _mm512_inserti32x4(a, b, i); }
template<int i> __forceinline vint16 insert4(const vint16& a, const vint4& b) { return _mm512_inserti32x4(a, b, i); }
__forceinline size_t extract64bit(const vint16& v) {
return _mm_cvtsi128_si64(_mm512_castsi512_si128(v));
@@ -366,15 +399,15 @@ namespace embree
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__forceinline vint16 vreduce_min2(vint16 x) { return min(x,shuffle<1,0,3,2>(x)); }
__forceinline vint16 vreduce_min4(vint16 x) { x = vreduce_min2(x); return min(x,shuffle<2,3,0,1>(x)); }
__forceinline vint16 vreduce_min8(vint16 x) { x = vreduce_min4(x); return min(x,shuffle4<1,0,3,2>(x)); }
__forceinline vint16 vreduce_min (vint16 x) { x = vreduce_min8(x); return min(x,shuffle4<2,3,0,1>(x)); }
__forceinline vint16 vreduce_min2(vint16 x) { return min(x, shuffle<1,0,3,2>(x)); }
__forceinline vint16 vreduce_min4(vint16 x) { x = vreduce_min2(x); return min(x, shuffle<2,3,0,1>(x)); }
__forceinline vint16 vreduce_min8(vint16 x) { x = vreduce_min4(x); return min(x, shuffle4<1,0,3,2>(x)); }
__forceinline vint16 vreduce_min (vint16 x) { x = vreduce_min8(x); return min(x, shuffle4<2,3,0,1>(x)); }
__forceinline vint16 vreduce_max2(vint16 x) { return max(x,shuffle<1,0,3,2>(x)); }
__forceinline vint16 vreduce_max4(vint16 x) { x = vreduce_max2(x); return max(x,shuffle<2,3,0,1>(x)); }
__forceinline vint16 vreduce_max8(vint16 x) { x = vreduce_max4(x); return max(x,shuffle4<1,0,3,2>(x)); }
__forceinline vint16 vreduce_max (vint16 x) { x = vreduce_max8(x); return max(x,shuffle4<2,3,0,1>(x)); }
__forceinline vint16 vreduce_max2(vint16 x) { return max(x, shuffle<1,0,3,2>(x)); }
__forceinline vint16 vreduce_max4(vint16 x) { x = vreduce_max2(x); return max(x, shuffle<2,3,0,1>(x)); }
__forceinline vint16 vreduce_max8(vint16 x) { x = vreduce_max4(x); return max(x, shuffle4<1,0,3,2>(x)); }
__forceinline vint16 vreduce_max (vint16 x) { x = vreduce_max8(x); return max(x, shuffle4<2,3,0,1>(x)); }
__forceinline vint16 vreduce_and2(vint16 x) { return x & shuffle<1,0,3,2>(x); }
__forceinline vint16 vreduce_and4(vint16 x) { x = vreduce_and2(x); return x & shuffle<2,3,0,1>(x); }
@@ -401,36 +434,16 @@ namespace embree
/// Memory load and store operations
////////////////////////////////////////////////////////////////////////////////
template<int scale = 4>
__forceinline vint16 gather16i(const vboolf16& mask, const int *const ptr, const vint16& index) {
return _mm512_mask_i32gather_epi32(_mm512_undefined_epi32(),mask,index,ptr,scale);
}
template<int scale = 4>
__forceinline vint16 gather16i(const vboolf16& mask, vint16& dest, const int *const ptr, const vint16& index) {
return _mm512_mask_i32gather_epi32(dest,mask,index,ptr,scale);
}
template<int scale = 4>
__forceinline void scatter16i(const vboolf16& mask,int *const ptr, const vint16& index,const vint16& v) {
_mm512_mask_i32scatter_epi32((int*)ptr,mask,index,v,scale);
}
__forceinline vint16 conflict16i(const vint16& index)
__forceinline vint16 conflict(const vint16& index)
{
return _mm512_conflict_epi32(index);
}
__forceinline vint16 conflict16i(const vboolf16& mask, vint16& dest, const vint16& index)
__forceinline vint16 conflict(const vboolf16& mask, vint16& dest, const vint16& index)
{
return _mm512_mask_conflict_epi32(dest,mask,index);
}
__forceinline void compactustore16i_low(const vboolf16 mask, void *addr, const vint16& reg) {
_mm512_mask_compressstoreu_epi32(addr,mask,reg);
}
__forceinline vint16 convert_uint32_t(const __m512& f) {
return _mm512_cvtps_epu32(f);
}
@@ -467,10 +480,10 @@ namespace embree
/* this should use a vbool8 and a vint8_64...*/
template<int scale = 1, int hint = _MM_HINT_T0>
__forceinline void gather_prefetch64(void const* base_addr,const vbool16 &mask, const vint16& offset)
__forceinline void gather_prefetch64(const void* base_addr, const vbool16& mask, const vint16& offset)
{
#if defined(__AVX512PF__)
_mm512_mask_prefetch_i64gather_pd(offset,mask,base_addr,scale,hint);
_mm512_mask_prefetch_i64gather_pd(offset, mask, base_addr, scale, hint);
#endif
}
@@ -478,7 +491,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline std::ostream& operator<<(std::ostream& cout, const vint16& v)
__forceinline std::ostream& operator <<(std::ostream& cout, const vint16& v)
{
cout << "<" << v[0];
for (int i=1; i<16; i++) cout << ", " << v[i];
+251 -150
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2017 Intel Corporation //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
@@ -35,83 +35,101 @@ namespace embree
/// Constructors, Assignment & Cast Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vint ( ) {}
__forceinline vint ( const vint4& a ) { v = a.v; }
__forceinline vint4& operator=( const vint4& a ) { v = a.v; return *this; }
__forceinline vint() {}
__forceinline vint(const vint4& a) { v = a.v; }
__forceinline vint4& operator =(const vint4& a) { v = a.v; return *this; }
__forceinline vint( const __m128i a ) : v(a) {}
__forceinline operator const __m128i&( void ) const { return v; }
__forceinline operator __m128i&( void ) { return v; }
__forceinline vint(__m128i a) : v(a) {}
__forceinline operator const __m128i&() const { return v; }
__forceinline operator __m128i&() { return v; }
__forceinline vint(int a) : v(_mm_set1_epi32(a)) {}
__forceinline vint(int a, int b, int c, int d) : v(_mm_set_epi32(d, c, b, a)) {}
__forceinline vint( const int& a ) : v(_mm_shuffle_epi32(_mm_castps_si128(_mm_load_ss((float*)&a)), _MM_SHUFFLE(0, 0, 0, 0))) {}
__forceinline vint( const uint32_t& a ) : v(_mm_shuffle_epi32(_mm_castps_si128(_mm_load_ss((float*)&a)), _MM_SHUFFLE(0, 0, 0, 0))) {}
#if defined(__X86_64__)
__forceinline vint( const size_t a ) : v(_mm_set1_epi32((int)a)) {}
#endif
__forceinline vint( int a, int b, int c, int d) : v(_mm_set_epi32(d, c, b, a)) {}
__forceinline explicit vint( const __m128 a ) : v(_mm_cvtps_epi32(a)) {}
__forceinline explicit vint(__m128 a) : v(_mm_cvtps_epi32(a)) {}
#if defined(__AVX512VL__)
__forceinline explicit vint( const vboolf4 &a ) : v(_mm_movm_epi32(a)) {}
__forceinline explicit vint(const vboolf4& a) : v(_mm_movm_epi32(a)) {}
#else
__forceinline explicit vint( const vboolf4 &a ) : v(_mm_castps_si128((__m128)a)) {}
__forceinline explicit vint(const vboolf4& a) : v(_mm_castps_si128((__m128)a)) {}
#endif
__forceinline vint(long long a, long long b) : v(_mm_set_epi64x(b,a)) {}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
__forceinline vint( ZeroTy ) : v(_mm_setzero_si128()) {}
__forceinline vint( OneTy ) : v(_mm_set_epi32(1, 1, 1, 1)) {}
__forceinline vint( PosInfTy ) : v(_mm_set_epi32(pos_inf, pos_inf, pos_inf, pos_inf)) {}
__forceinline vint( NegInfTy ) : v(_mm_set_epi32(neg_inf, neg_inf, neg_inf, neg_inf)) {}
__forceinline vint( StepTy ) : v(_mm_set_epi32(3, 2, 1, 0)) {}
__forceinline vint( TrueTy ) { v = _mm_cmpeq_epi32(v,v); }
__forceinline vint(ZeroTy) : v(_mm_setzero_si128()) {}
__forceinline vint(OneTy) : v(_mm_set_epi32(1, 1, 1, 1)) {}
__forceinline vint(PosInfTy) : v(_mm_set_epi32(pos_inf, pos_inf, pos_inf, pos_inf)) {}
__forceinline vint(NegInfTy) : v(_mm_set_epi32(neg_inf, neg_inf, neg_inf, neg_inf)) {}
__forceinline vint(StepTy) : v(_mm_set_epi32(3, 2, 1, 0)) {}
__forceinline vint(ReverseStepTy) : v(_mm_set_epi32(0, 1, 2, 3)) {}
__forceinline vint(TrueTy) { v = _mm_cmpeq_epi32(v,v); }
__forceinline vint(UndefinedTy) : v(_mm_castps_si128(_mm_undefined_ps())) {}
////////////////////////////////////////////////////////////////////////////////
/// Loads and Stores
////////////////////////////////////////////////////////////////////////////////
static __forceinline vint4 load ( const void* const a ) { return _mm_load_si128((__m128i*)a); }
static __forceinline vint4 loadu( const void* const a ) { return _mm_loadu_si128((__m128i*)a); }
static __forceinline vint4 load (const void* a) { return _mm_load_si128((__m128i*)a); }
static __forceinline vint4 loadu(const void* a) { return _mm_loadu_si128((__m128i*)a); }
static __forceinline void store (void* ptr, const vint4& v) { _mm_store_si128((__m128i*)ptr,v); }
static __forceinline void storeu(void* ptr, const vint4& v) { _mm_storeu_si128((__m128i*)ptr,v); }
#if defined(__AVX512VL__)
static __forceinline vint4 load ( const vboolf4& mask, const void* const ptr ) { return _mm_mask_load_epi32 (_mm_setzero_si128(),mask,ptr); }
static __forceinline vint4 loadu( const vboolf4& mask, const void* const ptr ) { return _mm_mask_loadu_epi32(_mm_setzero_si128(),mask,ptr); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& v ) { _mm_mask_store_epi32 (ptr,mask,v); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& v ) { _mm_mask_storeu_epi32(ptr,mask,v); }
static __forceinline vint4 compact(const vboolf4& mask, vint4 &v) {
return _mm_mask_compress_epi32(v, mask, v);
}
static __forceinline vint4 compact(const vboolf4& mask, vint4 &a, const vint4& b) {
return _mm_mask_compress_epi32(a, mask, b);
}
static __forceinline vint4 load (const vboolf4& mask, const void* ptr) { return _mm_mask_load_epi32 (_mm_setzero_si128(),mask,ptr); }
static __forceinline vint4 loadu(const vboolf4& mask, const void* ptr) { return _mm_mask_loadu_epi32(_mm_setzero_si128(),mask,ptr); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& v) { _mm_mask_store_epi32 (ptr,mask,v); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& v) { _mm_mask_storeu_epi32(ptr,mask,v); }
#elif defined(__AVX__)
static __forceinline vint4 load ( const vbool4& mask, const void* const a ) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
static __forceinline vint4 loadu( const vbool4& mask, const void* const a ) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
static __forceinline vint4 load (const vbool4& mask, const void* a) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
static __forceinline vint4 loadu(const vbool4& mask, const void* a) { return _mm_castps_si128(_mm_maskload_ps((float*)a,mask)); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& i ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& i ) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& i) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& i) { _mm_maskstore_ps((float*)ptr,(__m128i)mask,_mm_castsi128_ps(i)); }
#else
static __forceinline vint4 load ( const vbool4& mask, const void* const a ) { return _mm_and_si128(_mm_load_si128 ((__m128i*)a),mask); }
static __forceinline vint4 loadu( const vbool4& mask, const void* const a ) { return _mm_and_si128(_mm_loadu_si128((__m128i*)a),mask); }
static __forceinline vint4 load (const vbool4& mask, const void* a) { return _mm_and_si128(_mm_load_si128 ((__m128i*)a),mask); }
static __forceinline vint4 loadu(const vbool4& mask, const void* a) { return _mm_and_si128(_mm_loadu_si128((__m128i*)a),mask); }
static __forceinline void store ( const vboolf4& mask, void* ptr, const vint4& i ) { store (ptr,select(mask,i,load (ptr))); }
static __forceinline void storeu( const vboolf4& mask, void* ptr, const vint4& i ) { storeu(ptr,select(mask,i,loadu(ptr))); }
static __forceinline void store (const vboolf4& mask, void* ptr, const vint4& i) { store (ptr,select(mask,i,load (ptr))); }
static __forceinline void storeu(const vboolf4& mask, void* ptr, const vint4& i) { storeu(ptr,select(mask,i,loadu(ptr))); }
#endif
#if defined(__SSE4_1__)
static __forceinline vint4 load( const unsigned char* const ptr ) {
return _mm_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr));
static __forceinline vint4 load(const unsigned char* ptr) {
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
}
static __forceinline vint4 loadu( const unsigned char* const ptr ) {
return _mm_cvtepu8_epi32(_mm_loadu_si128((__m128i*)ptr));
static __forceinline vint4 loadu(const unsigned char* ptr) {
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
}
#else
static __forceinline vint4 load(const unsigned char* ptr) {
return vint4(ptr[0],ptr[1],ptr[2],ptr[3]);
}
static __forceinline vint4 loadu(const unsigned char* ptr) {
return vint4(ptr[0],ptr[1],ptr[2],ptr[3]);
}
#endif
static __forceinline vint4 load(const unsigned short* const ptr) {
static __forceinline vint4 load(const unsigned short* ptr) {
#if defined (__SSE4_1__)
return _mm_cvtepu16_epi32(_mm_loadu_si128((__m128i*)ptr));
#else
@@ -119,7 +137,7 @@ namespace embree
#endif
}
static __forceinline void store( unsigned char* const ptr, const vint4& v ) {
static __forceinline void store(unsigned char* ptr, const vint4& v) {
#if defined(__SSE4_1__)
__m128i x = v;
x = _mm_packus_epi32(x, x);
@@ -131,12 +149,12 @@ namespace embree
#endif
}
static __forceinline void store( unsigned short* const ptr, const vint4& v ) {
static __forceinline void store(unsigned short* ptr, const vint4& v) {
for (size_t i=0;i<4;i++)
ptr[i] = (unsigned short)v[i];
}
static __forceinline vint4 load_nt (void* ptr) {
static __forceinline vint4 load_nt(void* ptr) {
#if defined(__SSE4_1__)
return _mm_stream_load_si128((__m128i*)ptr);
#else
@@ -146,26 +164,81 @@ namespace embree
static __forceinline void store_nt(void* ptr, const vint4& v) {
#if defined(__SSE4_1__)
_mm_stream_ps((float*)ptr,_mm_castsi128_ps(v));
_mm_stream_ps((float*)ptr, _mm_castsi128_ps(v));
#else
_mm_store_si128((__m128i*)ptr,v);
#endif
}
template<int scale = 4>
static __forceinline vint4 gather(const int* ptr, const vint4& index) {
#if defined(__AVX2__)
return _mm_i32gather_epi32(ptr, index, scale);
#else
return vint4(
*(int*)(((char*)ptr)+scale*index[0]),
*(int*)(((char*)ptr)+scale*index[1]),
*(int*)(((char*)ptr)+scale*index[2]),
*(int*)(((char*)ptr)+scale*index[3]));
#endif
}
template<int scale = 4>
static __forceinline vint4 gather(const vboolf4& mask, const int* ptr, const vint4& index) {
vint4 r = zero;
#if defined(__AVX512VL__)
return _mm_mmask_i32gather_epi32(r, mask, index, ptr, scale);
#elif defined(__AVX2__)
return _mm_mask_i32gather_epi32(r, ptr, index, mask, scale);
#else
if (likely(mask[0])) r[0] = *(int*)(((char*)ptr)+scale*index[0]);
if (likely(mask[1])) r[1] = *(int*)(((char*)ptr)+scale*index[1]);
if (likely(mask[2])) r[2] = *(int*)(((char*)ptr)+scale*index[2]);
if (likely(mask[3])) r[3] = *(int*)(((char*)ptr)+scale*index[3]);
return r;
#endif
}
template<int scale = 4>
static __forceinline void scatter(void* ptr, const vint4& index, const vint4& v)
{
#if defined(__AVX512VL__)
_mm_i32scatter_epi32((int*)ptr, index, v, scale);
#else
*(int*)(((char*)ptr)+scale*index[0]) = v[0];
*(int*)(((char*)ptr)+scale*index[1]) = v[1];
*(int*)(((char*)ptr)+scale*index[2]) = v[2];
*(int*)(((char*)ptr)+scale*index[3]) = v[3];
#endif
}
template<int scale = 4>
static __forceinline void scatter(const vboolf4& mask, void* ptr, const vint4& index, const vint4& v)
{
#if defined(__AVX512VL__)
_mm_mask_i32scatter_epi32((int*)ptr, mask, index, v, scale);
#else
if (likely(mask[0])) *(int*)(((char*)ptr)+scale*index[0]) = v[0];
if (likely(mask[1])) *(int*)(((char*)ptr)+scale*index[1]) = v[1];
if (likely(mask[2])) *(int*)(((char*)ptr)+scale*index[2]) = v[2];
if (likely(mask[3])) *(int*)(((char*)ptr)+scale*index[3]) = v[3];
#endif
}
#if defined(__x86_64__)
static __forceinline vint4 broadcast64(const long long &a) { return _mm_set1_epi64x(a); }
static __forceinline vint4 broadcast64(long long a) { return _mm_set1_epi64x(a); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Array Access
////////////////////////////////////////////////////////////////////////////////
__forceinline const int& operator []( const size_t index ) const { assert(index < 4); return i[index]; }
__forceinline int& operator []( const size_t index ) { assert(index < 4); return i[index]; }
__forceinline const int& operator [](size_t index) const { assert(index < 4); return i[index]; }
__forceinline int& operator [](size_t index) { assert(index < 4); return i[index]; }
friend __forceinline const vint4 select( const vboolf4& m, const vint4& t, const vint4& f ) {
friend __forceinline vint4 select(const vboolf4& m, const vint4& t, const vint4& f) {
#if defined(__AVX512VL__)
return _mm_mask_blend_epi32(m, f, t);
return _mm_mask_blend_epi32(m, (__m128i)f, (__m128i)t);
#elif defined(__SSE4_1__)
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
#else
@@ -178,113 +251,118 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vint4 asInt ( const __m128& a ) { return _mm_castps_si128(a); }
__forceinline const vint4 operator +( const vint4& a ) { return a; }
__forceinline const vint4 operator -( const vint4& a ) { return _mm_sub_epi32(_mm_setzero_si128(), a.v); }
#if defined(__AVX512VL__)
__forceinline vboolf4 asBool(const vint4& a) { return _mm_movepi32_mask(a); }
#else
__forceinline vboolf4 asBool(const vint4& a) { return _mm_castsi128_ps(a); }
#endif
__forceinline vint4 operator +(const vint4& a) { return a; }
__forceinline vint4 operator -(const vint4& a) { return _mm_sub_epi32(_mm_setzero_si128(), a); }
#if defined(__SSSE3__)
__forceinline const vint4 abs ( const vint4& a ) { return _mm_abs_epi32(a.v); }
__forceinline vint4 abs(const vint4& a) { return _mm_abs_epi32(a); }
#endif
////////////////////////////////////////////////////////////////////////////////
/// Binary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline const vint4 operator +( const vint4& a, const vint4& b ) { return _mm_add_epi32(a.v, b.v); }
__forceinline const vint4 operator +( const vint4& a, const int& b ) { return a + vint4(b); }
__forceinline const vint4 operator +( const int& a, const vint4& b ) { return vint4(a) + b; }
__forceinline vint4 operator +(const vint4& a, const vint4& b) { return _mm_add_epi32(a, b); }
__forceinline vint4 operator +(const vint4& a, int b) { return a + vint4(b); }
__forceinline vint4 operator +(int a, const vint4& b) { return vint4(a) + b; }
__forceinline const vint4 operator -( const vint4& a, const vint4& b ) { return _mm_sub_epi32(a.v, b.v); }
__forceinline const vint4 operator -( const vint4& a, const int& b ) { return a - vint4(b); }
__forceinline const vint4 operator -( const int& a, const vint4& b ) { return vint4(a) - b; }
__forceinline vint4 operator -(const vint4& a, const vint4& b) { return _mm_sub_epi32(a, b); }
__forceinline vint4 operator -(const vint4& a, int b) { return a - vint4(b); }
__forceinline vint4 operator -(int a, const vint4& b) { return vint4(a) - b; }
#if defined(__SSE4_1__)
__forceinline const vint4 operator *( const vint4& a, const vint4& b ) { return _mm_mullo_epi32(a.v, b.v); }
__forceinline vint4 operator *(const vint4& a, const vint4& b) { return _mm_mullo_epi32(a, b); }
#else
__forceinline const vint4 operator *( const vint4& a, const vint4& b ) { return vint4(a[0]*b[0],a[1]*b[1],a[2]*b[2],a[3]*b[3]); }
__forceinline vint4 operator *(const vint4& a, const vint4& b) { return vint4(a[0]*b[0],a[1]*b[1],a[2]*b[2],a[3]*b[3]); }
#endif
__forceinline const vint4 operator *( const vint4& a, const int& b ) { return a * vint4(b); }
__forceinline const vint4 operator *( const int& a, const vint4& b ) { return vint4(a) * b; }
__forceinline vint4 operator *(const vint4& a, int b) { return a * vint4(b); }
__forceinline vint4 operator *(int a, const vint4& b) { return vint4(a) * b; }
__forceinline const vint4 operator &( const vint4& a, const vint4& b ) { return _mm_and_si128(a.v, b.v); }
__forceinline const vint4 operator &( const vint4& a, const int& b ) { return a & vint4(b); }
__forceinline const vint4 operator &( const int& a, const vint4& b ) { return vint4(a) & b; }
__forceinline vint4 operator &(const vint4& a, const vint4& b) { return _mm_and_si128(a, b); }
__forceinline vint4 operator &(const vint4& a, int b) { return a & vint4(b); }
__forceinline vint4 operator &(int a, const vint4& b) { return vint4(a) & b; }
__forceinline const vint4 operator |( const vint4& a, const vint4& b ) { return _mm_or_si128(a.v, b.v); }
__forceinline const vint4 operator |( const vint4& a, const int& b ) { return a | vint4(b); }
__forceinline const vint4 operator |( const int& a, const vint4& b ) { return vint4(a) | b; }
__forceinline vint4 operator |(const vint4& a, const vint4& b) { return _mm_or_si128(a, b); }
__forceinline vint4 operator |(const vint4& a, int b) { return a | vint4(b); }
__forceinline vint4 operator |(int a, const vint4& b) { return vint4(a) | b; }
__forceinline const vint4 operator ^( const vint4& a, const vint4& b ) { return _mm_xor_si128(a.v, b.v); }
__forceinline const vint4 operator ^( const vint4& a, const int& b ) { return a ^ vint4(b); }
__forceinline const vint4 operator ^( const int& a, const vint4& b ) { return vint4(a) ^ b; }
__forceinline vint4 operator ^(const vint4& a, const vint4& b) { return _mm_xor_si128(a, b); }
__forceinline vint4 operator ^(const vint4& a, int b) { return a ^ vint4(b); }
__forceinline vint4 operator ^(int a, const vint4& b) { return vint4(a) ^ b; }
__forceinline const vint4 operator <<( const vint4& a, const int& n ) { return _mm_slli_epi32(a.v, n); }
__forceinline const vint4 operator >>( const vint4& a, const int& n ) { return _mm_srai_epi32(a.v, n); }
__forceinline vint4 operator <<(const vint4& a, int n) { return _mm_slli_epi32(a, n); }
__forceinline vint4 operator >>(const vint4& a, int n) { return _mm_srai_epi32(a, n); }
__forceinline const vint4 sll ( const vint4& a, const int& b ) { return _mm_slli_epi32(a.v, b); }
__forceinline const vint4 sra ( const vint4& a, const int& b ) { return _mm_srai_epi32(a.v, b); }
__forceinline const vint4 srl ( const vint4& a, const int& b ) { return _mm_srli_epi32(a.v, b); }
__forceinline vint4 sll (const vint4& a, int b) { return _mm_slli_epi32(a, b); }
__forceinline vint4 sra (const vint4& a, int b) { return _mm_srai_epi32(a, b); }
__forceinline vint4 srl (const vint4& a, int b) { return _mm_srli_epi32(a, b); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vint4& operator +=( vint4& a, const vint4& b ) { return a = a + b; }
__forceinline vint4& operator +=( vint4& a, const int& b ) { return a = a + b; }
__forceinline vint4& operator +=(vint4& a, const vint4& b) { return a = a + b; }
__forceinline vint4& operator +=(vint4& a, int b) { return a = a + b; }
__forceinline vint4& operator -=( vint4& a, const vint4& b ) { return a = a - b; }
__forceinline vint4& operator -=( vint4& a, const int& b ) { return a = a - b; }
__forceinline vint4& operator -=(vint4& a, const vint4& b) { return a = a - b; }
__forceinline vint4& operator -=(vint4& a, int b) { return a = a - b; }
#if defined(__SSE4_1__)
__forceinline vint4& operator *=( vint4& a, const vint4& b ) { return a = a * b; }
__forceinline vint4& operator *=( vint4& a, const int& b ) { return a = a * b; }
__forceinline vint4& operator *=(vint4& a, const vint4& b) { return a = a * b; }
__forceinline vint4& operator *=(vint4& a, int b) { return a = a * b; }
#endif
__forceinline vint4& operator &=( vint4& a, const vint4& b ) { return a = a & b; }
__forceinline vint4& operator &=( vint4& a, const int& b ) { return a = a & b; }
__forceinline vint4& operator &=(vint4& a, const vint4& b) { return a = a & b; }
__forceinline vint4& operator &=(vint4& a, int b) { return a = a & b; }
__forceinline vint4& operator |=( vint4& a, const vint4& b ) { return a = a | b; }
__forceinline vint4& operator |=( vint4& a, const int& b ) { return a = a | b; }
__forceinline vint4& operator |=(vint4& a, const vint4& b) { return a = a | b; }
__forceinline vint4& operator |=(vint4& a, int b) { return a = a | b; }
__forceinline vint4& operator <<=( vint4& a, const int& b ) { return a = a << b; }
__forceinline vint4& operator >>=( vint4& a, const int& b ) { return a = a >> b; }
__forceinline vint4& operator <<=(vint4& a, int b) { return a = a << b; }
__forceinline vint4& operator >>=(vint4& a, int b) { return a = a >> b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators + Select
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX512VL__)
__forceinline const vboolf4 operator ==( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
__forceinline const vboolf4 operator !=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
__forceinline const vboolf4 operator < ( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
__forceinline const vboolf4 operator >=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
__forceinline const vboolf4 operator > ( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
__forceinline const vboolf4 operator <=( const vint4& a, const vint4& b ) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
__forceinline vboolf4 operator ==(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_EQ); }
__forceinline vboolf4 operator !=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_NE); }
__forceinline vboolf4 operator < (const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LT); }
__forceinline vboolf4 operator >=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GE); }
__forceinline vboolf4 operator > (const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_GT); }
__forceinline vboolf4 operator <=(const vint4& a, const vint4& b) { return _mm_cmp_epi32_mask(a,b,_MM_CMPINT_LE); }
#else
__forceinline const vboolf4 operator ==( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
__forceinline const vboolf4 operator !=( const vint4& a, const vint4& b ) { return !(a == b); }
__forceinline const vboolf4 operator < ( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmplt_epi32(a, b)); }
__forceinline const vboolf4 operator >=( const vint4& a, const vint4& b ) { return !(a < b); }
__forceinline const vboolf4 operator > ( const vint4& a, const vint4& b ) { return _mm_castsi128_ps(_mm_cmpgt_epi32(a, b)); }
__forceinline const vboolf4 operator <=( const vint4& a, const vint4& b ) { return !(a > b); }
__forceinline vboolf4 operator ==(const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); }
__forceinline vboolf4 operator !=(const vint4& a, const vint4& b) { return !(a == b); }
__forceinline vboolf4 operator < (const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmplt_epi32(a, b)); }
__forceinline vboolf4 operator >=(const vint4& a, const vint4& b) { return !(a < b); }
__forceinline vboolf4 operator > (const vint4& a, const vint4& b) { return _mm_castsi128_ps(_mm_cmpgt_epi32(a, b)); }
__forceinline vboolf4 operator <=(const vint4& a, const vint4& b) { return !(a > b); }
#endif
__forceinline const vboolf4 operator ==( const vint4& a, const int& b ) { return a == vint4(b); }
__forceinline const vboolf4 operator ==( const int& a, const vint4& b ) { return vint4(a) == b; }
__forceinline vboolf4 operator ==(const vint4& a, int b) { return a == vint4(b); }
__forceinline vboolf4 operator ==(int a, const vint4& b) { return vint4(a) == b; }
__forceinline const vboolf4 operator !=( const vint4& a, const int& b ) { return a != vint4(b); }
__forceinline const vboolf4 operator !=( const int& a, const vint4& b ) { return vint4(a) != b; }
__forceinline vboolf4 operator !=(const vint4& a, int b) { return a != vint4(b); }
__forceinline vboolf4 operator !=(int a, const vint4& b) { return vint4(a) != b; }
__forceinline const vboolf4 operator < ( const vint4& a, const int& b ) { return a < vint4(b); }
__forceinline const vboolf4 operator < ( const int& a, const vint4& b ) { return vint4(a) < b; }
__forceinline vboolf4 operator < (const vint4& a, int b) { return a < vint4(b); }
__forceinline vboolf4 operator < (int a, const vint4& b) { return vint4(a) < b; }
__forceinline const vboolf4 operator >=( const vint4& a, const int& b ) { return a >= vint4(b); }
__forceinline const vboolf4 operator >=( const int& a, const vint4& b ) { return vint4(a) >= b; }
__forceinline vboolf4 operator >=(const vint4& a, int b) { return a >= vint4(b); }
__forceinline vboolf4 operator >=(int a, const vint4& b) { return vint4(a) >= b; }
__forceinline const vboolf4 operator > ( const vint4& a, const int& b ) { return a > vint4(b); }
__forceinline const vboolf4 operator > ( const int& a, const vint4& b ) { return vint4(a) > b; }
__forceinline vboolf4 operator > (const vint4& a, int b) { return a > vint4(b); }
__forceinline vboolf4 operator > (int a, const vint4& b) { return vint4(a) > b; }
__forceinline const vboolf4 operator <=( const vint4& a, const int& b ) { return a <= vint4(b); }
__forceinline const vboolf4 operator <=( const int& a, const vint4& b ) { return vint4(a) <= b; }
__forceinline vboolf4 operator <=(const vint4& a, int b) { return a <= vint4(b); }
__forceinline vboolf4 operator <=(int a, const vint4& b) { return vint4(a) <= b; }
__forceinline vboolf4 eq(const vint4& a, const vint4& b) { return a == b; }
__forceinline vboolf4 ne(const vint4& a, const vint4& b) { return a != b; }
@@ -310,7 +388,7 @@ namespace embree
#endif
template<int mask>
__forceinline const vint4 select(const vint4& t, const vint4& f) {
__forceinline vint4 select(const vint4& t, const vint4& f) {
#if defined(__SSE4_1__)
return _mm_castps_si128(_mm_blend_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), mask));
#else
@@ -319,78 +397,101 @@ namespace embree
}
#if defined(__SSE4_1__)
__forceinline const vint4 min( const vint4& a, const vint4& b ) { return _mm_min_epi32(a.v, b.v); }
__forceinline const vint4 max( const vint4& a, const vint4& b ) { return _mm_max_epi32(a.v, b.v); }
__forceinline vint4 min(const vint4& a, const vint4& b) { return _mm_min_epi32(a, b); }
__forceinline vint4 max(const vint4& a, const vint4& b) { return _mm_max_epi32(a, b); }
__forceinline const vint4 umin( const vint4& a, const vint4& b ) { return _mm_min_epu32(a.v, b.v); }
__forceinline const vint4 umax( const vint4& a, const vint4& b ) { return _mm_max_epu32(a.v, b.v); }
__forceinline vint4 umin(const vint4& a, const vint4& b) { return _mm_min_epu32(a, b); }
__forceinline vint4 umax(const vint4& a, const vint4& b) { return _mm_max_epu32(a, b); }
#else
__forceinline const vint4 min( const vint4& a, const vint4& b ) { return select(a < b,a,b); }
__forceinline const vint4 max( const vint4& a, const vint4& b ) { return select(a < b,b,a); }
__forceinline vint4 min(const vint4& a, const vint4& b) { return select(a < b,a,b); }
__forceinline vint4 max(const vint4& a, const vint4& b) { return select(a < b,b,a); }
#endif
__forceinline const vint4 min( const vint4& a, const int& b ) { return min(a,vint4(b)); }
__forceinline const vint4 min( const int& a, const vint4& b ) { return min(vint4(a),b); }
__forceinline const vint4 max( const vint4& a, const int& b ) { return max(a,vint4(b)); }
__forceinline const vint4 max( const int& a, const vint4& b ) { return max(vint4(a),b); }
__forceinline vint4 min(const vint4& a, int b) { return min(a,vint4(b)); }
__forceinline vint4 min(int a, const vint4& b) { return min(vint4(a),b); }
__forceinline vint4 max(const vint4& a, int b) { return max(a,vint4(b)); }
__forceinline vint4 max(int a, const vint4& b) { return max(vint4(a),b); }
////////////////////////////////////////////////////////////////////////////////
// Movement/Shifting/Shuffling Functions
////////////////////////////////////////////////////////////////////////////////
__forceinline vint4 unpacklo( const vint4& a, const vint4& b ) { return _mm_castps_si128(_mm_unpacklo_ps(_mm_castsi128_ps(a.v), _mm_castsi128_ps(b.v))); }
__forceinline vint4 unpackhi( const vint4& a, const vint4& b ) { return _mm_castps_si128(_mm_unpackhi_ps(_mm_castsi128_ps(a.v), _mm_castsi128_ps(b.v))); }
__forceinline vint4 unpacklo(const vint4& a, const vint4& b) { return _mm_castps_si128(_mm_unpacklo_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b))); }
__forceinline vint4 unpackhi(const vint4& a, const vint4& b) { return _mm_castps_si128(_mm_unpackhi_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b))); }
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vint4 shuffle( const vint4& a ) {
return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
template<int i0, int i1, int i2, int i3>
__forceinline vint4 shuffle(const vint4& v) {
return _mm_shuffle_epi32(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const vint4 shuffle( const vint4& a, const vint4& b ) {
template<int i0, int i1, int i2, int i3>
__forceinline vint4 shuffle(const vint4& a, const vint4& b) {
return _mm_castps_si128(_mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b), _MM_SHUFFLE(i3, i2, i1, i0)));
}
#if defined(__SSE3__)
template<> __forceinline const vint4 shuffle<0, 0, 2, 2>( const vint4& a ) { return _mm_castps_si128(_mm_moveldup_ps(_mm_castsi128_ps(a))); }
template<> __forceinline const vint4 shuffle<1, 1, 3, 3>( const vint4& a ) { return _mm_castps_si128(_mm_movehdup_ps(_mm_castsi128_ps(a))); }
template<> __forceinline const vint4 shuffle<0, 1, 0, 1>( const vint4& a ) { return _mm_castpd_si128(_mm_movedup_pd (_mm_castsi128_pd(a))); }
template<> __forceinline vint4 shuffle<0, 0, 2, 2>(const vint4& v) { return _mm_castps_si128(_mm_moveldup_ps(_mm_castsi128_ps(v))); }
template<> __forceinline vint4 shuffle<1, 1, 3, 3>(const vint4& v) { return _mm_castps_si128(_mm_movehdup_ps(_mm_castsi128_ps(v))); }
template<> __forceinline vint4 shuffle<0, 1, 0, 1>(const vint4& v) { return _mm_castpd_si128(_mm_movedup_pd (_mm_castsi128_pd(v))); }
#endif
template<size_t i0> __forceinline const vint4 shuffle( const vint4& b ) {
return shuffle<i0,i0,i0,i0>(b);
template<int i>
__forceinline vint4 shuffle(const vint4& v) {
return shuffle<i,i,i,i>(v);
}
#if defined(__SSE4_1__)
template<size_t src> __forceinline int extract( const vint4& b ) { return _mm_extract_epi32(b, src); }
template<size_t dst> __forceinline const vint4 insert( const vint4& a, const int b ) { return _mm_insert_epi32(a, b, dst); }
template<int src> __forceinline int extract(const vint4& b) { return _mm_extract_epi32(b, src); }
template<int dst> __forceinline vint4 insert(const vint4& a, const int b) { return _mm_insert_epi32(a, b, dst); }
#else
template<size_t src> __forceinline int extract( const vint4& b ) { return b[src]; }
template<size_t dst> __forceinline const vint4 insert( const vint4& a, const int b ) { vint4 c = a; c[dst] = b; return c; }
template<int src> __forceinline int extract(const vint4& b) { return b[src&3]; }
template<int dst> __forceinline vint4 insert(const vint4& a, int b) { vint4 c = a; c[dst&3] = b; return c; }
#endif
template<> __forceinline int extract<0>( const vint4& b ) { return _mm_cvtsi128_si32(b); }
template<> __forceinline int extract<0>(const vint4& b) { return _mm_cvtsi128_si32(b); }
__forceinline int toScalar(const vint4& a) { return _mm_cvtsi128_si32(a); }
__forceinline int toScalar(const vint4& v) { return _mm_cvtsi128_si32(v); }
__forceinline size_t toSizeT(const vint4& v) {
#if defined(__WIN32__) && !defined(__X86_64__) // win32 workaround
return toScalar(v);
#else
return _mm_cvtsi128_si64(v);
#endif
}
#if defined(__AVX512VL__)
__forceinline vint4 permute(const vint4 &a, const vint4 &index) {
return _mm_castps_si128(_mm_permutevar_ps(_mm_castsi128_ps(a),index));
}
template<int i>
__forceinline vint4 align_shift_right(const vint4& a, const vint4& b) {
return _mm_alignr_epi32(a, b, i);
}
#endif
////////////////////////////////////////////////////////////////////////////////
/// Reductions
////////////////////////////////////////////////////////////////////////////////
#if defined(__SSE4_1__)
__forceinline const vint4 vreduce_min(const vint4& v) { vint4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
__forceinline const vint4 vreduce_max(const vint4& v) { vint4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
__forceinline const vint4 vreduce_add(const vint4& v) { vint4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
__forceinline vint4 vreduce_min(const vint4& v) { vint4 h = min(shuffle<1,0,3,2>(v),v); return min(shuffle<2,3,0,1>(h),h); }
__forceinline vint4 vreduce_max(const vint4& v) { vint4 h = max(shuffle<1,0,3,2>(v),v); return max(shuffle<2,3,0,1>(h),h); }
__forceinline vint4 vreduce_add(const vint4& v) { vint4 h = shuffle<1,0,3,2>(v) + v ; return shuffle<2,3,0,1>(h) + h ; }
__forceinline int reduce_min(const vint4& v) { return toScalar(vreduce_min(v)); }
__forceinline int reduce_max(const vint4& v) { return toScalar(vreduce_max(v)); }
__forceinline int reduce_add(const vint4& v) { return toScalar(vreduce_add(v)); }
__forceinline size_t select_min(const vint4& v) { return __bsf(movemask(v == vreduce_min(v))); }
__forceinline size_t select_max(const vint4& v) { return __bsf(movemask(v == vreduce_max(v))); }
__forceinline size_t select_min(const vint4& v) { return bsf(movemask(v == vreduce_min(v))); }
__forceinline size_t select_max(const vint4& v) { return bsf(movemask(v == vreduce_max(v))); }
__forceinline size_t select_min(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(pos_inf)); return __bsf(movemask(valid & (a == vreduce_min(a)))); }
__forceinline size_t select_max(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(neg_inf)); return __bsf(movemask(valid & (a == vreduce_max(a)))); }
__forceinline size_t select_min(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(pos_inf)); return bsf(movemask(valid & (a == vreduce_min(a)))); }
__forceinline size_t select_max(const vboolf4& valid, const vint4& v) { const vint4 a = select(valid,v,vint4(neg_inf)); return bsf(movemask(valid & (a == vreduce_max(a)))); }
#else
@@ -486,7 +587,7 @@ namespace embree
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
inline std::ostream& operator<<(std::ostream& cout, const vint4& a) {
inline std::ostream& operator <<(std::ostream& cout, const vint4& a) {
return cout << "<" << a[0] << ", " << a[1] << ", " << a[2] << ", " << a[3] << ">";
}
}
Loaded 100 of 920 files, more files were not shown because too many files have changed in this diff. Show more