提交 fe3cc321 编写于 作者: Y yangfei

add lock for GetCLPath function

上级 7f782b4f
......@@ -16,6 +16,7 @@ limitations under the License. */
namespace paddle_mobile {
static std::mutex lc;
template <typename Dtype, Precision P>
void PaddleMobile<Dtype, P>::SetThreadNum(int num) {
#ifdef _OPENMP
......@@ -161,7 +162,10 @@ void PaddleMobile<Dtype, P>::Predict_To(int end) {
#ifdef PADDLE_MOBILE_CL
template <typename Dtype, Precision P>
void PaddleMobile<Dtype, P>::SetCLPath(std::string path) {
std::lock_guard<std::mutex> lock(lc);
if (framework::CLEngine::Instance()->GetCLPath() == "") {
framework::CLEngine::Instance()->setClPath(path);
}
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册