You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/20 20:06:43 UTC
[GitHub] szha commented on a change in pull request #7854: Basic CPU Kernel OMP selection based upon whether GPU has been used
szha commented on a change in pull request #7854: Basic CPU Kernel OMP selection based upon whether GPU has been used
URL: https://github.com/apache/incubator-mxnet/pull/7854#discussion_r140078454
##########
File path: src/engine/threaded_engine.h
##########
@@ -293,6 +299,20 @@ class ThreadedEngine : public Engine {
finished_cv_.notify_all();
}
+ /*! \brief Return default OMP thread count. Currently, this is whatever OMP shows as number
+ * of procs
+ */
+ static int DefaultOMPThreadsPerWorker() {
+#ifdef _OPENMP
+ // TODO(cjolivier01): Programatically obtain hyperthreading count (if supported)
+ // Taking max including omp_get_max_threads() in case this implementation of OMP accounts for
+ // hyperthreading
+ return std::max(omp_get_max_threads(), omp_get_num_procs());
Review comment:
How would user opt to use less number of threads than the number of cores?
----------------------------------------------------------------
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