diff --git a/src/io/paddle_mobile.h b/src/io/paddle_mobile.h index 1e8f81c51e02ea6bdbdea8694aa62c9c30e6e6a8..778b173f3e64f27f6bdf8329a2979ebbdf955633 100644 --- a/src/io/paddle_mobile.h +++ b/src/io/paddle_mobile.h @@ -37,7 +37,13 @@ class PaddleMobile { typedef typename PrecisionTrait

::ptype Ptype; public: - PaddleMobile() {} + PaddleMobile() { +#ifndef PADDLE_MOBILE_CL + bool is_gpu = std::is_same, 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);