提交 3a2bba1e 编写于 作者: W Wang Huan

add paddle.fluid._cuda_synchronize, test=develop

上级 09f19532
...@@ -1663,6 +1663,15 @@ All parameter, weight, gradient are variables in Paddle. ...@@ -1663,6 +1663,15 @@ All parameter, weight, gradient are variables in Paddle.
m.def("is_compiled_with_mkldnn", IsCompiledWithMKLDNN); m.def("is_compiled_with_mkldnn", IsCompiledWithMKLDNN);
m.def("is_compiled_with_brpc", IsCompiledWithBrpc); m.def("is_compiled_with_brpc", IsCompiledWithBrpc);
m.def("is_compiled_with_dist", IsCompiledWithDIST); m.def("is_compiled_with_dist", IsCompiledWithDIST);
m.def("_cuda_synchronize", [](const platform::XPUPlace &place) {
platform::DeviceContextPool::Instance().Get(place)->Wait();
});
m.def("_cuda_synchronize", [](const platform::CUDAPlace &place) {
platform::DeviceContextPool::Instance().Get(place)->Wait();
});
m.def("_cuda_synchronize", [](const platform::CPUPlace &place) {
platform::DeviceContextPool::Instance().Get(place)->Wait();
});
m.def("get_float_stats", []() { m.def("get_float_stats", []() {
std::vector<paddle::platform::ExportedStatValue<float>> float_stats; std::vector<paddle::platform::ExportedStatValue<float>> float_stats;
......
...@@ -90,6 +90,7 @@ from .io import save, load, load_program_state, set_program_state ...@@ -90,6 +90,7 @@ from .io import save, load, load_program_state, set_program_state
from .dygraph.checkpoint import save_dygraph, load_dygraph from .dygraph.checkpoint import save_dygraph, load_dygraph
from .dygraph.varbase_patch_methods import monkey_patch_varbase from .dygraph.varbase_patch_methods import monkey_patch_varbase
from . import generator from . import generator
from .core_avx import _cuda_synchronize
Tensor = LoDTensor Tensor = LoDTensor
enable_imperative = enable_dygraph enable_imperative = enable_dygraph
disable_imperative = disable_dygraph disable_imperative = disable_dygraph
...@@ -133,7 +134,8 @@ __all__ = framework.__all__ + executor.__all__ + \ ...@@ -133,7 +134,8 @@ __all__ = framework.__all__ + executor.__all__ + \
'install_check', 'install_check',
'save', 'save',
'load', 'load',
'VarBase' 'VarBase',
'_cuda_synchronize'
] ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册