aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/lib
diff options
context:
space:
mode:
authorGravatar Xiaoqiang Zheng <zhengxq@google.com>2016-10-28 10:29:28 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-10-28 11:38:26 -0700
commite2d51a87f0727f8537b46048d8241aeebb6e48d6 (patch)
tree64c075f59bae00706a009e5d1ed15aaff6adc6ff /tensorflow/stream_executor/lib
parentf80ef2d696456c970956f47e7d5aa88bc7ccbdce (diff)
Merge changes from github.
Change: 137532946
Diffstat (limited to 'tensorflow/stream_executor/lib')
-rw-r--r--tensorflow/stream_executor/lib/process_state.cc9
-rw-r--r--tensorflow/stream_executor/lib/static_threadlocal.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/tensorflow/stream_executor/lib/process_state.cc b/tensorflow/stream_executor/lib/process_state.cc
index fcf8847b3e..be4295b65f 100644
--- a/tensorflow/stream_executor/lib/process_state.cc
+++ b/tensorflow/stream_executor/lib/process_state.cc
@@ -15,8 +15,13 @@ limitations under the License.
#include "tensorflow/stream_executor/lib/process_state.h"
+#if defined(PLATFORM_WINDOWS)
+#include <direct.h>
+#include <stdlib.h>
+#include <WinSock2.h>
+#else
#include <unistd.h>
-
+#endif
#include <memory>
namespace perftools {
@@ -27,7 +32,7 @@ string Hostname() {
char hostname[1024];
gethostname(hostname, sizeof hostname);
hostname[sizeof hostname - 1] = 0;
- return hostname;
+ return std::string(hostname);
}
bool GetCurrentDirectory(string* dir) {
diff --git a/tensorflow/stream_executor/lib/static_threadlocal.h b/tensorflow/stream_executor/lib/static_threadlocal.h
index a839420240..6e2bd0d455 100644
--- a/tensorflow/stream_executor/lib/static_threadlocal.h
+++ b/tensorflow/stream_executor/lib/static_threadlocal.h
@@ -16,6 +16,10 @@ limitations under the License.
#ifndef TENSORFLOW_STREAM_EXECUTOR_LIB_STATIC_THREADLOCAL_H_
#define TENSORFLOW_STREAM_EXECUTOR_LIB_STATIC_THREADLOCAL_H_
+#ifdef _MSC_VER
+#define __thread __declspec(thread)
+#endif
+
// For POD types in TLS mode, s_obj_VAR is the thread-local variable.
#define SE_STATIC_THREAD_LOCAL_POD(_Type_, _var_) \
static __thread _Type_ s_obj_##_var_; \