mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 19:20:08 +02:00
Embree3: bump, cpucount (#5575)
This commit is contained in:
@@ -8,16 +8,16 @@ processors with support for SSE, AVX, AVX2, and AVX-512. Embree \
|
||||
supports runtime code selection to choose the traversal and build \
|
||||
algorithms that best matches the instruction set of your CPU"
|
||||
HOMEPAGE="https://embree.github.io"
|
||||
COPYRIGHT="2013-2019 Intel Corporation"
|
||||
COPYRIGHT="2013-2020 Intel Corporation"
|
||||
LICENSE="Apache v2"
|
||||
REVISION="4"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/embree/embree/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="1305b7818cf1b388133c92397c9f259dba432df3b4a70f4b147d2b0e0aa35c79"
|
||||
CHECKSUM_SHA256="0c9e760b06e178197dd29c9a54f08ff7b184b0487b5ba8b8be058e219e23336e"
|
||||
SOURCE_FILENAME="embree-v$portVersion.tar.gz"
|
||||
PATCHES="embree-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="!x86"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
libVersion="$portVersion"
|
||||
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
||||
@@ -88,7 +88,9 @@ INSTALL()
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
$libDir/cmake \
|
||||
$docDir \
|
||||
$manDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
@@ -1,14 +1,14 @@
|
||||
From f84bf30cb06b3fb70e374415377399f966d84d98 Mon Sep 17 00:00:00 2001
|
||||
From 4c5ad4e7ddc1a9c1ecf77f43efcf243bc63bed0b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Sat, 24 Aug 2019 09:32:55 +0200
|
||||
Subject: Applied patches
|
||||
|
||||
|
||||
diff --git a/common/math/math.h b/common/math/math.h
|
||||
index caef5aa..2007bda 100644
|
||||
index 5af0691..eb7e522 100644
|
||||
--- a/common/math/math.h
|
||||
+++ b/common/math/math.h
|
||||
@@ -176,7 +176,10 @@ namespace embree
|
||||
@@ -166,7 +166,10 @@ namespace embree
|
||||
__forceinline int64_t min(int64_t a, int64_t b) { return a<b ? a:b; }
|
||||
__forceinline float min(float a, float b) { return a<b ? a:b; }
|
||||
__forceinline double min(double a, double b) { return a<b ? a:b; }
|
||||
@@ -20,7 +20,7 @@ index caef5aa..2007bda 100644
|
||||
__forceinline size_t min(size_t a, size_t b) { return a<b ? a:b; }
|
||||
#endif
|
||||
|
||||
@@ -193,7 +196,10 @@ namespace embree
|
||||
@@ -183,7 +186,10 @@ namespace embree
|
||||
__forceinline int64_t max(int64_t a, int64_t b) { return a<b ? b:a; }
|
||||
__forceinline float max(float a, float b) { return a<b ? b:a; }
|
||||
__forceinline double max(double a, double b) { return a<b ? b:a; }
|
||||
@@ -33,10 +33,10 @@ index caef5aa..2007bda 100644
|
||||
#endif
|
||||
|
||||
diff --git a/common/sys/alloc.cpp b/common/sys/alloc.cpp
|
||||
index e24df4e..8f0453a 100644
|
||||
index 4e89282..bafa02f 100644
|
||||
--- a/common/sys/alloc.cpp
|
||||
+++ b/common/sys/alloc.cpp
|
||||
@@ -253,6 +253,7 @@ namespace embree
|
||||
@@ -240,6 +240,7 @@ namespace embree
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ index e24df4e..8f0453a 100644
|
||||
/* try direct huge page allocation first */
|
||||
if (isHugePageCandidate(bytes))
|
||||
{
|
||||
@@ -270,6 +271,7 @@ namespace embree
|
||||
@@ -257,6 +258,7 @@ namespace embree
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -53,10 +53,10 @@ index e24df4e..8f0453a 100644
|
||||
/* fallback to 4k pages */
|
||||
void* ptr = (char*) mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
diff --git a/common/sys/array.h b/common/sys/array.h
|
||||
index d64ebb1..a0b9a5c 100644
|
||||
index 6f6f98e..53eca57 100644
|
||||
--- a/common/sys/array.h
|
||||
+++ b/common/sys/array.h
|
||||
@@ -152,7 +152,7 @@ namespace embree
|
||||
@@ -139,7 +139,7 @@ namespace embree
|
||||
__forceinline Ty& operator[](const unsigned i) { assert(i<N); return data[i]; }
|
||||
__forceinline const Ty& operator[](const unsigned i) const { assert(i<N); return data[i]; }
|
||||
|
||||
@@ -66,10 +66,10 @@ index d64ebb1..a0b9a5c 100644
|
||||
__forceinline const Ty& operator[](const size_t i) const { assert(i<N); return data[i]; }
|
||||
#endif
|
||||
diff --git a/common/sys/intrinsics.h b/common/sys/intrinsics.h
|
||||
index 5ec477c..8355bd8 100644
|
||||
index 3f0619c..275dd21 100644
|
||||
--- a/common/sys/intrinsics.h
|
||||
+++ b/common/sys/intrinsics.h
|
||||
@@ -87,7 +87,7 @@ namespace embree
|
||||
@@ -74,7 +74,7 @@ namespace embree
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ index 5ec477c..8355bd8 100644
|
||||
__forceinline size_t bsf(size_t v) {
|
||||
#if defined(__AVX2__)
|
||||
return _tzcnt_u64(v);
|
||||
@@ -111,7 +111,7 @@ namespace embree
|
||||
@@ -98,7 +98,7 @@ namespace embree
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ index 5ec477c..8355bd8 100644
|
||||
__forceinline size_t bscf(size_t& v)
|
||||
{
|
||||
size_t i = bsf(v);
|
||||
@@ -407,6 +407,12 @@ namespace embree
|
||||
@@ -394,6 +394,12 @@ namespace embree
|
||||
return _mm_popcnt_u32(in);
|
||||
}
|
||||
|
||||
@@ -101,10 +101,10 @@ index 5ec477c..8355bd8 100644
|
||||
__forceinline size_t popcnt(size_t in) {
|
||||
return _mm_popcnt_u64(in);
|
||||
diff --git a/common/sys/platform.h b/common/sys/platform.h
|
||||
index 477fa6f..c0778e8 100644
|
||||
index 96f9aab..8b9a988 100644
|
||||
--- a/common/sys/platform.h
|
||||
+++ b/common/sys/platform.h
|
||||
@@ -86,7 +86,7 @@
|
||||
@@ -73,7 +73,7 @@
|
||||
#endif
|
||||
|
||||
/* try to detect other Unix systems */
|
||||
@@ -114,10 +114,10 @@ index 477fa6f..c0778e8 100644
|
||||
# define __UNIX__
|
||||
# endif
|
||||
diff --git a/common/sys/sysinfo.cpp b/common/sys/sysinfo.cpp
|
||||
index e5aa1d9..e070000 100644
|
||||
index eb0a10e..13e58ce 100644
|
||||
--- a/common/sys/sysinfo.cpp
|
||||
+++ b/common/sys/sysinfo.cpp
|
||||
@@ -53,6 +53,10 @@ namespace embree
|
||||
@@ -45,6 +45,10 @@ namespace embree
|
||||
return "Unix (32bit)";
|
||||
#elif defined(__UNIX__) && defined(__X86_64__)
|
||||
return "Unix (64bit)";
|
||||
@@ -128,7 +128,7 @@ index e5aa1d9..e070000 100644
|
||||
#else
|
||||
return "Unknown";
|
||||
#endif
|
||||
@@ -435,7 +439,7 @@ namespace embree
|
||||
@@ -480,7 +484,7 @@ namespace embree
|
||||
/// Linux Platform
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -138,10 +138,10 @@ index e5aa1d9..e070000 100644
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
diff --git a/kernels/builders/bvh_builder_sah.h b/kernels/builders/bvh_builder_sah.h
|
||||
index 6418a9b..5de64ff 100644
|
||||
index 79ccdf9..6451594 100644
|
||||
--- a/kernels/builders/bvh_builder_sah.h
|
||||
+++ b/kernels/builders/bvh_builder_sah.h
|
||||
@@ -55,7 +55,7 @@ namespace embree
|
||||
@@ -43,7 +43,7 @@ namespace embree
|
||||
{
|
||||
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxBranchingFactor)) branchingFactor = settings.maxBranchingFactor;
|
||||
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxDepth )) maxDepth = settings.maxDepth;
|
||||
@@ -151,5 +151,40 @@ index 6418a9b..5de64ff 100644
|
||||
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxLeafSize )) maxLeafSize = settings.maxLeafSize;
|
||||
if (RTC_BUILD_ARGUMENTS_HAS(settings,traversalCost )) travCost = settings.traversalCost;
|
||||
--
|
||||
2.23.0
|
||||
2.28.0
|
||||
|
||||
|
||||
From 94bf7fdde66dc3021eb01e8a5632de069226288d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Tue, 5 Jan 2021 20:45:01 +0100
|
||||
Subject: CPU count
|
||||
|
||||
|
||||
diff --git a/common/sys/sysinfo.cpp b/common/sys/sysinfo.cpp
|
||||
index 13e58ce..272e00d 100644
|
||||
--- a/common/sys/sysinfo.cpp
|
||||
+++ b/common/sys/sysinfo.cpp
|
||||
@@ -10,6 +10,9 @@
|
||||
#include <pthread_np.h>
|
||||
typedef cpuset_t cpu_set_t;
|
||||
#endif
|
||||
+#if defined(__HAIKU__)
|
||||
+#include <kernel/OS.h>
|
||||
+#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// All Platforms
|
||||
@@ -603,6 +606,10 @@ namespace embree
|
||||
#if defined(__MACOSX__)
|
||||
nThreads = sysconf(_SC_NPROCESSORS_ONLN); // does not work in Linux LXC container
|
||||
assert(nThreads);
|
||||
+#elif defined(__HAIKU__)
|
||||
+ system_info info;
|
||||
+ get_system_info( &info );
|
||||
+ nThreads = info.cpu_count;
|
||||
#else
|
||||
cpu_set_t set;
|
||||
if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0)
|
||||
--
|
||||
2.28.0
|
||||
|
||||
Reference in New Issue
Block a user