|
|
|
@ -20,16 +20,20 @@ limitations under the License. */
|
|
|
|
|
#include "paddle/fluid/framework/block_desc.h"
|
|
|
|
|
#include "paddle/fluid/framework/feed_fetch_type.h"
|
|
|
|
|
#include "paddle/fluid/framework/op_registry.h"
|
|
|
|
|
#include "paddle/fluid/operators/math/blas.h"
|
|
|
|
|
#include "paddle/fluid/pybind/pybind.h"
|
|
|
|
|
|
|
|
|
|
DEFINE_string(devices, "", "The devices to be used which is joined by comma.");
|
|
|
|
|
DEFINE_bool(init_p2p, false, "Whether to init p2p.");
|
|
|
|
|
DEFINE_int32(math_num_threads, 1,
|
|
|
|
|
"Number of threads used to run math functions.");
|
|
|
|
|
|
|
|
|
|
namespace paddle {
|
|
|
|
|
namespace inference {
|
|
|
|
|
|
|
|
|
|
void Init(const std::vector<std::string> argv) {
|
|
|
|
|
framework::InitGflags(argv);
|
|
|
|
|
operators::math::SetNumThreads(FLAGS_math_num_threads);
|
|
|
|
|
// init devices
|
|
|
|
|
std::vector<int> devices;
|
|
|
|
|
std::string token;
|
|
|
|
|