diff --git a/lite/core/memory.h b/lite/core/memory.h index 380222c76430aeb4787bd22f2a82283b4051319a..370db28918c1335c5c33672d66f7673a4a5997a0 100644 --- a/lite/core/memory.h +++ b/lite/core/memory.h @@ -142,8 +142,8 @@ class Buffer { if (target != target_ || cl_image2d_width_ < img_w_req || cl_image2d_height_ < img_h_req || host_ptr != nullptr) { CHECK_EQ(own_data_, true) << "Can not reset unowned buffer."; - cl_image2d_width_ = std::max(cl_image2d_width_, img_w_req); - cl_image2d_height_ = std::max(cl_image2d_height_, img_h_req); + cl_image2d_width_ = (std::max)(cl_image2d_width_, img_w_req); + cl_image2d_height_ = (std::max)(cl_image2d_height_, img_h_req); Free(); data_ = TargetWrapperCL::MallocImage( cl_image2d_width_, cl_image2d_height_, host_ptr);