diff options
Diffstat (limited to 'tensorflow/core/platform/posix/port.cc')
-rw-r--r-- | tensorflow/core/platform/posix/port.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/core/platform/posix/port.cc b/tensorflow/core/platform/posix/port.cc index 6cba40ccfc..09f69a95c1 100644 --- a/tensorflow/core/platform/posix/port.cc +++ b/tensorflow/core/platform/posix/port.cc @@ -37,7 +37,8 @@ limitations under the License. #ifdef TF_USE_SNAPPY #include "snappy.h" #endif -#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) \ + || defined(__HAIKU__) #include <thread> #endif @@ -61,7 +62,8 @@ int NumSchedulableCPUs() { } perror("sched_getaffinity"); #endif -#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) \ + || defined(__HAIKU__) unsigned int count = std::thread::hardware_concurrency(); if (count > 0) return static_cast<int>(count); #endif |