Merge pull request #11464 from tensor-tang/set_nthreads

initial with only 1 mkl/openblas threads for each pthreads
wangkuiyi-patch-1
Tao Luo 7 years ago committed by GitHub
commit 8f266e2022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,6 +18,7 @@ limitations under the License. */
#include "paddle/fluid/framework/init.h"
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/operators/math/blas.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/string/piece.h"
@ -113,6 +114,9 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
}
places.emplace_back(platform::CPUPlace());
platform::DeviceContextPool::Init(places);
#ifndef PADDLE_WITH_MKLDNN
operators::math::SetNumThreads(1);
#endif
}
void InitGLOG(const std::string &prog_name) {

Loading…
Cancel
Save