From ccfdc8cd62590a320089788448db85b39622d65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= 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 8403f4e..aa5d8e7 100644 --- a/common/math/math.h +++ b/common/math/math.h @@ -166,7 +166,10 @@ namespace embree __forceinline int64_t min(int64_t a, int64_t b) { return a=0 && i 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 ef9cd77..ae2e632 100644 --- a/common/sys/sysinfo.cpp +++ b/common/sys/sysinfo.cpp @@ -10,6 +10,9 @@ #include typedef cpuset_t cpu_set_t; #endif +#if defined(__HAIKU__) +#include +#endif //////////////////////////////////////////////////////////////////////////////// /// All Platforms @@ -45,6 +48,10 @@ namespace embree return "Unix (32bit)"; #elif defined(__UNIX__) && defined(__X86_64__) return "Unix (64bit)"; +#elif defined(__HAIKU__) && !defined(__X86_64__) + return "Haiku (32bit)"; +#elif defined(__HAIKU__) && defined(__X86_64__) + return "Haiku (64bit)"; #else return "Unknown"; #endif @@ -478,7 +485,7 @@ namespace embree /// Linux Platform //////////////////////////////////////////////////////////////////////////////// -#if defined(__LINUX__) +#if defined(__LINUX__) || defined(__HAIKU__) #include #include @@ -597,6 +604,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.30.2 From e3f86c3fb531e757357505c0da1f0144df18c5c9 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Wed, 12 Jan 2022 16:40:24 +1000 Subject: Use workaround for Haiku diff --git a/common/simd/vint4_sse2.h b/common/simd/vint4_sse2.h index 9814d5c..2a50cca 100644 --- a/common/simd/vint4_sse2.h +++ b/common/simd/vint4_sse2.h @@ -452,7 +452,7 @@ 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 +#if (defined(__WIN32__) || defined(__HAIKU__)) && !defined(__X86_64__) // win32 workaround return toScalar(v); #else return _mm_cvtsi128_si64(v); -- 2.30.2