提交 dcbc9a88 编写于 作者: xiebaiyuan's avatar xiebaiyuan

enforce use gpu when gpu is on in CmakeList

上级 a82cebba
......@@ -34,7 +34,13 @@ class PaddleMobile {
typedef typename PrecisionTrait<P>::ptype Ptype;
public:
PaddleMobile() {}
PaddleMobile() {
#ifndef PADDLE_MOBILE_CL
bool is_gpu= std::is_same<DeviceType<kGPU_CL>, Dtype>::value;
PADDLE_MOBILE_ENFORCE(!is_gpu,
"Not Enable GPU in CmakeList but run gpu codes ");
#endif
}
bool Load(const std::string &dirname, bool optimize = false,
bool quantification = false, int batch_size = 1,
bool loddable = false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册