Compare commits

..
Author SHA1 Message Date
cbenthin d3d9f6225b Merge remote-tracking branch 'origin/devel' into cbenthin 2017-09-28 16:14:37 +02:00
cbenthin 4794b0e55f updates 2017-09-22 06:57:45 -07:00
cbenthin 8968597c20 updates to sub-pixel pattern 2017-09-22 11:36:53 +02:00
cbenthin 95a4cbcb94 updates 2017-09-22 10:40:44 +02:00
cbenthin 5da02d0800 some MSAA experiments 2017-09-22 10:04:36 +02:00
cbenthin 1a47e44b72 sync with devel 2017-09-21 18:23:40 +02:00
922 changed files with 37178 additions and 104595 deletions
-7
View File
@@ -5,10 +5,3 @@ x64
*.ncb
.*sw?
.DS_Store
kernels/config.h
kernels/hash.h
build
models
tbb
doc/intelstyle
+63 -520
View File
@@ -1,538 +1,81 @@
## ======================================================================== ##
## 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. ##
## ======================================================================== ##
# have to disable proxy servers as otherwise CDash commits fail
before_script:
- export http_proxy=
- export https_proxy=
build-centos6-gcc:
script:
- "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC isa:SSE2 tasking:TBB"
#####################################################################
# Continuous Test
# WINDOWS
####################################################################
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]
.windows-x64-RelWithDebInfo-V140-AVX2-TBB:
script: "./sripts/test.py platform:x64 build:RelWithDebInfo compiler:V140 isa:AVX2 tasking:TBB intensive:OFF"
tags: [win, v140]
#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]
.windows-x64-RelWithDebInfo-V120-AVX2-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:V120 isa:AVX2 tasking:TBB intensive:OFF"
tags: [win, v120]
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]
.windows-x64-RelWithDebInfo-ICC17-AVX2-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 isa:AVX2 tasking:TBB intensive:OFF"
tags: [win, icc17]
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]
.windows-x64-RelWithDebInfo-CLANG-AVX2-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG isa:AVX2 tasking:TBB intensive:OFF"
tags: [win, clang]
#####################################################################
# Release Builds
# MACOSX
####################################################################
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
.macosx-x64-RelWithDebInfo-CLANG-AVX2:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG isa:AVX2 tasking:TBB intensive:OFF"
tags: [macosx, clang]
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
.macosx-x64-RelWithDebInfo-ICC16-AVX2:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC16 isa:AVX2 tasking:TBB intensive:OFF"
tags: [macosx, icc16]
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
#####################################################################
# LINUX
####################################################################
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
.linux-x64-RelWithDebInfo-CLANG-AVX2-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG isa:AVX2 tasking:TBB intensive:OFF"
tags: [linux, clang]
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
.linux-x64-RelWithDebInfo-GCC-AVX2-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:GCC isa:AVX2 tasking:TBB intensive:OFF"
tags: [linux, gcc]
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
.linux-x64-RelWithDebInfo-ICC17-AVX512KNL-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 isa:AVX512KNL tasking:TBB intensive:OFF"
tags: [linux, icc17]
.linux-x64-RelWithDebInfo-ICC17-AVX2-TBB-KLOCKWORK:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 isa:AVX2 tasking:TBB klocwork:ON"
tags: [linux, icc17, klocwork]
.linux-knl-x64-RelWithDebInfo-ICC17-AVX512KNL-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 isa:AVX512KNL tasking:TBB intensive:OFF"
tags: [linux, knl, icc17]
.linux-knl-x64-RelWithDebInfo-CLANG4-AVX512KNL-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 isa:AVX512KNL tasking:TBB intensive:OFF"
tags: [linux, knl, clang4]
.linux-skx-x64-RelWithDebInfo-ICC17-AVX512SKX-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:ICC17 isa:AVX512SKX tasking:TBB intensive:OFF"
tags: [linux, skx, icc17]
.linux-skx-x64-RelWithDebInfo-CLANG4-AVX512SKX-TBB:
script: "./scripts/test.py platform:x64 build:RelWithDebInfo compiler:CLANG4 isa:AVX512SKX tasking:TBB intensive:OFF"
tags: [linux, skx, clang4]
-149
View File
@@ -1,153 +1,6 @@
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).
@@ -169,7 +22,6 @@ Version History
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.
@@ -628,4 +480,3 @@ 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
+93 -130
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -14,11 +14,10 @@
## limitations under the License. ##
## ======================================================================== ##
SET(EMBREE_VERSION_MAJOR 3)
SET(EMBREE_VERSION_MINOR 3)
SET(EMBREE_VERSION_PATCH 0)
SET(EMBREE_VERSION_NOTE "")
SET(EMBREE_VERSION_MAJOR 2)
SET(EMBREE_VERSION_MINOR 17)
SET(EMBREE_VERSION_PATCH 1)
SET(EMBREE_VERSION_NOTE "-alpha.0")
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)
@@ -27,24 +26,6 @@ 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)
@@ -63,19 +44,20 @@ ENDIF()
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/rtcore_version.h.in"
"${PROJECT_SOURCE_DIR}/include/embree3/rtcore_version.h"
"${PROJECT_SOURCE_DIR}/include/embree2/rtcore_version.h"
)
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/hash.h.in"
"${PROJECT_SOURCE_DIR}/kernels/hash.h"
"${PROJECT_BINARY_DIR}/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 NEW)
cmake_policy(SET CMP0042 OLD)
endif()
ENDIF(COMMAND cmake_policy)
@@ -87,6 +69,7 @@ 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})
@@ -117,27 +100,30 @@ 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_FILTER_FUNCTION "Enables filter functions." ON)
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_IGNORE_INVALID_RAYS "Ignores invalid rays." OFF) # FIXME: enable by default?
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_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_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_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_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_TASKING_SYSTEM "TBB" CACHE STRING "Selects tasking system")
IF (WIN32)
@@ -168,103 +154,35 @@ ENDIF()
CONFIGURE_FILE(
"${PROJECT_SOURCE_DIR}/kernels/config.h.in"
"${PROJECT_SOURCE_DIR}/kernels/config.h"
"${PROJECT_BINARY_DIR}/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 "DEFAULT" CACHE STRING "Selects highest ISA to support.")
ELSE()
SET(EMBREE_MAX_ISA "NONE" CACHE STRING "Selects highest ISA to support.")
ELSE()
SET(EMBREE_MAX_ISA "AVX2" CACHE STRING "Selects highest ISA to support.")
ENDIF()
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX DEFAULT)
SET_PROPERTY(CACHE EMBREE_MAX_ISA PROPERTY STRINGS NONE SSE2 SSE4.2 AVX AVX2 AVX512KNL AVX512SKX)
IF (EMBREE_MAX_ISA STREQUAL "NONE")
TRY_COMPILE(COMPILER_SUPPORTS_AVX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX})
TRY_COMPILE(COMPILER_SUPPORTS_AVX2 ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX2})
TRY_COMPILE(COMPILER_SUPPORTS_AVX512KNL ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512KNL})
TRY_COMPILE(COMPILER_SUPPORTS_AVX512SKX ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/common/cmake/check_isa.cpp COMPILE_DEFINITIONS ${FLAGS_AVX512SKX})
OPTION(EMBREE_ISA_SSE2 "Enables SSE2 ISA." ON)
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
IF (WIN32 OR APPLE)
OPTION(EMBREE_ISA_AVX512KNL "Enables AVX512 ISA for Knights Landing." OFF)
OPTION(EMBREE_ISA_AVX512SKX "Enables AVX512 ISA for Skylake." OFF)
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})
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)
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)
@@ -316,9 +234,54 @@ ELSE()
ENDIF ()
ENDIF()
IF(CMAKE_CXX_COMPILER_WRAPPER STREQUAL "CrayPrgEnv")
SET(EMBREE_ISA_SSE42 OFF)
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)
##############################################################
# ISA configuration continued
@@ -332,7 +295,6 @@ SET(AVX512KNL 4)
SET(AVX512SKX 5)
UNSET(FLAGS_LOWEST)
SET(ISA_LOWEST_AVX 2)
IF (EMBREE_ISA_SSE2)
ADD_DEFINITIONS(-DEMBREE_TARGET_SSE2)
@@ -357,7 +319,6 @@ 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 ()
@@ -367,7 +328,6 @@ 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 ()
@@ -386,7 +346,6 @@ 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 ()
@@ -401,6 +360,9 @@ 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})
@@ -419,6 +381,7 @@ 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-2018 Intel Corporation ##
## 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. ##
@@ -16,7 +16,7 @@
set(CTEST_PROJECT_NAME "Embree")
set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
set(TEST_MODELS_HASH ba1bd24186ccdf939d2e749a514f81718f3a2b20)
set(TEST_MODELS_HASH 01ada7ec1ace15ddba73aaab3f53ac6aac6a0309)
IF (NOT CTEST_DROP_SITE)
set(CTEST_DROP_METHOD "http")
+2563 -1392
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
+3 -2
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -28,4 +28,5 @@ ADD_LIBRARY(algorithms OBJECT
)
SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common)
SET_PROPERTY(TARGET algorithms APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}")
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -39,7 +39,7 @@ namespace embree
return sequential_filter(data,begin,end,predicate);
/* calculate number of tasks to use */
enum { MAX_TASKS = 64 };
enum { MAX_TASKS = 512 };
const Index numThreads = TaskScheduler::threadCount();
const Index numBlocks = (end-begin+minStepSize-1)/minStepSize;
const Index taskCount = min(numThreads,numBlocks,(Index)MAX_TASKS);
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -16,10 +16,10 @@
#pragma once
#include "../tasking/taskscheduler.h"
#include "../common/tasking/taskscheduler.h"
#include "../sys/array.h"
#include "../math/math.h"
#include "../math/range.h"
#include "../common/math/range.h"
namespace embree
{
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -35,7 +35,7 @@ namespace embree
{
public:
enum { MAX_TASKS = 64 };
enum { MAX_TASKS = 512 };
__forceinline ParallelForForState ()
: taskCount(0) {}
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -17,7 +17,7 @@
#pragma once
#include "parallel_for.h"
#include "../math/range.h"
#include "../common/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_(64);
ALIGNED_CLASS;
private:
static const size_t MAX_TASKS = 64;
static const size_t MAX_TASKS = 512;
T* array;
size_t N;
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -23,7 +23,7 @@ namespace embree
template<typename Value>
struct ParallelPrefixSumState
{
enum { MAX_TASKS = 64 };
enum { MAX_TASKS = 512 };
Value counts[MAX_TASKS];
Value sums [MAX_TASKS];
};
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+9 -20
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -266,7 +266,7 @@ namespace embree
template<typename Ty, typename Key>
class ParallelRadixSort
{
static const size_t MAX_TASKS = 64;
static const size_t MAX_TASKS = 512;
static const size_t BITS = 8;
static const size_t BUCKETS = (1 << BITS);
typedef unsigned int TyRadixCount[BUCKETS];
@@ -275,17 +275,10 @@ 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)
: radixCount(nullptr), src(src), tmp(tmp), N(N) {}
void sort(const size_t blockSize)
ParallelRadixSort (Ty* const src, Ty* const tmp, const size_t N, const size_t blockSize)
: radixCount(nullptr), src(src), tmp(tmp), N(N)
{
assert(blockSize > 0);
@@ -303,12 +296,6 @@ namespace embree
tbbRadixSort(numThreads);
}
}
~ParallelRadixSort()
{
alignedFree(radixCount);
radixCount = nullptr;
}
private:
@@ -415,7 +402,7 @@ namespace embree
void tbbRadixSort(const size_t numTasks)
{
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount),64);
radixCount = (TyRadixCount*) alignedMalloc(MAX_TASKS*sizeof(TyRadixCount));
if (sizeof(Key) == sizeof(uint32_t)) {
tbbRadixIteration(0*BITS,0,src,tmp,numTasks);
@@ -434,6 +421,8 @@ namespace embree
tbbRadixIteration(6*BITS,0,src,tmp,numTasks);
tbbRadixIteration(7*BITS,1,tmp,src,numTasks);
}
alignedFree(radixCount);
radixCount = nullptr;
}
private:
@@ -446,13 +435,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).sort(blockSize);
ParallelRadixSort<Ty,Ty>(src,tmp,N,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).sort(blockSize);
ParallelRadixSort<Ty,Key>(src,tmp,N,blockSize);
}
template<typename Ty>
-88
View File
@@ -1,88 +0,0 @@
## ======================================================================== ##
## 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-2018 Intel Corporation ##
## 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. ##
+15 -13
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -51,10 +51,13 @@ IF (WIN32)
SET(TBB_ARCH ia32)
ENDIF()
# precompiled TBB packages currently only support VC12 and VC14
IF (MSVC12)
IF (MSVC10)
SET(TBB_VCVER vc10)
ELSEIF (MSVC11)
SET(TBB_VCVER vc11)
ELSEIF (MSVC12)
SET(TBB_VCVER vc12)
ELSEIF(MSVC14)
ELSE()
SET(TBB_VCVER vc14)
ENDIF()
@@ -70,8 +73,8 @@ 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} ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} ${EMBREE_TBB_ROOT}/lib 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)
ENDIF()
ELSE ()
@@ -96,7 +99,7 @@ ELSE ()
FIND_LIBRARY(TBB_LIBRARY tbb)
FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake AND EXISTS ${EMBREE_TBB_ROOT}/src/tbb/tbb_version.h)
ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
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)
@@ -146,14 +149,13 @@ MARK_AS_ADVANCED(TBB_LIBRARY_MALLOC)
# Install TBB
##############################################################
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)
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 (EMBREE_ZIP_MODE)
IF (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()
+3 -5
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -23,10 +23,8 @@ 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 "\\(\\)::" 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
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
message(WARNING "\nProblematic global variable in non-SSE code:\n" ${line})
endif()
endif()
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
+18 -35
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -14,18 +14,15 @@
## limitations under the License. ##
## ======================================================================== ##
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")
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")
IF (WIN32)
@@ -46,9 +43,6 @@ IF (WIN32)
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
@@ -59,7 +53,6 @@ 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
@@ -81,23 +74,21 @@ 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
@@ -108,40 +99,32 @@ ELSE()
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} -O2") # allow inlining of intrinsics
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_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)
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()
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(APPLE)
ENDIF()
+3 -5
View File
@@ -13,12 +13,10 @@
## See the License for the specific language governing permissions and ##
## limitations under the License. ##
## ======================================================================== ##
SET(FLAGS_SSE2 "-target-cpu=x86_64")
SET(FLAGS_SSE42 "NOT_SUPPORTED")
SET(FLAGS_SSE2 "-target-cpu=xeon")
SET(FLAGS_SSE42 "-target-cpu=interlagos")
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-2018 Intel Corporation ##
## 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. ##
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
+1 -1
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
+8 -6
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -45,13 +45,15 @@ 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_FILTER_FUNCTION @EMBREE_FILTER_FUNCTION@)
SET(EMBREE_INTERSECTION_FILTER @EMBREE_INTERSECTION_FILTER@)
SET(EMBREE_INTERSECTION_FILTER_RESTORE @EMBREE_INTERSECTION_FILTER_RESTORE@)
SET(EMBREE_IGNORE_INVALID_RAYS @EMBREE_IGNORE_INVALID_RAYS@)
SET(EMBREE_TASKING_SYSTEM @EMBREE_TASKING_SYSTEM@)
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_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_USER @EMBREE_GEOMETRY_USER@)
SET(EMBREE_RAY_PACKETS @EMBREE_RAY_PACKETS@)
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -14,36 +14,29 @@
## limitations under the License. ##
## ======================================================================== ##
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")
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")
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
@@ -58,19 +51,17 @@ 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} -O2") # allow inlining of intrinsics
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") # enable full optimizations
SET(CMAKE_CXX_FLAGS_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-2018 Intel Corporation ##
## 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. ##
@@ -14,27 +14,20 @@
## limitations under the License. ##
## ======================================================================== ##
MACRO(_SET_IF_EMPTY VAR VALUE)
IF(NOT ${VAR})
SET(${VAR} "${VALUE}")
ENDIF()
ENDMACRO()
IF (WIN32)
_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(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(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()
@@ -50,9 +43,6 @@ IF (WIN32)
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
@@ -64,7 +54,6 @@ IF (WIN32)
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
@@ -87,47 +76,35 @@ 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_IF_EMPTY(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
SET(FLAGS_SSE2 "-xssse3") # on MacOSX ICC does not support SSE2
ELSE()
_SET_IF_EMPTY(FLAGS_SSE2 "-xsse2")
SET(FLAGS_SSE2 "-xsse2")
ENDIF()
_SET_IF_EMPTY(FLAGS_SSE42 "-xsse4.2")
_SET_IF_EMPTY(FLAGS_AVX "-xAVX")
_SET_IF_EMPTY(FLAGS_AVX2 "-xCORE-AVX2")
_SET_IF_EMPTY(FLAGS_AVX512KNL "-xMIC-AVX512")
_SET_IF_EMPTY(FLAGS_AVX512SKX "-xCORE-AVX512")
SET(FLAGS_SSE42 "-xsse4.2")
SET(FLAGS_AVX "-xAVX")
SET(FLAGS_AVX2 "-xCORE-AVX2")
SET(FLAGS_AVX512KNL "-xMIC-AVX512")
SET(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)
@@ -148,7 +125,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} -O2") # allow inlining of intrinsics
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # disable all optimizations
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG") # disable assertions
@@ -157,7 +134,6 @@ ELSE()
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=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
@@ -168,8 +144,7 @@ ELSE()
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=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-2018 Intel Corporation ##
## 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. ##
@@ -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]+)" DUMMY "${ISPC_OUTPUT}")
STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
SET(ISPC_VERSION ${CMAKE_MATCH_1})
IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
MESSAGE(FATAL_ERROR "ISPC ${ISPC_VERSION} is too old. You need at least ISPC ${ISPC_VERSION_REQUIRED}.")
MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
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)
SET(ISPC_OPT_FLAGS -O2 -g)
ENDIF()
IF (WIN32)
+3 -6
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -33,11 +33,9 @@ MACRO(DISABLE_STACK_PROTECTOR_FOR_FILE file)
SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS "/GS-")
ENDIF()
ENDMACRO()
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} ${FLAGS_SSE2}")
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
@@ -47,13 +45,12 @@ 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-2018 Intel Corporation ##
## 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. ##
@@ -15,7 +15,7 @@
## ======================================================================== ##
# optionally use static runtime library
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." OFF)
OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." ON)
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})
+32 -40
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -39,10 +39,7 @@ ENDIF()
##############################################################
# Install Headers
##############################################################
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(DIRECTORY include/embree2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT devel)
##############################################################
# Install Models
@@ -58,6 +55,11 @@ 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
##############################################################
@@ -94,11 +96,11 @@ ENDIF()
# why does this have to be so complicated...
IF (WIN32)
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX})
SET(EMBREE_LIBRARY_NAME ${CMAKE_IMPORT_LIBRARY_PREFIX}embree${CMAKE_IMPORT_LIBRARY_SUFFIX})
ELSEIF (APPLE)
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree.${EMBREE_CONFIG_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
ELSE()
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${EMBREE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
SET(EMBREE_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}embree${CMAKE_SHARED_LIBRARY_SUFFIX}.${EMBREE_CONFIG_VERSION})
ENDIF()
IF (WIN32 OR EMBREE_ZIP_MODE)
@@ -109,7 +111,7 @@ IF (WIN32 OR EMBREE_ZIP_MODE)
SET(EMBREE_RELATIV_ROOT_DIR ".")
ELSE()
SET(EMBREE_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/embree-${EMBREE_VERSION}")
FILE(RELATIVE_PATH EMBREE_RELATIV_ROOT_DIR "/${EMBREE_CMAKECONFIG_DIR}" "/")
SET(EMBREE_RELATIV_ROOT_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)
@@ -127,7 +129,8 @@ 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 FALSE) # we strip already as a post_build step
SET(CPACK_STRIP_FILES TRUE) # do not disable, stripping symbols is important for security reasons
SET(CMAKE_STRIP "${PROJECT_SOURCE_DIR}/scripts/strip.sh") # needs this to properly strip under MacOSX
SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})
@@ -146,9 +149,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)
@@ -159,34 +162,28 @@ IF(WIN32)
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ARCH x64)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} x64")
ELSE()
SET(ARCH 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)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME} Win32")
ENDIF()
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_GENERATOR WIX)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\Embree${EMBREE_VERSION_MAJOR} ${ARCH}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Intel\\\\Embree v${EMBREE_VERSION} ${ARCH}")
SET(CPACK_WIX_PRODUCT_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_NUMBER}")
SET(CPACK_WIX_UPGRADE_GUID "331BD5A9-DAD6-486B-A435-18AAB80${EMBREE_VERSION_MAJOR}0000") # upgrade as long as major version is the same
SET(CPACK_WIX_CMAKE_PACKAGE_REGISTRY TRUE)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.msi ${EMBREE_SIGN_FILE})
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})
ENDIF()
ELSE()
SET(CPACK_GENERATOR ZIP)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.${VCVER}.windows")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.windows")
SET(CPACK_MONOLITHIC_INSTALL 1)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_win.bat ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.zip)
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})
ENDIF()
ENDIF()
@@ -198,22 +195,22 @@ ELSEIF(APPLE)
IF (NOT EMBREE_ZIP_MODE)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
SET(CPACK_GENERATOR productbuild)
SET(CPACK_GENERATOR PackageMaker)
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.embree3.xxx in pkgutil
SET(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.embree2.xxx in pkgutil
SET(CPACK_OSX_PACKAGE_VERSION 10.7)
IF (EMBREE_TESTING_PACKAGE)
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_macosx.sh ${CMAKE_BUILD_TYPE} ${CPACK_PACKAGE_FILE_NAME}.pkg ${EMBREE_SIGN_FILE})
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)
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 ${EMBREE_SIGN_FILE})
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)
ENDIF()
ENDIF()
@@ -223,7 +220,6 @@ 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)
@@ -231,11 +227,7 @@ 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
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()
STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
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/)
@@ -245,7 +237,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} ${EMBREE_VERSION_MAJOR} ${EMBREE_SIGN_FILE})
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION})
ENDIF()
ELSE()
@@ -253,7 +245,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} ${EMBREE_SIGN_FILE})
ADD_TEST(NAME "BuildPackage" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/package_linux.sh ${EMBREE_ZIP_MODE} ${EMBREE_VERSION})
ENDIF()
ENDIF()
+66 -108
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -14,132 +14,86 @@
## limitations under the License. ##
## ======================================================================== ##
IF(NOT BUILD_TESTING)
SET(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
ENDIF()
INCLUDE(CTest)
IF (WIN32)
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
ELSE()
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
ENDIF()
IF (BUILD_TESTING)
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)
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_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_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}
--reference ${reference}
--modeldir ${EMBREE_MODEL_DIR}
--model default
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})
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()
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 default
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
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()
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)
IF (WIN32)
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
ELSE()
SET(MY_PROJECT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
ENDIF()
MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)
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}
--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)
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
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 ${model}
--sde ${EMBREE_TESTING_SDE}
--execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
ENDIF()
ENDIF()
ENDMACRO()
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}")
@@ -156,6 +110,11 @@ IF (EMBREE_TESTING_MODEL_DIR AND EMBREE_TESTING_INTENSITY GREATER 0)
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)
@@ -169,19 +128,18 @@ ELSE()
ENDIF()
# 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()
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 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)
+13 -13
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -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 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)
SIGN_TARGET(${TUTORIAL_NAME})
ENDMACRO ()
MACRO (ADD_TUTORIAL_ISPC TUTORIAL_NAME)
IF (EMBREE_ISPC_SUPPORT)
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})
SET_PROPERTY(TARGET ${TUTORIAL_NAME} PROPERTY FOLDER tutorials/single)
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}")
IF (EMBREE_ISPC_SUPPORT AND EMBREE_RAY_PACKETS)
ADD_EMBREE_ISPC_EXECUTABLE(${TUTORIAL_NAME}_ispc ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.ispc)
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree image tutorial_ispc noise noise_ispc)
TARGET_LINK_LIBRARIES(${TUTORIAL_NAME}_ispc embree tutorial image tutorial_device_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)
SIGN_TARGET(${TUTORIAL_NAME}_ispc)
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}_ispc" "${TUTORIAL_NAME}_ispc")
ENDIF()
SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE)
ENDMACRO ()
+1 -7
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -20,9 +20,3 @@ 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-2018 Intel Corporation //
// 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. //
+5 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -32,9 +32,9 @@ namespace embree
class ParseLocation
{
public:
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) {}
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) {}
std::string str() const
{
@@ -49,6 +49,7 @@ 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 */
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -8
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -16,10 +16,3 @@
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()
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -11
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -60,11 +60,6 @@ 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
@@ -189,10 +184,6 @@ 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) {
@@ -207,7 +198,6 @@ 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-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -26,11 +26,11 @@
namespace embree
{
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
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
/* we consider floating point numbers in that range as valid input numbers */
static MAYBE_UNUSED float FLT_LARGE = 1.844E18f;
static float FLT_LARGE = 1.844E18f;
struct TrueTy {
__forceinline operator bool( ) const { return true; }
-143
View File
@@ -1,143 +0,0 @@
// ======================================================================== //
// 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;
}
+2 -64
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -109,56 +109,6 @@ 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)
@@ -169,8 +119,7 @@ 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;
@@ -246,12 +195,6 @@ 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)
{
@@ -280,11 +223,6 @@ 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;
+1 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -157,5 +157,4 @@ namespace embree
/*! Shortcuts for common linear spaces. */
typedef LinearSpace2<Vec2f> LinearSpace2f;
typedef LinearSpace2<Vec2fa> LinearSpace2fa;
}
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+4 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -270,8 +270,9 @@ namespace embree
__forceinline float select(bool s, float t, float f) { return s ? t : f; }
__forceinline float lerp(const float v0, const float v1, const float t) {
return madd(1.0f-t,v0,t*v1);
template<typename V>
__forceinline V lerp(const V& v0, const V& v1, const float t) {
return madd(V(1.0f-t),v0,t*v1);
}
template<typename T>
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+2 -50
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -20,8 +20,6 @@
namespace embree
{
struct Vec2fa;
////////////////////////////////////////////////////////////////////////////////
/// Generic 2D vector Class
////////////////////////////////////////////////////////////////////////////////
@@ -42,8 +40,6 @@ 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; }
@@ -136,20 +132,12 @@ 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); }
@@ -175,11 +163,6 @@ 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);
@@ -203,34 +186,3 @@ 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
@@ -1,310 +0,0 @@
// ======================================================================== //
// 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;
}
+1 -9
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -144,14 +144,6 @@ 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
////////////////////////////////////////////////////////////////////////////////
+4 -4
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3ba
{
ALIGNED_STRUCT_(16);
ALIGNED_STRUCT;
union {
__m128 m128;
@@ -48,9 +48,9 @@ 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&() const { return m128; }
__forceinline operator __m128&() { return m128; }
+7 -24
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3fa
{
ALIGNED_STRUCT_(16);
ALIGNED_STRUCT;
typedef float Scalar;
enum { N = 3 };
@@ -56,14 +56,7 @@ 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) {
#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 Vec3fa& other, const float w1) { m128 = other.m128; w = w1; }
//__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)) {}
@@ -88,7 +81,7 @@ namespace embree
}
static __forceinline Vec3fa loadu( const void* const a ) {
return Vec3fa(_mm_loadu_ps((float*)a));
return Vec3fa(_mm_and_ps(_mm_loadu_ps((float*)a),_mm_castsi128_ps(_mm_set_epi32(0, -1, -1, -1))));
}
static __forceinline void storeu ( void* ptr, const Vec3fa& v ) {
@@ -248,13 +241,7 @@ namespace embree
/// Reductions
////////////////////////////////////////////////////////////////////////////////
__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_add(const Vec3fa& v) { return v.x+v.y+v.z; }
__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); }
@@ -338,10 +325,6 @@ namespace embree
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);
@@ -357,11 +340,11 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined (__SSE4_1__)
__forceinline Vec3fa trunc( const Vec3fa& a ) { return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); }
//__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 Vec3fa trunc( const Vec3fa& a ) { return Vec3fa(truncf(a.x),truncf(a.y),truncf(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
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -28,7 +28,7 @@ namespace embree
struct __aligned(16) Vec3ia
{
ALIGNED_STRUCT_(16);
ALIGNED_STRUCT;
union {
__m128i m128;
+1 -1
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
+1 -6
View File
@@ -1,5 +1,5 @@
## ======================================================================== ##
## Copyright 2009-2018 Intel Corporation ##
## 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. ##
@@ -16,9 +16,4 @@
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()
+1 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -28,13 +28,11 @@
#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-2018 Intel Corporation //
// 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. //
@@ -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"
+23 -39
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -33,62 +33,46 @@
# 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 = andn(valid1, valid2);
closure(valid2, i);
valid1 = valid1 & !valid2;
closure(valid2,i);
}
}
/* 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 */
/* foreach unique */
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 = andn(valid1, valid2);
closure(valid2, i, j);
valid1 = 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[2*VSIZEX];
__aligned(64) int V[2*VSIZEX];
@@ -99,15 +83,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-2018 Intel Corporation //
// 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. //
@@ -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)),
+3 -3
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -33,8 +33,8 @@ namespace embree
}
#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__)
+4 -12
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -69,19 +69,13 @@ namespace embree
template<int N> using vreal = vfloat<N>;
template<int N> using vbool = vboolf<N>;
/* Varying size constants */
#if defined(__AVX512VL__) // SKX
const int VSIZEX = 8; // default size
const int VSIZEL = 16; // large size
#elif defined(__AVX512F__) // KNL
/* Maximum supported varying size */
#if defined(__AVX512F__)
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) */
@@ -115,7 +109,6 @@ 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;
@@ -132,12 +125,11 @@ namespace embree
typedef vboolf<16> vboolf16;
typedef vboold<16> vboold16;
/* Default shortcuts */
/* Maximum 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;
+4 -6
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -55,8 +55,8 @@ 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
}
@@ -91,8 +91,6 @@ namespace embree
__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 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; }
@@ -145,7 +143,7 @@ namespace embree
__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 size_t popcnt (const vboold4& a) { return __popcnt((size_t)_mm256_movemask_pd(a)); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
+2 -10
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -64,14 +64,6 @@ namespace embree
__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;
}
};
////////////////////////////////////////////////////////////////////////////////
@@ -122,7 +114,7 @@ namespace embree
__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 popcnt (const vboold4& a) { return __popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
+2 -10
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -72,14 +72,6 @@ namespace embree
__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;
}
};
////////////////////////////////////////////////////////////////////////////////
@@ -130,7 +122,7 @@ namespace embree
__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 popcnt (const vboold8& a) { return __popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
+2 -2
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -131,7 +131,7 @@ namespace embree
__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 popcnt (const vboolf16& a) { return __popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Convertion Operations
+2 -13
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -43,9 +43,6 @@ 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);
@@ -67,14 +64,6 @@ namespace embree
__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;
}
};
////////////////////////////////////////////////////////////////////////////////
@@ -125,7 +114,7 @@ namespace embree
__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 popcnt (const vboolf4& a) { return __popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
+8 -10
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -43,13 +43,13 @@ namespace embree
__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)]) {}
: 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)]) {}
: 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]; }
: 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 {
@@ -84,8 +84,6 @@ namespace embree
__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
@@ -119,7 +117,7 @@ namespace embree
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)));
return _mm_shuffle_epi32(v, _MM_SHUFFLE(i3, i2, i1, i0));
}
template<int i0, int i1, int i2, int i3>
@@ -161,7 +159,7 @@ namespace embree
__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]); }
#endif
+4 -6
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -55,8 +55,8 @@ 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
}
@@ -103,8 +103,6 @@ namespace embree
__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 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; }
@@ -176,7 +174,7 @@ namespace embree
__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 size_t popcnt (const vboolf8& a) { return __popcnt((size_t)_mm256_movemask_ps(a)); }
////////////////////////////////////////////////////////////////////////////////
/// Get/Set Functions
+2 -13
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -43,9 +43,6 @@ 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);
@@ -67,14 +64,6 @@ namespace embree
__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;
}
};
////////////////////////////////////////////////////////////////////////////////
@@ -125,7 +114,7 @@ namespace embree
__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 popcnt (const vboolf8& a) { return __popcnt(a.v); }
////////////////////////////////////////////////////////////////////////////////
/// Conversion Operations
+14 -36
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -20,7 +20,7 @@ namespace embree
{
/* 4-wide AVX 64-bit double type */
template<>
struct vdouble<4>
struct vdouble<4>
{
typedef vboold4 Bool;
@@ -87,7 +87,6 @@ namespace embree
_mm256_storeu_pd(ptr, v);
}
static __forceinline vdouble4 broadcast(const void* a) { return _mm256_set1_pd(*(double*)a); }
////////////////////////////////////////////////////////////////////////////////
/// Array Access
@@ -101,11 +100,6 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
#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); }
@@ -145,22 +139,6 @@ namespace embree
__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
////////////////////////////////////////////////////////////////////////////////
@@ -186,19 +164,19 @@ namespace embree
////////////////////////////////////////////////////////////////////////////////
#if defined(__AVX512VL__)
__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); }
__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 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); }
__forceinline vboold4 operator ==(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a,b,_CMP_EQ_UQ); }
__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_OQ); }
__forceinline vboold4 operator >=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a,b,_CMP_GE_OQ); }
__forceinline vboold4 operator > (const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a,b,_CMP_GT_OQ); }
__forceinline vboold4 operator <=(const vdouble4& a, const vdouble4& b) { return _mm256_cmp_pd(a,b,_CMP_LE_OQ); }
#endif
__forceinline vboold4 operator ==(const vdouble4& a, double b) { return a == vdouble4(b); }
+3 -16
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -20,7 +20,7 @@ namespace embree
{
/* 8-wide AVX-512 64-bit double type */
template<>
struct vdouble<8>
struct vdouble<8>
{
typedef vboold8 Bool;
@@ -119,7 +119,6 @@ namespace embree
return _mm512_mask_compress_pd(a, mask, b);
}
static __forceinline vdouble8 broadcast(const void* a) { return _mm512_set1_pd(*(double*)a); }
////////////////////////////////////////////////////////////////////////////////
/// Array Access
@@ -134,9 +133,7 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vdouble8 asDouble(const vllong8& a) { return _mm512_castsi512_pd(a); }
__forceinline vllong8 asLLong (const vdouble8& a) { return _mm512_castpd_si512(a); }
__forceinline vdouble8 asDouble (const __m512& a) { return _mm512_castps_pd(a); }
__forceinline vdouble8 operator +(const vdouble8& a) { return a; }
__forceinline vdouble8 operator -(const vdouble8& a) { return _mm512_sub_pd(_mm512_setzero_pd(), a); }
@@ -192,16 +189,6 @@ namespace embree
__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); }
////////////////////////////////////////////////////////////////////////////////
/// Assignment Operators
////////////////////////////////////////////////////////////////////////////////
+15 -22
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -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;
@@ -44,8 +44,7 @@ namespace embree
__forceinline vfloat(const __m512& t) { v = t; }
__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);
}
@@ -90,14 +89,10 @@ namespace embree
v = _mm512_castpd_ps(aa);
}
__forceinline explicit vfloat(const vint16& a) {
__forceinline explicit vfloat(const __m512i& a) {
v = _mm512_cvtepi32_ps(a);
}
__forceinline explicit vfloat(const vuint16& a) {
v = _mm512_cvtepu32_ps(a);
}
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
@@ -191,9 +186,7 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__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 vfloat16 asFloat(const __m512i& a) { return _mm512_castsi512_ps(a); }
__forceinline vfloat16 operator +(const vfloat16& a) { return a; }
__forceinline vfloat16 operator -(const vfloat16& a) { return _mm512_mul_ps(a,vfloat16(-1)); }
@@ -459,29 +452,29 @@ namespace embree
}
__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));
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), 0xb1));
}
__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));
return _mm512_castsi512_ps(_mm512_mask_shuffle_epi32(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), 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));
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xaaaa), _mm512_castps_si512(b), 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));
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x5555), _mm512_castps_si512(a), 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));
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(a), mm512_int2mask(0xcc), _mm512_castps_si512(b), 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));
return _mm512_castsi512_ps(_mm512_mask_permutex_epi64(_mm512_castps_si512(b), mm512_int2mask(0x33), _mm512_castps_si512(a), 0x4e));
}
__forceinline vfloat16 permute(vfloat16 v, __m512i index) {
@@ -630,25 +623,25 @@ namespace embree
__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)
+9 -38
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -44,14 +44,7 @@ namespace embree
__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 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);
}
__forceinline explicit vfloat(__m128i a) : v(_mm_cvtepi32_ps(a)) {}
////////////////////////////////////////////////////////////////////////////////
/// Constants
@@ -117,16 +110,6 @@ namespace embree
#endif
}
#if defined(__SSE4_1__)
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)));
@@ -138,20 +121,10 @@ namespace embree
}
#endif
#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 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__)
@@ -194,7 +167,7 @@ namespace embree
static __forceinline void scatter(void* ptr, const vint4& index, const vfloat4& v)
{
#if defined(__AVX512VL__)
_mm_i32scatter_ps((float*)ptr, index, v, scale);
_mm_i32scatter_ps((float*)ptr,index,v,scale);
#else
*(float*)(((char*)ptr)+scale*index[0]) = v[0];
*(float*)(((char*)ptr)+scale*index[1]) = v[1];
@@ -207,7 +180,7 @@ namespace embree
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);
_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];
@@ -246,9 +219,7 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__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 asFloat(const __m128i& a) { return _mm_castsi128_ps(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))); }
@@ -675,13 +646,13 @@ 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));
}
////////////////////////////////////////////////////////////////////////////////
+11 -31
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -86,14 +86,6 @@ namespace embree
return _mm256_broadcast_ps((__m128*)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)));
@@ -101,14 +93,6 @@ namespace embree
return vfloat8(vfloat4::load(ptr),vfloat4::load(ptr+4));
#endif
}
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); }
@@ -189,7 +173,7 @@ namespace embree
static __forceinline void scatter(void* ptr, const vint8& ofs, const vfloat8& v)
{
#if defined(__AVX512VL__)
_mm256_i32scatter_ps((float*)ptr, 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];
@@ -206,7 +190,7 @@ namespace embree
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);
_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];
@@ -242,10 +226,6 @@ namespace embree
__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));
@@ -416,12 +396,12 @@ namespace embree
return _mm256_mask_blend_ps(m, f, t);
}
#else
__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 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_OQ); }
__forceinline vboolf8 operator < (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LT_OQ); }
__forceinline vboolf8 operator >=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_GE_OQ); }
__forceinline vboolf8 operator > (const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_GT_OQ); }
__forceinline vboolf8 operator <=(const vfloat8& a, const vfloat8& b) { return _mm256_cmp_ps(a, b, _CMP_LE_OQ); }
__forceinline vfloat8 select(const vboolf8& m, const vfloat8& t, const vfloat8& f) {
return _mm256_blendv_ps(f, t, m);
@@ -670,14 +650,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));
}
+4 -8
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -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;
@@ -102,10 +102,7 @@ namespace embree
static __forceinline vint16 load (const void* addr) { return _mm512_load_si512((int*)addr); }
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 load(const unsigned short* ptr) { return _mm512_cvtepu16_epi32(*(__m256i*)ptr); }
static __forceinline vint16 loadu(const void* addr) { return _mm512_loadu_si512(addr); }
@@ -190,8 +187,7 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
__forceinline vboolf16 asBool(const vint16& a) { return _mm512_movepi32_mask(a); }
__forceinline vint16 asInt (const __m512& a) { return _mm512_castps_si512(a); }
__forceinline vint16 operator +(const vint16& a) { return a; }
__forceinline vint16 operator -(const vint16& a) { return _mm512_sub_epi32(_mm512_setzero_epi32(), a); }
+14 -68
View File
@@ -1,5 +1,5 @@
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// 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. //
@@ -53,19 +53,15 @@ namespace embree
__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(ReverseStepTy) : v(_mm_set_epi32(0, 1, 2, 3)) {}
__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(UndefinedTy) : v(_mm_castps_si128(_mm_undefined_ps())) {}
@@ -108,25 +104,14 @@ namespace embree
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* ptr) {
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
return _mm_cvtepu8_epi32(_mm_load_si128((__m128i*)ptr));
}
static __forceinline vint4 loadu(const unsigned char* ptr) {
return _mm_cvtepu8_epi32(_mm_loadl_epi64((__m128i*)ptr));
return _mm_cvtepu8_epi32(_mm_loadu_si128((__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* ptr) {
@@ -199,32 +184,6 @@ namespace embree
#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(long long a) { return _mm_set1_epi64x(a); }
#endif
@@ -238,7 +197,7 @@ namespace embree
friend __forceinline vint4 select(const vboolf4& m, const vint4& t, const vint4& f) {
#if defined(__AVX512VL__)
return _mm_mask_blend_epi32(m, (__m128i)f, (__m128i)t);
return _mm_mask_blend_epi32(m, f, t);
#elif defined(__SSE4_1__)
return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m));
#else
@@ -251,12 +210,7 @@ namespace embree
/// Unary Operators
////////////////////////////////////////////////////////////////////////////////
#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 asInt(const __m128& a) { return _mm_castps_si128(a); }
__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__)
@@ -454,14 +408,6 @@ namespace embree
__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) {
@@ -487,11 +433,11 @@ namespace embree
__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

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