|
|
@ -15,6 +15,7 @@ limitations under the License. */
|
|
|
|
#include <algorithm>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
#include "paddle/fluid/framework/init.h"
|
|
|
|
#include "paddle/fluid/framework/init.h"
|
|
|
|
#include "paddle/fluid/framework/operator.h"
|
|
|
|
#include "paddle/fluid/framework/operator.h"
|
|
|
@ -28,7 +29,7 @@ namespace framework {
|
|
|
|
std::once_flag gflags_init_flag;
|
|
|
|
std::once_flag gflags_init_flag;
|
|
|
|
std::once_flag p2p_init_flag;
|
|
|
|
std::once_flag p2p_init_flag;
|
|
|
|
|
|
|
|
|
|
|
|
void InitGflags(std::vector<std::string> &argv) {
|
|
|
|
void InitGflags(std::vector<std::string> argv) {
|
|
|
|
std::call_once(gflags_init_flag, [&]() {
|
|
|
|
std::call_once(gflags_init_flag, [&]() {
|
|
|
|
int argc = argv.size();
|
|
|
|
int argc = argv.size();
|
|
|
|
char **arr = new char *[argv.size()];
|
|
|
|
char **arr = new char *[argv.size()];
|
|
|
@ -65,7 +66,7 @@ void InitP2P(int count) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InitDevices(bool init_p2p) {
|
|
|
|
void InitDevices(bool init_p2p) {
|
|
|
|
/*Init all avaiable devices by default */
|
|
|
|
/*Init all available devices by default */
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<platform::Place> places;
|
|
|
|
std::vector<platform::Place> places;
|
|
|
|
places.emplace_back(platform::CPUPlace());
|
|
|
|
places.emplace_back(platform::CPUPlace());
|
|
|
|