diff options
author | Xiaoqiang Zheng <zhengxq@google.com> | 2016-10-28 10:29:28 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-10-28 11:38:26 -0700 |
commit | e2d51a87f0727f8537b46048d8241aeebb6e48d6 (patch) | |
tree | 64c075f59bae00706a009e5d1ed15aaff6adc6ff /tensorflow/stream_executor/lib | |
parent | f80ef2d696456c970956f47e7d5aa88bc7ccbdce (diff) |
Merge changes from github.
Change: 137532946
Diffstat (limited to 'tensorflow/stream_executor/lib')
-rw-r--r-- | tensorflow/stream_executor/lib/process_state.cc | 9 | ||||
-rw-r--r-- | tensorflow/stream_executor/lib/static_threadlocal.h | 4 |
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_; \ |