You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/31 20:06:22 UTC

[GitHub] eric-haibin-lin commented on a change in pull request #9219: Add storage fallback msg to copyfromto

eric-haibin-lin commented on a change in pull request #9219: Add storage fallback msg to copyfromto
URL: https://github.com/apache/incubator-mxnet/pull/9219#discussion_r159145728
 
 

 ##########
 File path: src/common/utils.h
 ##########
 @@ -339,6 +339,32 @@ inline std::string stype_string(const int x) {
   return "unknown";
 }
 
+/*! \brief get string representation of device type */
+inline std::string dev_type_string(const int dev_type) {
+  switch (dev_type) {
+    case Context::kCPU:
+      return "cpu";
+    case Context::kGPU:
+      return "gpu";
+    case Context::kCPUPinned:
+      return "cpu_pinned";
+    case Context::kCPUShared:
+      return "cpu_shared";
+  }
+  return "unknown";
+}
+
+/*! \brief log message once. Intended for storage fallback warning messages. */
+inline void LogOnce(const std::string& message) {
+  typedef dmlc::ThreadLocalStore<std::unordered_set<std::string>> LogStore;
+  auto log_store = LogStore::Get();
 
 Review comment:
   log_store is a pointer. Is it necessary to use `&`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services