Fix multi-threading bug with WItH_MKL=ON (#14882)

fixes #14884
for_weibo
Wang Guibao 6 years ago committed by GitHub
parent 5384206aec
commit e213050223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,6 +26,7 @@ limitations under the License. */
#include "paddle/fluid/framework/reader.h" #include "paddle/fluid/framework/reader.h"
#include "paddle/fluid/framework/variable_helper.h" #include "paddle/fluid/framework/variable_helper.h"
#include "paddle/fluid/inference/io.h" #include "paddle/fluid/inference/io.h"
#include "paddle/fluid/platform/cpu_helper.h"
#include "paddle/fluid/platform/place.h" #include "paddle/fluid/platform/place.h"
#include "paddle/fluid/pybind/pybind.h" #include "paddle/fluid/pybind/pybind.h"
namespace paddle { namespace paddle {
@ -174,6 +175,8 @@ void print_fetch_var(Scope* scope, std::string var_name) {
} }
void ExecutorThreadWorker::TrainFiles() { void ExecutorThreadWorker::TrainFiles() {
platform::SetNumThreads(1);
// todo: configurable // todo: configurable
SetDevice(); SetDevice();

Loading…
Cancel
Save